Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
初级会员
注册日期: 2009-07-26
帖子: 4
声望力: 0 ![]() |
![]()
请大虾帮帮忙!程序如下:
clear;clc warning off for n=1:20 f{n}=@(t)1/gamma(.2)*2^(-.8*n)*quadl(@(x)x.^(-.8).*sin(2^n*(t-x)),0,t); end for n=1:20 n a{n}=[]; for t=0:.02:1 a{n}=[a{n},f{n}(t)]; end end a=sum(cell2mat(a.')); plot(0:.02:1,a) 现在我想将sin(2^n*(t-x))这个含参函数变成f(2^n*(t-x)),又有f(t)=(t-2)*(t-4)+t*(t-4)+t*(t-2);不知道如何改写程序,自己做了个函数定义但运行不了,还望大虾不吝宝贵时间帮帮忙,本人拜上! 问题补充:我自己做了一个M文件myfun.m自定义 function y=myfun(t); y=(t-2)*(t-4)+t*(t-4)+t*(t-2); 然后代入 clear;clc warning off for n=1:20 f{n}=@(t)1/gamma(.2)*2^(-.8*n)*quadl(@(x)x.^(-.8).*myfun(2^n*(t-x)),0,t); end ~~~报了很多错 不知道哪儿出问题了 还请帮帮忙 谢了 |
![]() |
![]() |