Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Help for making contour plotting

1 vue (au cours des 30 derniers jours)
Chaklader Asfak
Chaklader Asfak le 18 Août 2011
Clôturé : MATLAB Answer Bot le 20 Août 2021
hello,
I tried to make 2-d plotting along with a contour plot from the data of a Excel file. The M-file is-
clear all
[Num,Txt,Raw]=xlsread('LVK 3-D Graph.xls');
a=Num(:,1);
b=Num(:,2);
c=Num(:,3);
d=Num(:,4);
e=Num(:,5);
f=Num(:,6);
g=Num(:,7);
h=Num(:,8);
i=Num(:,9);
j=Num(:,10);
k=Num(:,11);
l=Num(:,12);
figure(1)
plot(b,a,'-+c', h,g,':*c')
grid on
xlim('auto')
ylim('auto')
title(' Ignition timing = 24 @ knocking condition (cyan) & miss firing condition (yellow)')
xlabel('Air-fuel ratio []')
ylabel('p_mi [bar]')
figure(2)
plot(e,d,'--om',k,j,'-.xg')
grid on
xlim('auto')
ylim('auto')
title(' Air-fuel ratio=1.5 @ knocking condition (magenta) & Miss firing condition (Green)')
xlabel('ZZP [° KW v.OT]')
ylabel('p_mi [bar]')
figure(3)
contour3(c,b,a,'-+c',e,f,d,'--om',i,h,g,':*y', k,l,j,'-.xg' )
grid on
xlim('auto')
ylim('auto')
zlim('auto')
xlabel('ZZP [° kw v.ct]')
ylabel('Air-fuel ratio []')
zlabel('p_mi [bar]')
title('ZZP [° KW v.OT] , Air-fuel ratio [] and p_mi 3-d plot ')
The plot function giving graph but not the contour3 where I needed to make contour vertical of the P-mi axis (a,d,g,j). By the way, name of the column start from a to l. Anyone can help me ? I cant find any option here to ul the excel file , so, I'm giving you the link of 4shared website : http://www.4shared.com/document/DPDlO9np/LVK_3-D_Graph.html
Thanks in advance for your help :)

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 18 Août 2011
To plot a contour map, you need to have the data in matrix. Play with the following example to understand what type of data you need.
[x,y,z]=peaks(10)
figure(1);contour(x,y,z);
figure(2);contour3(x,y,z);
  2 commentaires
Chaklader Asfak
Chaklader Asfak le 18 Août 2011
Dear Fangjun Jiang,
I think I understood it. i meshed a (Pmi) and b (λk) .Then, each will be 20x 20 matrics. I want to make c (zzp)the same [20x20 matrics with each input as 24]. could you please tellme how can I do that ?
Fangjun Jiang
Fangjun Jiang le 18 Août 2011
You mean c=24*ones(20,20)?

Cette question est clôturée.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by