Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: help me plot this code -- urgency
Replies: 2   Last Post: Jan 25, 2013 5:13 PM

 Messages: [ Previous | Next ]
 Roger Stafford Posts: 5,929 Registered: 12/7/04
Re: help me plot this code -- urgency
Posted: Jan 24, 2013 5:54 PM

"maia " <antonietta.arista@yahoo.com> wrote in message <kdsank\$br5\$1@newscl01ah.mathworks.com>...
> syms k r n teta z
> n=0:1:5;
> ........
> pin2=((1-eps)*besseli(n,k*re).*besselk(n,k*rs).*diff(besselk(n,k*rs))).*(1./(eps*diff(besselk(n,k*rs)).*besseli(n,k*rs)-besselk(n,k*rs).*diff(besseli(n,k*rs))));
> pin3=2*pin2.*pin1.*pin.*cos(n.*teta);

\- - - - - - - - - - -
In your expression for 'pin2' you have both besselk(n,k*rs) and diff(besselk(n,k*rs)), but these are of different sizes since 'diff' reduces the length by one and an error message would be the result. Also I doubt if 'besseli' and 'besselk' will accept symbolic variables such as k.

One other point. It is inadvisable to use 'sum' as the name of a variable since that conflicts with the reserved name of matlab's 'sum' function.

Roger Stafford

Date Subject Author
1/24/13 Roger Stafford
1/25/13 Roger Stafford