Forums

Help on MATLAB debugging

Started by kishan85 June 24, 2009
Dear DSP experts,

I am a newbie to this group and also to DSP .Currently am having a DSP
course and practicing MATLAB to learn concepts faster.I am also using the
book Digital Signal Processing Using MATLAB by Dr.Ingle & Dr.Proakis.

When I try to execute the programs ,I get an error undefined function or
method.I think these are programs that are done with MATLAB 5 or some
earlier version.

For example I try to run an example program from chapter 2 , I get the
error ,

??? Undefined function or method 'impseq' for input arguments of type
'double'.

Error in ==> ex020100 at 11
x = 2*impseq(-2,-5,5)-impseq(4,-5,5);
 
I am using MATLAB (R2008B) 7.7.0, I have included the directory where I
have these example programs under file->path . But still I get these
errors.

I have tried other things mentioned in similar posts and also in other
forums like manually using chdir etc.I have not been successful so far.This
has hindered my learning process now.
Could someone please help ?

Thanks & Regards,
Kishan


On Jun 24, 8:39=A0am, "kishan85" <pcrkishan1...@gmail.com> wrote:
> Dear DSP experts, > > I am a newbie to this group and also to DSP .Currently am having a DSP > course and practicing MATLAB to learn concepts faster.I am also using the > book Digital Signal Processing Using MATLAB by Dr.Ingle & Dr.Proakis. > > When I try to execute the programs ,I get an error undefined function or > method.I think these are programs that are done with MATLAB 5 or some > earlier version. > > For example I try to run an example program from chapter 2 , I get the > error , > > ??? Undefined function or method 'impseq' for input arguments of type > 'double'. > > Error in =3D=3D> ex020100 at 11 > x =3D 2*impseq(-2,-5,5)-impseq(4,-5,5); > > I am using MATLAB (R2008B) 7.7.0, I have included the directory where I > have these example programs under file->path . But still I get these > errors. > > I have tried other things mentioned in similar posts and also in other > forums like manually using chdir etc.I have not been successful so far.Th=
is
> has hindered my learning process now. > Could someone please help ? > > Thanks & Regards, > Kishan
I can only take a guess as to your problem. 1. The function impseq is not a Matlab function and must be defined somewhere if it is included in the example program. . 2. The directrory where impseq is defined must be in the Matlab path. Use command "path" in Matlab to see the current path. 3. If the directory where impseq is located is not in the path, then click FILE, then SET PATH to include it.
On 24 Jun, 15:39, "kishan85" <pcrkishan1...@gmail.com> wrote:
> Dear DSP experts, > > I am a newbie to this group and also to DSP .Currently am having a DSP > course and practicing MATLAB to learn concepts faster.I am also using the > book Digital Signal Processing Using MATLAB by Dr.Ingle & Dr.Proakis. > > When I try to execute the programs ,I get an error undefined function or > method.I think these are programs that are done with MATLAB 5 or some > earlier version. > > For example I try to run an example program from chapter 2 , I get the > error , > > ??? Undefined function or method 'impseq' for input arguments of type > 'double'.
Does the file impseq.m exist on your computer? When I google for it, I find that it was uploaded to the matlab file exchange by Proakis. If the author of your book uploaded the file, chances are that the book contains instructions about how and where to obtain these files. Rune
> >I can only take a guess as to your problem. > >1. The function impseq is not a Matlab function and must be defined >somewhere if it is included in the example program. >. >2. The directrory where impseq is defined must be in the Matlab path. >Use command "path" in Matlab to see the current path. > >3. If the directory where impseq is located is not in the path, then >click FILE, then SET PATH to include it. >
Thanks for the help... Yes..It is included in the example program...... The directory is also placed under the path..I did this by File---> Select Path...and the directory is listed when i type path... Actually...The list of examples are these files uploaded by Dr.Proakis here, http://www.mathworks.com/matlabcentral/fileexchange/2189 Those are the set of files that am trying to execute. Thanks again..
>Does the file impseq.m exist on your computer? When I >google for it, I find that it was uploaded to the matlab >file exchange by Proakis. If the author of your book >uploaded the file, chances are that the book contains >instructions about how and where to obtain these files. > >Rune >
Thanks for the tip.. Yes...It is uploaded by Dr.Proakis on the MATLAB file exchange... In the intructions he has given...it is mentioned that the PWS directory to be included in the directory which I did... And then he has mentioned ..that the "matlabsrc" file to be edited to include the path of the directory that contains examples... I did not know how to do that...I searched in the MATLAB directory and found a file matlabsrc.m .... but after i open it ..i did not know how to included the path...it seems complicated for me as beginner.... And so I asked some DSP experts on how to do that...they advised to include the directory under file----> setpath...which i did but still i get the same errors... Here is the link for those files., http://www.mathworks.com/matlabcentral/fileexchange/2189 Thanks & Regards, Kishan
Ultra late, but incase anybody comes across this by a search (like me). You
can define it as below if you don't want to add the function file.

n=[-5:5];  % -5 < n < 5 (greater than or equal)
x = 2*[(n+2) == 0] - [(n-4) == 0] % x[n] = 2d[n+2] - d[n-4] (d=delta)
stem(n,x) % check result