Sine function in 2D

9 次查看(过去 30 天)
Sucheta
Sucheta 2022-12-16
评论: Sucheta 2022-12-19
I have already used the simple plot command but how can pcolor and contour plot be used to plot sine and cosine function in 2D? Need help!

采纳的回答

KSSV
KSSV 2022-12-16
x = linspace(0,2*pi) ;
y = x ;
[X,Y] = meshgrid(x,y) ;
Z = sin(X) ;
surf(X,Y,Z)
  1 个评论
Sucheta
Sucheta 2022-12-19
Thank you! Could you also tell me how the light and lighting function can be used for the same?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by