Sine function in 2D

28 Ansichten (letzte 30 Tage)
Sucheta
Sucheta am 16 Dez. 2022
Kommentiert: Sucheta am 19 Dez. 2022
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!

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by