not getting legend in the plot and not getting y axis name

1 次查看(过去 30 天)
sigma=0.047193;
V_tip=180;
W=180;
Cd_avg=0.01;
R=2.235;
%R1=2.68;
Rv=80.529; %rotational velocity
A=pi*R.^2;
rho=1.225;
Ct=0.0:0.0001:0.12;
for i = 1:numel(Ct)
Vs = -(sqrt(Ct./2)+((sigma*Cd_avg)./(8*Ct))).*(Rv*R); %descent speed
Cd_eq =((2*W)./(rho.*A.*(Vs).^2)); % equivalent drag coefficient of the rotor in steady descent
V_autorotationaldescent = -(sqrt(Ct./2)+((sigma*Cd_avg)./(8*Ct))); % steady autorotational descent rate
Vs1= -(sqrt(Ct./2)+((sigma*Cd_avg)./(8*Ct))).*(Rv*0.625*R);
end
figure(1)
hold on
plot(Ct,-Vs,'r-',Ct,-Vs1,'g');
xlabel("C_t");
ylabel("V_s");
title("Descent Rate vs. Thrust Coefficient");
legend({'Normal Diameter','Diameter x 1.25'},'FontSize',12,'Location','northeast','Orientation','horizontal')
figure(2)
plot(Ct,Cd_eq,'r-',Ct,-V_autorotationaldescent,'b')
xlabel('C_t')
ylabel('Cd_eq')
addaxislabel(2,'steady autorotational descent')
legend({'Cd_(eq)','V_s/\OmegaR'},'FontSize',14,'Location','northeast','Orientation','horizontal')
hold off
% sir i got the plot no.1 with legend and axis name and all.
% having problem in figure 2 not getting lengend and not getting 2 y axis
% name, help sir
  5 个评论
Sourav singh
Sourav singh 2021-4-5
i so a tutorial on youtube regarding " how to add 2 y axis name in matlab" and in that video the person used that command
Walter Roberson
Walter Roberson 2021-4-6
Well, it is not part of MATLAB itself, so to use it in MATLAB you need to install addaxislabel from somewhere such as the File Exchange contribution I linked to.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by