How do i formulate the following equation function in matlab?

Hi I have following formulation to write in a program but its not going through please guide
Ax = 3r^3B*x/(4d(x^2+y^2+k^2) Ay = 3r^3B*y/(4d(x^2+y^2+k^2)
r = 0.5, d = 1, k = 10, B = 10^6 x= 0:1:10 and y = 0:0.5:10 I need to compile a program to get tables of Ax and Ay
hopefully I have asked in right way this time

Antworten (1)

Roger Stafford
Roger Stafford am 5 Sep. 2014
Bearbeitet: Roger Stafford am 5 Sep. 2014
You are missing four multiplication symbols, one parenthesis, and three dots on each equation. The first one should be:
Ax = 3*r^3*B*x./(4*d*(x.^2+y.^2+k^2));

5 Kommentare

yes you are right but ho could i write a program for this formulation? thanks
You need to span a meshgrid over x and y:
[X,Y]=meshgrid(x,y);
Ax = 3*r^3*B*X./(4*d*(X.^2+Y.^2+k^2));
Thanks but results are lil confusing as I have to plot all solutions along the plan x = 0 and then y = 0... I was expecting to get just 3 columns for Ax,Ay and Az. Please guide if Im wrong
If you check X, you'll see that its first column is all 0. So with
plot(y,Ax(:,1))
you get the respective data.
Thank you, so for Y axis it would be plot(x,Ay(:,1))

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 5 Sep. 2014

Kommentiert:

am 5 Sep. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by