Plotting equation of two variables

조회 수: 3 (최근 30일)
Yuval
Yuval 2017년 1월 23일
댓글: Yuval 2017년 1월 23일
Hi, I'd appreciate some guidance/assistance plotting: y = -sin^3(theta); x = cos^3(theta) All my attempts have produced graphs slightly different than the desired result (see attachment for my graph of reference=desired result). Could it be that the desired result (my graph of reference) was created trying to plot the equation (its solutions rather) y^2/3 + x^2/3 == 1? Mathematically it appears to be similar yet could it have produced a result somewhat different?

답변 (1개)

KSSV
KSSV 2017년 1월 23일
theta = linspace(0,2*pi) ;
y = -sin(theta).^3;
x = cos(theta).^3 ;
plot(x,y)
  댓글 수: 3
KSSV
KSSV 2017년 1월 23일
I don't think the result is different......to get the plot shown in the image, you need to restrict the values of theta. Use axis([0 1 -1 1]) after plotting using the above code.
Yuval
Yuval 2017년 1월 23일
I have tried that and the curve seems different. Whereas the plot shown in the image converges to zero at (2alpha*z)=~0.7, the plot your code produces only converges to zero at (2alpha*z)=~1. You see, the slope of the curve seems to be different. How may I fix this?

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by