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/09/08 09:21:59
![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](/uploads/image/z/10914786-18-6.jpg?t=matlab%E6%B1%82%E7%A7%AF%E5%88%86%E7%9A%84%E7%A8%8B%E5%BA%8F%E6%80%8E%E4%B9%88%E7%BC%96%2C%E8%BF%99%E4%B8%AA%E7%A8%8B%E5%BA%8F%E9%94%99%E5%93%AA%E4%BA%86%2C%E8%B0%A2%E8%B0%A2format+long%3Bsyms+x+s%3Bx1%3D%5B15%2C30%2C45%2C60%2C75%2C90%5D%3By1%3D%5B80%2C180%2C300%2C390%2C460%2C550%5D%3Ba%3Dpolyfit%28x1%2Cy1%2C4%29%3By11%3Dpolyval%28a%2Cx1%29x2%3D%5B15%2C30%2C45%2C60%2C75%2C90%5D%3By2%3D%5B80%2C170%2C260%2C350%2C440%2C530%5D%3Bb%3Dpolyfit%28x2%2Cy2%2C1%29%3By22%3Dpolyva)
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)