how to draw surface
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
0 投票
how do I write the program that draws the two-dimensional integral surface of the function in Matlab ?採用された回答
Ameer Hamza
2020 年 5 月 8 日
編集済み: Ameer Hamza
2020 年 5 月 8 日
You can draw it using meshgrid and surf
[X, Y] = meshgrid(linspace(-3,3));
Z = exp(-X.^2-Y.^2);
surf(X,Y,Z)
shading interp

9 件のコメント
Beyza Taka
2020 年 5 月 8 日
Thank You but I need the surface of the function's integral.
Ameer Hamza
2020 年 5 月 8 日
But the limits on the integral are constant. They need to be variable to plot a surface. Can you show which limits of the integral are varying?
Beyza Taka
2020 年 5 月 8 日
limits given from 0 to 2
Ameer Hamza
2020 年 5 月 8 日
編集済み: Ameer Hamza
2020 年 5 月 8 日
I guess you want something like this
[X, Y] = meshgrid(linspace(0,2));
fun = @(X,Y) integral2(@(x,y) exp(-x.^2-y.^2), 0, X, 0, Y);
Z = arrayfun(fun, X, Y);
surf(X,Y,Z)
shading interp

Beyza Taka
2020 年 5 月 8 日
yes but gives error on Line 3.
Ameer Hamza
2020 年 5 月 8 日
There was a typo. Try again.
Beyza Taka
2020 年 5 月 8 日
Thank you very much, it works.
Ameer Hamza
2020 年 5 月 8 日
I am glad to be of help.
Ameer Hamza
2020 年 5 月 8 日
FYI, this is a faster version of the previous code in the comment
syms x y X Y
fun = matlabFunction(int(int(z,x,0,X),y,0,Y), 'Var', {X, Y});
[Xg, Yg] = meshgrid(linspace(0,2));
Z = arrayfun(fun, Xg, Yg);
surf(Xg,Yg,Z)
shading interp
その他の回答 (0 件)
カテゴリ
ヘルプ センター および 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!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
