How do I create a 2d surface plot for a function of x and y?
8 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Kelly Kearney
2020 年 3 月 3 日
編集済み: Kelly Kearney
2020 年 3 月 3 日
Change
fxy = sin(x).*cos(y)
to
fxy = sin(xm).*cos(ym)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!