How to use the Meshgrid and surf functions?
52 ビュー (過去 30 日間)
古いコメントを表示
I need to create a script that uses the meshgrid and surf functions to generate a 3-D surface plot of the function z = cos(sqrt(x^2 + y^2)) in the domain −7 ≤ x ≤ 7 and −7 ≤ y ≤ 7 (use a step size of 0.1). How would you do this?
0 件のコメント
採用された回答
Walter Roberson
2018 年 7 月 4 日
v = -7:0.1:7;
[x, y] = meshgrid(v, v);
z = cos(sqrt(x.^2 + y.^2));
surf(x, y, z, 'edgecolor', 'none')
0 件のコメント
その他の回答 (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!