3 - d Graph in Matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
I need some help for making a graph. For example I had M-file :
clear all
[Num,Txt,Raw]=xlsread('Contour.xlsx');
a=Num(:,1);
b=Num(:,2);
c=Num(:,3);
d=Num(:,4);
e=Num(:,5);
f=Num(:,6);
figure(3);
plot3(c,b,a,'-+r',e,f,d,'--og')
grid on
xlim('auto')
ylim('auto')
zlim('auto')
xlabel('X')
ylabel('Y')
zlabel('Z')
hold on
k = reshape([3 2 1 5 6 4],3,[]);
arrayfun(@(i1)plot3(Num(i1,k(1,:)),Num(i1,k(2,:)),Num(i1,k(3,:))),1:size(Num,1))
Which makes the graph connecting all the points in a 3-d potting along the vertical axis with the Excel file : http://www.4shared.com/file/Gcoz8xa0/Contour.html
I WANT MAKE THE SAME FROM THIS EXCEL FILE AND M-FILE:
M-file:
clear all
[Num,Txt,Raw]=xlsread('LVK 3-D Graph_2.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);
plot3(c,b,a,'-+r',e,f,d,'--og',i,h,g,'-+b', k,l,j,'-.xc')
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 ')
................................................................
I want to connect the points of (c,b,a)& (e,f,d) and (i,h,g) & (k,l,j)
The Excel file is here:
Hope you wont mind to help me :)
댓글 수: 1
Jan
2011년 8월 27일
Ok. You want to connect the mentioned points. And what does the posted code do? What do you wnat to be changed? Is there any problem in the first program you have posted? If not, it would be helpful if you remove it from the post.
답변 (1개)
Rick Rosson
2011년 8월 28일
You may want to consider the line function. For more information:
>> doc line
HTH.
Rick
댓글 수: 0
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!