cannot create mat file.
Mostra commenti meno recenti
>> filename=('s2.wav');
>> y=wavread(filename);
>> [y,Fs,nbits]=wavread(filename);
>> save(filename,'-mat');
why save(filename,'-mat'); does not create the *.mat file?
Risposta accettata
Più risposte (2)
Walter Roberson
il 4 Mag 2016
0 voti
save() is not defined to override your choice of file extensions. If a file already has an extension, then save() will use that extension. So what you are doing is overwriting your .wav file with the mat contents.
If you want to change the extension, then use fileparts to extract the file name without the extension; when there is no extension, .mat will be added.
MHN
il 4 Mag 2016
Just use
save 'filename'
1 Commento
Walter Roberson
il 4 Mag 2016
That would create 'filename.mat' -- literally "filename", not 's2.mat'
Categorie
Scopri di più su Workspace Variables and MAT Files in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!