wavread problem after creation of executable file
1 view (last 30 days)
Show older comments
Hi all! I use in my matlab code the wavread function and all goes ok when i run my script from matlab console.
I just do:
*code*** [data,Fs,nbits] = wavread ('C:\test.wav'); *code***
but when I call the deploytool in order to create an executable file (test.exe) that i can launch from my command line, in the dos prompt i receive the error:
Error using ==> wavread at 67 Cannot open file. wavread:InvalidFile
It could be a problem related to the way I use to deploy the script?
Thx in advance
Sergio
2 Comments
TomL
on 25 May 2012
Hi there,
Does anyone have an explanation for this problem? I've got the same problem, and hence would be interested in knowing how to solve it.
Many thanks
Walter Roberson
on 25 May 2012
TomL: to check, are you compiling a function or compiling a script ? You get strange errors if you compile a script.
Also are you providing an absolute path to the file? And the file exists on the target system? Or are you including the file in the project and locating it with cftroot ?
Answers (2)
Walter Roberson
on 15 Sep 2011
Which MATLAB version are you using? If I recall correctly, it only become possible to compile scripts (instead of functions) as of R2010b (perhaps it was R2011a)
Nick Ng
on 18 Sep 2020
Hi,
I also got the same problem when running wavread with R2019a
file 1 = 'recisg.wave'
Error using wavread (line 67)
cannot open file
% Open WAV file:
[fid,msg] = open_wav(file);
if ~isempty(msg)
error('wavread:InvalidFile', msg);
end
~~~
Nick
0 Comments
See Also
Categories
Find more on Standalone Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!