필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Connecting lines in 3-d Graph

조회 수: 1 (최근 30일)
Chaklader Asfak
Chaklader Asfak 2011년 9월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a 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 all the points of I want to connect the points of (c,b,a)& (e,f,d) lines and (i,h,g) & (k,l,j)lines.
The Excel file is here:
Hope you wont mind to help me :)

답변 (2개)

Andrew Newell
Andrew Newell 2011년 9월 4일
If you want to combine (c,b,a) and (e,f,d) into a single line, you can do the following:
x = [c; e]; y = [b; f]; z = [a; d];
plot3(x,y,z)

Andrei Bobrov
Andrei Bobrov 2011년 9월 4일
num = xlsread('LVK 3-D Graph_2.xls');
dt = mat2cell(num,size(num,1),ones(size(num,2),1));
plot3(dt{3:-1:1},'-+r',dt{[5 6 4]},'--og',dt{9:-1:7},'-+b', dt{[11 12 10]},'-.xc')
hold on
for i1 = 1:size(num,1)
plot3(num(i1,[3 5]),num(i1,[2 6]),num(i1,[1 4]),'-r',...
num(i1,[9 11]),num(i1,[8 12]),num(i1,[7 10]),'-b');
end
variant full cod
num = xlsread('LVK 3-D Graph_2.xls');
dt = mat2cell(num,size(num,1),ones(size(num,2),1));
id = reshape(1:size(num,2),3,[],2);
id = id(end:-1:1,:,:);
id([1 2],2,:)=id([2 1],2,:);
plot3(dt{id(:,1,1)},'-+r',dt{id(:,2,1)},'--og',dt{id(:,1,2)},'-+b', dt{id(:,2,2)},'-.xc')
hold on
for i1 = 1:size(num,1)
plot3(num(i1,id(1,:,1)),num(i1,id(2,:,1)),num(i1,id(3,:,1)),'-r',...
num(i1,id(1,:,2)),num(i1,id(2,:,2)),num(i1,id(3,:,2)),'-b');
end

이 질문은 마감되었습니다.

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by