Specify the y value where the graph should start

1 view (last 30 days)
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)

Accepted Answer

madhan ravi
madhan ravi on 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)

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!