matlab循环计算x=0:0.05:5.493;for i=1:110; f(x(i),y)=(3*5.493-x(i))*x(i)^2*(y-5.493)+2*5.493*(x(i)-y)*heaviside(x(i)-y);h(y)=-638.38+3265.159*y-1202.289*y^2+261*y^3-52.69*y^4+4.43*y^5;F(x(i))=int(f(x(i),y)*h(y),0,5.493);end程序提示Error using

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 05:10:39

matlab循环计算x=0:0.05:5.493;for i=1:110; f(x(i),y)=(3*5.493-x(i))*x(i)^2*(y-5.493)+2*5.493*(x(i)-y)*heaviside(x(i)-y);h(y)=-638.38+3265.159*y-1202.289*y^2+261*y^3-52.69*y^4+4.43*y^5;F(x(i))=int(f(x(i),y)*h(y),0,5.493);end程序提示Error using
matlab循环计算
x=0:0.05:5.493;
for i=1:110;
f(x(i),y)=(3*5.493-x(i))*x(i)^2*(y-5.493)+2*5.493*(x(i)-y)*heaviside(x(i)-y);
h(y)=-638.38+3265.159*y-1202.289*y^2+261*y^3-52.69*y^4+4.43*y^5;
F(x(i))=int(f(x(i),y)*h(y),0,5.493);
end
程序提示
Error using ==> Y
Too many output arguments.

matlab循环计算x=0:0.05:5.493;for i=1:110; f(x(i),y)=(3*5.493-x(i))*x(i)^2*(y-5.493)+2*5.493*(x(i)-y)*heaviside(x(i)-y);h(y)=-638.38+3265.159*y-1202.289*y^2+261*y^3-52.69*y^4+4.43*y^5;F(x(i))=int(f(x(i),y)*h(y),0,5.493);end程序提示Error using
syms y; %首先需要将y定义为symbol
x=0:0.05:5.493;
for i=1:110;
f=(3*5.493-x(i))*x(i)^2*(y-5.493)+2*5.493*(x(i)-y)*heaviside(x(i)-y); %其次,这里f,h,F不是函数,不能加参数
h=-638.38+3265.159*y-1202.289*y^2+261*y^3-52.69*y^4+4.43*y^5;
F=int(f*h,0,5.493)
end