Prev: FFT
Next: i need help in my final year project
From: kalam_gre AZED on 9 May 2010 11:26 "Steven Lord" <slord(a)mathworks.com> wrote in message <hrv4jc$65s$1(a)fred.mathworks.com>... > > "kalam_gre AZED" <kalam_gre(a)mathworks.com> wrote in message > news:hru1pr$4tk$1(a)fred.mathworks.com... > > hello my friends, > > i will be greatful if someone help me out with the > > following error > > thetaB=-pi; > > while thetaB<=pi > > f2=((d^2+t*c^2)*(d^2*c+t^2*c^3-2*t*c^2*cos(y)))/(d*cos(y)-t*c)^3; > > PAS_DB=(Lamd/(4*pi*d))^2*10^.05*(int(f2,t,d/c,t1)); > > plot(thetaB,double(PAS_DB)); > > hold on > > thetaB=thetaB+0.05; > > end > > the error is like as follows > > %DOUBLE cannot convert the input expression into a double array. > > If the input expression contains a symbolic variable, use the VPA function > > instead. > > > > the problem is i am not good with maipulate VPA function. can someone help > > me please. > > > > cheers > > kalam > > > > Your expression contains one or more symbolic variables. You cannot convert > your array to double without providing a numeric value for any such > variables using SUBS. > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > hi steve i tried to convert the double(SUBS(PAS_DB)) this way but still same error, i sent the whole code, can you please check thanks for your time cheers kalam
From: Steven Lord on 9 May 2010 22:12
"kalam_gre AZED" <kalam_gre(a)mathworks.com> wrote in message news:hs6jt0$gei$1(a)fred.mathworks.com... > "us " <us(a)neurol.unizh.ch> wrote in message > <hrv9ml$g3q$1(a)fred.mathworks.com>... >> "kalam_gre AZED" <kalam_gre(a)mathworks.com> wrote in message >> <hru1pr$4tk$1(a)fred.mathworks.com>... *snip* > while thetaB<=pi > f2=((d^2+t*c^2)*(d^2*c+t^2*c^3-2*t*c^2*cos(y)))/(d*cos(y)-t*c)^3; > PAS_DB=(Lamd/(4*pi*d))^2*10^.05*(int(f2,t,d/c,t1)); > %X=(vectorize(PAS_DB)); plot(thetaB,double(PAS_DB)); PAS_DB is a function of the symbolic variable y. Since you have not told MATLAB what value it should substitute into the expression for y, there is NO POSSIBLE WAY for MATLAB to convert PAS_DB into a double. You need to give y a value in the expression for PAS_DB using SUBS before you will be able to convert it into double, which you must do before plotting. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ |