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?

7 次查看(过去 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()

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