Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

How to draw this figure?

Asked by Sabarinathan Vadivelu on 4 May 2013

I have these figures with the equation also shown. I tried making this. But I did not got the expected result. Please give me some ideas. here dij is the distance. ru = 10, rs = 5; a = 0.5, m = 0.5;

0 Comments

Sabarinathan Vadivelu

Tags

Products

1 Answer

Answer by Iman Ansari on 4 May 2013
Accepted answer

Hi.

m=0.5;
[x,y]=meshgrid(-11:.1:11);
d=sqrt(x.^2+y.^2);
S=d;
S(d>10)=0;
S(d<=10&d>5)=exp(-0.5.*(d(d<=10&d>5)-5).^m);
S(d<=5)=1;
surf(x,y,S)
axis([-10 10 -10 10 0 1])
shading interp

1 Comment

Sabarinathan Vadivelu on 4 May 2013

Thank you very much.

Iman Ansari

Contact us