How do I create a 2d surface plot for a function of x and y?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
This is what I tried
x=linspace(0,10)
y=linspace(0,10)
[xm,ym]=meshgrid(x,y)
fxy=sin(x).*cos(y)
surf(fxy)
but it gives me
Error using surf (line 71)
Z must be a matrix, not a scalar or vector.
Error in problem3 (line 5)
surf(fxy)
0 Kommentare
Antworten (1)
Kelly Kearney
am 3 Mär. 2020
Bearbeitet: Kelly Kearney
am 3 Mär. 2020
Change
fxy = sin(x).*cos(y)
to
fxy = sin(xm).*cos(ym)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!