필터 지우기
필터 지우기

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 CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by