フィルターのクリア

Connecting line

1 回表示 (過去 30 日間)
Chaklader Asfak
Chaklader Asfak 2011 年 8 月 19 日
I have a excel file from where I made plot3. The Excel file is here: http://www.4shared.com/file/Gcoz8xa0/Contour.html and coding of the M-file is :
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')
I need to connect all the points of the two lines along Z axis (from z= 5 to 20 each points)(Say, for Z=5, [b,c]= (1.1, 24)and [e,f]=(-34,1.5) ) . Any one can help me how to connect these points ?

採用された回答

Andrei Bobrov
Andrei Bobrov 2011 年 8 月 19 日
added after your code
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))
  2 件のコメント
Chaklader Asfak
Chaklader Asfak 2011 年 8 月 19 日
Thanks. I can understand the reshape one but could you please explain about the arrayfun function ? What is i1 here ?
Andrei Bobrov
Andrei Bobrov 2011 年 8 月 19 日
i1 - variable in anonymous function @(i1)plot3(Num(i1,k(1,:)),Num(i1,k(2,:)),Num(i1,k(3,:)))
% analog use loop
for i1 = 1:size(Num,1)
plot3(Num(i1,k(1,:)),Num(i1,k(2,:)),Num(i1,k(3,:)));hold on;
end

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by