Specify the y value where the graph should start

1 Ansicht (letzte 30 Tage)
Marie Vangen
Marie Vangen am 10 Feb. 2021
Beantwortet: madhan ravi am 10 Feb. 2021
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)

Akzeptierte Antwort

madhan ravi
madhan ravi am 10 Feb. 2021
%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)

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by