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

조회 수: 3 (최근 30일)
x=0:1:10;
y=0:1:10;
z=0:1:10;
for j=0:1:10
for i=0:1:10
x=x+i;
end
plot3(x,y,z)
end

답변 (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월 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??
sixwwwwww
sixwwwwww 2013년 12월 9일
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')

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2013년 12월 7일
Add
hold on
after the plot3()

카테고리

Help CenterFile Exchange에서 Graphics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by