求解:Matlab 积分# Computation - 科学计算
t*i
1 楼
I want to use linear interpolation to make a function f, then intergrate it,
but matlab says that it is a variable, for example, the code is:
a=[1,2,9,20];
b=[2.5,3.4,4.5,4.8];
[email protected](c) interp1(a,b,c,'linear');
% intergate f from 1 to 20
quad(@f,1,20)
the error is:
"f" was previously used as a variable,
conflicting with its use here as the name of a function or command.
求教:怎么才能改进,让f变为function,而不是variable?
Thanks a lot for your answering!
but matlab says that it is a variable, for example, the code is:
a=[1,2,9,20];
b=[2.5,3.4,4.5,4.8];
[email protected](c) interp1(a,b,c,'linear');
% intergate f from 1 to 20
quad(@f,1,20)
the error is:
"f" was previously used as a variable,
conflicting with its use here as the name of a function or command.
求教:怎么才能改进,让f变为function,而不是variable?
Thanks a lot for your answering!