Specify the y value where the graph should start

조회 수: 1 (최근 30일)
Marie Vangen
Marie Vangen 2021년 2월 10일
답변: madhan ravi 2021년 2월 10일
Im trying to make a graph with two plots where the one called n should only plot up to y = 0.593, but im kinda stuck on how to do that
%Variabler
A_sveip = 2.27;
luft_tett = 1.225;
%Virkningsgrad
v_0k5 = [0:0.5:30.5];
P_0k5 = [0 0 0 0 0 20 30 50 70 95 120 160 210 270 310 360 390 420 470 540 670 730 750 760 770 775 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 0 0 0 0 0 0 0 0 0 0 0 0];
n=[];
for i = 1:length(v_0k5)
y(i) = (2*P_0k5(i))/(luft_tett*A_sveip.*((v_0k5(i))^3));
n = y < 0.593;
end
yyaxis right
plot(v_0k5,n)
yyaxis left
hold on
plot (v_0k5,P_0k5)

채택된 답변

madhan ravi
madhan ravi 2021년 2월 10일
%Variabler
A_sveip = 2.27;
luft_tett = 1.225;
%Virkningsgrad
v_0k5 = [0:0.5:30.5];
P_0k5 = [0 0 0 0 0 20 30 50 70 95 120 160 210 270 310 360 390 420 470 540 670 730 750 760 770 775 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 780 0 0 0 0 0 0 0 0 0 0 0 0];
y = (2*P_0k5) ./ (luft_tett*A_sveip.*v_0k5.^3);
in = y < 0.593;
yyaxis right
plot(v_0k5(in), y(in))
yyaxis left
hold on
plot(v_0k5, P_0k5)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by