help-octave
[Top][All Lists]
Advanced

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

Re: undefined variable in a .m file


From: David Bateman
Subject: Re: undefined variable in a .m file
Date: Wed, 11 Jul 2007 15:51:55 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

malik martin wrote:
> 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');
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
>   
Malik,

Please think a bit, this is a trivial question, and doesn't deserve to
be posted.. What value do you want a to have? Set it to it like

a = 1;

D.


-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

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