Expert Guide Required for plotting this array

1 Ansicht (letzte 30 Tage)
Muhammad Ali Shah
Muhammad Ali Shah am 15 Jan. 2022
Hi guys! I am trying to plot a curve for some parameter 'ROC' with height 'h'. I've got air density for each height I want to use in an array;
Using this array, I calculated ROC for each height. Now I don't know how to plot this ROC with Heights (in ft). Like how can I assign my densities for each height because I need a plot for ROC versue height. Here's my code
clc %ROC AND VROCmax with altitude
clear all
W = 535500;
CD_not = 0.029;
S=3892;
LD=14;
p = [0.002377 0.002048 0.001756 0.001496 0.001267 0.001066 0.000891 0.000738 0.000587];
T = (142000).*((p./0.002377).^0.6)
Z = 1 + ((1+(3./((LD.^2).*((T/W).^2)))).^0.5)
ROC = ((((W/S).*Z)./(3.*p.*CD_not)).^0.5).*((T/W).^1.5).*(1-(Z/6)-(3./(2.*((T/W).^2).*(LD.^2).*Z)))
V = ((((T./W).*(W/S).*Z)/(3.*p.*CD_not)).^0.5)
h = [0 5000 10000 15000 20000 25000 30000 35000 40000] = [p] % 0 implies sea level with density 0.002377, 5000 implies 5000ft with density 0.002048 etc
Incorrect use of '=' operator. Assign a value to a variable using '=' and compare values for equality using '=='.
plot (ROC,h)
An expert guide is welcomed. Thanks!

Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 16 Jan. 2022
You plotting code is fine. The issue is the syntax error in the line before your plot command. I'm not sure what the '= [p]' is supposed to do, so I removed it. Now your code produces a plot with ROC on the x axis and h on the y axis.
clc %ROC AND VROCmax with altitude
clear all
W = 535500;
CD_not = 0.029;
S=3892;
LD=14;
p = [0.002377 0.002048 0.001756 0.001496 0.001267 0.001066 0.000891 0.000738 0.000587];
T = (142000).*((p./0.002377).^0.6);
Z = 1 + ((1+(3./((LD.^2).*((T/W).^2)))).^0.5);
ROC = ((((W/S).*Z)./(3.*p.*CD_not)).^0.5).*((T/W).^1.5).*(1-(Z/6)-(3./(2.*((T/W).^2).*(LD.^2).*Z)));
V = ((((T./W).*(W/S).*Z)/(3.*p.*CD_not)).^0.5);
h = [0 5000 10000 15000 20000 25000 30000 35000 40000]; % 0 implies sea level with density 0.002377, 5000 implies 5000ft with density 0.002048 etc
plot (ROC,h)

Weitere Antworten (0)

Kategorien

Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by