필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
Sourav singh
Sourav singh 2021년 4월 5일
댓글: Walter Roberson 2021년 4월 6일
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