作业帮 > 综合 > 作业

matlab中This statement is incomplete.的错误

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/12 21:11:36
matlab中This statement is incomplete.的错误
clear;
clc;
R0=55;
R1=100;
R2=25;
Pa=0.1;
Pd=0.6;
Pv=0.1;
r=0:0.01:100;
if(R1>=r>=R0)
P=sqrt(Pd^2-(Pd^2-Pa^2)*log(r/R0)/log(R1/R0));
else if(R0>=r>=R2)
P=sqrt(Pd^2-(Pd^2-Pv^2)*log(r/R0)/log(R2/R0));
plot(r,P);
不知道错在哪里,请大家指导一下
matlab中This statement is incomplete.的错误
clear;clc;
R0=55;
R1=100;
R2=25;
Pa=0.1;
Pd=0.6;
Pv=0.1;
for r=0:0.01:100
if(R1>=r & r>=R0)
P=sqrt(Pd^2-(Pd^2-Pa^2)*log(r/R0)/log(R1/R0));
plot(r,P)
hold on
else if(R0>=r & r>=R2)
P=sqrt(Pd^2-(Pd^2-Pv^2)*log(r/R0)/log(R2/R0));
hold on
end
end
end