Hold on not working with ezplot3

조회 수: 6 (최근 30일)
Sara
Sara 2011년 10월 21일
I'm not sure why the hold on is not working in this example.
syms t1 t2 t3
line1 = [0,0,0] + t1*[0,0,1];
line2 = [1,0,0] + t2*[0,0,1];
line3 = [0,1,0] + t3*[0,0,1];
hold on
ezplot3(line1(1),line1(2),line1(3))
ezplot3(line2(1),line2(2),line2(3))
ezplot3(line3(1),line3(2),line3(3))
hold off
Any clues?

채택된 답변

Wayne King
Wayne King 2011년 10월 21일
Hi Sara, ezplot3() is written in such a way that it undoes the effect of any previously issued hold on command.
In this case you can use plot3()
t = linspace(0,1,300);
plot3(zeros(300,1),zeros(300,1),t);
axis([-2 2 0 2 0 2]);
grid on;
hold on;
plot3(ones(300,1),zeros(300,1),t,'r');
plot3(zeros(300,1),ones(300,1),t,'k');
legend('line1','line2','line3');
  댓글 수: 1
Sara
Sara 2011년 10월 21일
Thanks Wayne. I'll try it out.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by