matlab求积分的程序怎么编,这个程序错哪了,谢谢format long;syms x s;x1=[15,30,45,60,75,90];y1=[80,180,300,390,460,550];a=polyfit(x1,y1,4);y11=polyval(a,x1)x2=[15,30,45,60,75,90];y2=[80,170,260,350,440,530];b=polyfit(x2,y2,1);y22=polyva
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/14 20:00:21
matlab求积分的程序怎么编,这个程序错哪了,谢谢format long;syms x s;x1=[15,30,45,60,75,90];y1=[80,180,300,390,460,550];a=polyfit(x1,y1,4);y11=polyval(a,x1)x2=[15,30,45,60,75,90];y2=[80,170,260,350,440,530];b=polyfit(x2,y2,1);y22=polyva
matlab求积分的程序怎么编,这个程序错哪了,谢谢
format long;
syms x s;
x1=[15,30,45,60,75,90];
y1=[80,180,300,390,460,550];
a=polyfit(x1,y1,4);
y11=polyval(a,x1)
x2=[15,30,45,60,75,90];
y2=[80,170,260,350,440,530];
b=polyfit(x2,y2,1);
y22=polyval(b,x2)
plot(x1,y11,'r',x2,y22,'g');
s1=@(t)polyval(a,x1);
quad(@(t)s1,15,90)
s2=@(t)polyval(b,x2);
quad(@(t)s2,15,90);
s=double(s1-s2);
fprintf('%d/n',s)
matlab求积分的程序怎么编,这个程序错哪了,谢谢format long;syms x s;x1=[15,30,45,60,75,90];y1=[80,180,300,390,460,550];a=polyfit(x1,y1,4);y11=polyval(a,x1)x2=[15,30,45,60,75,90];y2=[80,170,260,350,440,530];b=polyfit(x2,y2,1);y22=polyva
format long;
syms x s ;
x1=[15,30,45,60,75,90];
y1=[80,180,300,390,460,550];
a=polyfit(x1,y1,4);
y11=polyval(a,x1)
x2=[15,30,45,60,75,90];
y2=[80,170,260,350,440,530];
b=polyfit(x2,y2,1);
y22=polyval(b,x2)
plot(x1,y11,'r',x2,y22,'g');
s1=@(t) polyval(a,t);
s11=quad(s1,15,90)
s2=@(t) polyval(b,t);
s21=quad(s2,15,90)
s111=double(s11-s21)
t = x1;
s12= s1(t);
s22= s2(t);
s=double(s12-s22);
fprintf('%d\n',s)