help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

undefined variable in a .m file


From: malik martin
Subject: undefined variable in a .m file
Date: Wed, 11 Jul 2007 04:12:06 -0400

hi,
if i knew the syntax to declare a variable in matlab, then maybe i
wouldnt be asking this, but i get this error saying:

`a' undefined near line 5 column 11

in this code:

1   % Read input sound file into vector x(n) and sampling frequency FS
2   [x,FS]=wavread('ton2.wav');
3   % Sample-by sample algorithm y(n)=a*x(n)
4   for n=1:length(x),
5   y(n)=a * x(n); <------- ERROR IS HERE
6   end;
7   % Write y(n) into output sound file with number of
8   % bits Nbits and sampling frequency FS
9   wavwrite(y,FS,Nbits,'tonealg.wav');


reply via email to

[Prev in Thread] Current Thread [Next in Thread]