hello all,
i have written a function that will import a .wav file for analysis using MATLAB's wavread funtion. I am trying to have the filename be an input to the function (in addition to the input arguments which so far have posed no problems) instead of hardcoding the filename into the function, but cannot seem to get this to work.
Stephen Antonelli wrote:
> hello all,
> i have written a function that will import a .wav file for analysis using MATLAB's wavread funtion. I am trying to have the filename be an input to the function (in addition to the input arguments which so far have posed no problems) instead of hardcoding the filename into the function, but cannot seem to get this to work.
Just pass in a string variable containing the filename.
"Stephen Antonelli" <antone@cooper.edu> wrote in message <gg7h9m$4mu$1@fred.mathworks.com>...
> markym <no@email.com> wrote in message <gg0sg8$6dq$2@news.oulu.fi>...
>
> i cant seem to get it. perhaps it is the syntax?
> i have [outs] = func(in1,in2,in3,filename)
>
> but when the function tries to run with the file tuned.wav i get:
> ??? Undefined function or variable "tuned.wav".
>
Are you passing the filename in quotes???
filename = 'somefile.wav';
[outs] = func(in1,in2,in3,filename)
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Disclaimer prior to use.