i want to draw 10 lines from x =0 till x=10 in 3d i tried but i wouldnt get my result any thoughts??

回答 (2 件)

sixwwwwww
sixwwwwww 2013 年 12 月 7 日
編集済み: sixwwwwww 2013 年 12 月 7 日
do need something like this:
x = 1:10;
y = 1:10;
for i = 1:10
plot3(x, y, x + i), hold on
end
Is it correct?

4 件のコメント

abed
abed 2013 年 12 月 7 日
better than mine thats for sure but i want 10 lines parallel to the y axis only not y=x but that is a very good strategy I never though I could put 'i' in the 3dplot
sixwwwwww
sixwwwwww 2013 年 12 月 8 日
編集済み: sixwwwwww 2013 年 12 月 8 日
for lines along parallel to y-axis you can do as follow:
x = ones(1, 10);
y = 1:10;
for i = 0:9
plot3(x + i, y, x), hold on
end
xlabel('x'), ylabel('y'), zlabel('z')
Is it what you need?
abed
abed 2013 年 12 月 9 日
it is almost perfect but i want it with z=0 i tried to put z=0 in the plot 3d i couldnt because in this case the interval of z and x wont be the same so what should i do??
you can plot at z = 0 as follow:
x = ones(1, 10);
y = 1:10;
z = zeros(1, 10);
for i = 0:9
plot3(x + i, y, z), hold on
end
xlabel('x'), ylabel('y'), zlabel('z')

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

Add
hold on
after the plot3()

1 件のコメント

abed
abed 2013 年 12 月 7 日
編集済み: abed 2013 年 12 月 8 日
i still get the same figure

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

カテゴリ

質問済み:

2013 年 12 月 7 日

コメント済み:

2013 年 12 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by