how to modify a plot
Show older comments
Hello, please could you help me with a code?
So I plotted a graph, and I need to continue my orange and yellow line until the green line and shade the region?
clear all
W=45000;
S=9;
b=7.5;
clmax=2;
clmin=-1;
nmax=4;
AR=7;
nmin=-3;
clalpha = 2*pi;
Vdive=290;
Vstall=sqrt(2*W/(1.225*S*clmax));
cd0 = 0.005;
k = 1/pi/AR;
n1v = 0:0.25:4;
i=0;
for n1 = 0:0.25:4
i=i+1;
V(i) = sqrt(2*n1*W/1.225/S/clmax);
nmaxx(i)=nmax;
nminn(i)=nmin;
end
j=0;
n2v = -3:0.25:0;
for n2 = -3:0.25:0
j=j+1;
V2(j) = sqrt(2*n2*W/1.225/S/clmin);
nmaxx(j)=nmax;
nminn(j)=nmin;
end
k=0;
nv=-3:0.25:4;
for n=-3:0.25:4
k=k+1;
Vmax(k)=Vdive;
end
figure(5); plot(V,n1v)
hold on
plot(V,nmaxx)
hold on
plot(V,nminn)
hold on
plot(V2,n2v);
plot(Vmax,nv);
xlim([-1 400]);
ylim([-5 5]);
Accepted Answer
More Answers (1)
Sulaymon Eshkabilov
on 17 Feb 2023
Edited: Sulaymon Eshkabilov
on 17 Feb 2023
This is how it can be attained:
clear all
W=45000;
S=9;
b=7.5;
clmax=2;
clmin=-1;
nmax=4;
AR=7;
nmin=-3;
clalpha = 2*pi;
Vdive=290;
Vstall=sqrt(2*W/(1.225*S*clmax));
cd0 = 0.005;
k = 1/pi/AR;
n1v = 0:0.25:4;
i=0;
for n1 = 0:0.25:4
i=i+1;
V(i) = sqrt(2*n1*W/1.225/S/clmax);
nmaxx(i)=nmax;
nminn(i)=nmin;
end
j=0;
n2v = -3:0.25:0;
for n2 = -3:0.25:0
j=j+1;
V2(j) = sqrt(2*n2*W/1.225/S/clmin);
nmaxx(j)=nmax;
nminn(j)=nmin;
end
k=0;
nv=-3:0.25:4;
for n=-3:0.25:4
k=k+1;
Vmax(k)=Vdive;
end
%%
figure(5);
plot(V,n1v, 'r-')
hold on
V1 = [V, Vmax(1)];
Nm1 = [nmaxx, nmaxx(1)];
plot(V1,Nm1, 'b-')
hold on
V1 = [V, Vmax(1)];
Nm2 = [nminn, nminn(end)];
plot(V1,Nm2, 'k-')
hold on
plot(V2,n2v, 'm-');
plot(Vmax,nv, 'g-', 'linewidth', 2);
xlim([-1 400]);
ylim([-5 5]);
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

