I have bee trying to plot two data set according to their efficiency. If efficiency is greater than .8 the set should be plotted in red or if it less that .8 the data set should be plotted in blue. I am having trouble related the effeminacy with the appropriate data set to plot it. how would i do this, with out hard coding the date set. Efficiency is 'n'
D=[1 2 3 4;2 5 7 5;2 6 7 9;2 4 8 4];
n1= (D(2,:)/D(1,:));
n2 = D(4,:)/D(3,:);
V =[n1 n2];
%plot
figure('color','white');
axis([0 12 0 10]);
xlabel('Energy Input (E1) [MJ]');
ylabel('Kinectic Energy (E0) [MJ]');
title('Efficiency Analysis of Spacecraft Engines','FontSize',20);
grid
for x = min(V):max(V)
if x> 0.80
hold on
elseif x< 0.8
hold on
end
end

댓글 수: 5

KSSV
KSSV 2016년 11월 13일
편집: KSSV 2016년 11월 13일
What you are plotting? Are you plotting points in a loop?
Stephanie Velasco
Stephanie Velasco 2016년 11월 13일
편집: Walter Roberson 2016년 11월 13일
yes i
D=[1 2 3 4;2 5 7 5;2 6 7 9;2 4 8 4];
n1= (D(2,:)/D(1,:));
n2 = D(4,:)/D(3,:);
V =[n1 n2];
for x = min(V):max(V)
if x> 0.80
elseif x< 0.8
end end
Walter Roberson
Walter Roberson 2016년 11월 13일
You do not show any plot calls.
Stephanie Velasco
Stephanie Velasco 2016년 11월 13일
편집: Walter Roberson 2016년 11월 13일
I have the plot before actually going in to the loop,i just didn't show it but its.
%plot
figure('color','white');
axis([0 12 0 10]);
xlabel('Energy Input (E1) [MJ]');
ylabel('Kinectic Energy (E0) [MJ]');
title('Efficiency Analysis of Spacecraft Engines','FontSize',20);
grid
Walter Roberson
Walter Roberson 2016년 11월 13일
No plot calls there. You do not have any line() or plot() or surf() or surface() or patch() or hist() or anything else that actually plots.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

질문:

2016년 11월 12일

댓글:

2016년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by