Expert Guide Required for plotting this array

조회 수: 1 (최근 30일)
Muhammad Ali Shah
Muhammad Ali Shah 2022년 1월 15일
댓글: Muhammad Ali Shah 2022년 1월 16일
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!

채택된 답변

Cris LaPierre
Cris LaPierre 2022년 1월 16일
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)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by