not getting plot , why?
1 次查看(过去 30 天)
显示 更早的评论
for h=0:100:1200
rho = 1.225*((288-0.0065*h)/288)^4.2561;
sigma=0.047193;
V_tip=180;
W=180;
Cd_avg=0.01;
R=2.235;
k=1.1;
A=pi*R.^2;
P_e= 61147.4;
P_req=k*((W)^(3/2))./sqrt(2.*rho.*A)+(Cd_avg*rho*sigma*A.*(V_tip).^3)./(8) +747.643-(0.3*P_e);
V_c=(P_e-P_req)./W;
hold on
plot(V_c,h,'r--');
xlabel("vc");
ylabel("h");
plot(P_req,h,'b')
end
0 个评论
回答(1 个)
Alan Stevens
2021-3-8
Arrange it like this
sigma=0.047193;
V_tip=180;
W=180;
Cd_avg=0.01;
R=2.235;
k=1.1;
A=pi*R.^2;
P_e= 61147.4;
h=0:100:1200;
for i = 1:numel(h)
rho = 1.225*((288-0.0065*h(i))/288)^4.2561;
P_req(i)=k*((W)^(3/2))./sqrt(2.*rho.*A)+(Cd_avg*rho*sigma*A.*(V_tip).^3)./(8) +747.643-(0.3*P_e);
V_c(i)=(P_e-P_req(i))./W;
end
subplot(2,1,1)
plot(V_c,h,'r--');
xlabel("vc");
ylabel("h");
subplot(2,1,2)
plot(P_req,h,'b')
xlabel("preq");
ylabel("h");
2 个评论
Alan Stevens
2021-3-8
Change
subplot(2,1,1)
plot(V_c,h,'r--');
xlabel("vc");
ylabel("h");
subplot(2,1,2)
plot(P_req,h,'b')
xlabel("preq");
ylabel("h");
to
plot(V_c,h,'r--',P_req,h,'b');
xlabel("vc and preq");
ylabel("h");
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Instrument Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!