why can't i plot this function? :(

2 ビュー (過去 30 日間)
Hassan Dehghani
Hassan Dehghani 2014 年 5 月 29 日
コメント済み: Hassan Dehghani 2014 年 5 月 29 日
I'm trying to plot this function. It gives me the following error.
Warning: Matrix is singular to working precision
I'm using Matlab 2011a.
G=@(x1,x2)(-(1+cos(12*sqrt(x1^2+x2^2)))/(0.5*(x1^2+x2^2)+2));
x=-5:.1:5; y=-5:.1:5; [x1 x2]=meshgrid(x,y);
mesh(x2,x1,G(x1,x2))

採用された回答

David Sanchez
David Sanchez 2014 年 5 月 29 日
Try it this way:
x = -5:.1:5;
y = -5:.1:5;
[x1 x2] = meshgrid(x,y);
G2 = -(1+cos(12.*sqrt(x1.^2+x2.^2)))./(0.5.*(x1.^2+x2.^2)+2);
mesh(x2,x1,G2)
  1 件のコメント
Hassan Dehghani
Hassan Dehghani 2014 年 5 月 29 日
tnx man, saved my day :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by