how to plot the graph for the functions 0<x<2 with y=sin x and y=x^3 and how to get point of intersection?

조회 수: 13 (최근 30일)
I will be thankful to your reply..
  댓글 수: 1
Matt J
Matt J 2012년 12월 2일
편집: Matt J 2012년 12월 3일
Replies are unlikely if you show no evidence of having attempted the homework or of having read the MATLAB documentation. If you've done minimal reading of the Getting Started material, you should be aware of the PLOT command and seen examples of its use.

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

답변 (3개)

Walter Roberson
Walter Roberson 2012년 12월 3일
plot(). And fsolve()
  댓글 수: 1
vb
vb 2012년 12월 3일
편집: Walter Roberson 2012년 12월 3일
x=linspace(0,2)
y1=cos(x)
y2=x.^2
plot(x,y1)
plot(x,y2)
grid on
i tried these but getting only one line so how will i get intersection point

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


vb
vb 2012년 12월 3일
편집: Walter Roberson 2012년 12월 3일
x=linspace(0,2,1000);
y1=cos(x);
y2=x.^2;
plot(x,y1);
plot(x,y2);
grid on
I tried this but i need point of intersection of two curves so when i do this in matlab i get only one curve
  댓글 수: 10
Walter Roberson
Walter Roberson 2012년 12월 4일
x_of_intersection = fsolve(@(x)cos(x)-x.^2,1);
y_of_intersection = cos(x_of_intersection);
text(x_of_intersection, y_of_intersection, 'LOOK HERE')

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


NEERAJA
NEERAJA 2024년 1월 13일
Plot y x  sin over 0 2  x  with appropriate labels

카테고리

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