Help plotting parametric equations

조회 수: 73 (최근 30일)
quentin
quentin 2014년 9월 18일
댓글: Anjali Agrawal 2020년 7월 21일
Im trying to plot a parametric equation given by X= 3t/(1+t3) and Y= 3t2/(1+t3), on two intervals in the same window, the intervals are -30≤ t≤ -1.6 and -0.6≤ t≤ 40 I need to use the plot function to plot this My code for the first interval of t is
t= linspace (-30,-1.6);
X= ((3*t)/(1+t.^3);
Y= ((3*t.^2)/(1+t.^3));
plot(x,y)
When i try to plot this interval, it just draws up a blank graph, with no function plotted. What am i doing wrong, and also, how would i go about plotting the same function on the second interval, and have both plots visible in the same window of the plot? Any help is greatly appreciated, i apologize for any stupid errors, this is my first time using matlab
  댓글 수: 1
Melodee Haney
Melodee Haney 2017년 9월 20일
One thing that I see is that the functions are defined with capital letters 'X' and 'Y', but then a plot is attempted with lower case letters 'x' and 'y'.

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

채택된 답변

Rick Rosson
Rick Rosson 2014년 9월 18일
편집: Rick Rosson 2014년 9월 18일
MATLAB is case sensitive. So please try
plot(X,Y);
Also, please use ./ instead of / in the two equations.
  댓글 수: 2
Kamtochukwu Okafor
Kamtochukwu Okafor 2018년 6월 5일
why would you need to use ./ and not just / ?
Anjali Agrawal
Anjali Agrawal 2020년 7월 21일
since t is an array we want element wise division, which is achieved by using a (.) before /

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

추가 답변 (1개)

quentin
quentin 2014년 9월 18일
편집: quentin 2014년 9월 18일
I just tried it, it worked flawlessly, thank you so much

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by