matlab程序中积分语句一直出错,求原因clear;clc;R0=55;R1=100;R2=25;Pa=0.1;Pd=0.6;Pv=0.1;for r=0:0.01:100if (R2>r&&r>=0)P=0.1;plot(r,P)hold onelseif(R0>=r&&r>=R2)P=sqrt(Pd^2-(Pd^2-Pv^2)*log(r/R0)/log(R2/R0));plot(r,P)F1=int(P,r,R2,R0)hold o
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/31 01:21:09
matlab程序中积分语句一直出错,求原因clear;clc;R0=55;R1=100;R2=25;Pa=0.1;Pd=0.6;Pv=0.1;for r=0:0.01:100if (R2>r&&r>=0)P=0.1;plot(r,P)hold onelseif(R0>=r&&r>=R2)P=sqrt(Pd^2-(Pd^2-Pv^2)*log(r/R0)/log(R2/R0));plot(r,P)F1=int(P,r,R2,R0)hold o
matlab程序中积分语句一直出错,求原因
clear;
clc;
R0=55;
R1=100;
R2=25;
Pa=0.1;
Pd=0.6;
Pv=0.1;
for r=0:0.01:100
if (R2>r&&r>=0)
P=0.1;
plot(r,P)
hold on
elseif(R0>=r&&r>=R2)
P=sqrt(Pd^2-(Pd^2-Pv^2)*log(r/R0)/log(R2/R0));
plot(r,P)
F1=int(P,r,R2,R0)
hold on
else
P=sqrt(Pd^2-(Pd^2-Pa^2)*log(r/R0)/log(R1/R0));
plot(r,P)
F2=int(P,r,R0,R1)
hold on
end
end
F3=pi*Pa*(R1^2-R2^2)
F=F1+F2+F3
在程序中,F2这两句一直报错,请问是什么原因呢?
matlab程序中积分语句一直出错,求原因clear;clc;R0=55;R1=100;R2=25;Pa=0.1;Pd=0.6;Pv=0.1;for r=0:0.01:100if (R2>r&&r>=0)P=0.1;plot(r,P)hold onelseif(R0>=r&&r>=R2)P=sqrt(Pd^2-(Pd^2-Pv^2)*log(r/R0)/log(R2/R0));plot(r,P)F1=int(P,r,R2,R0)hold o
int函数格式使用错误.正确应该为:
F1=int(sym(P),'r',R2,R0)
F2=int(sym(P),'r',R0,R1)
你再试试