cannot create mat file.
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nor Ashikin
el 4 de Mayo de 2016
Comentada: Nor Ashikin
el 4 de Mayo de 2016
>> filename=('s2.wav');
>> y=wavread(filename);
>> [y,Fs,nbits]=wavread(filename);
>> save(filename,'-mat');
why save(filename,'-mat'); does not create the *.mat file?
0 comentarios
Respuesta aceptada
CS Researcher
el 4 de Mayo de 2016
You should do this:
filename = 's2.wav';
[y, Fs] = audioread(filename);
save('s2.mat','y');
4 comentarios
Walter Roberson
el 4 de Mayo de 2016
mat files do not appear in workspaces. Variables appear in workspaces. But not if you are using a static workspace
Más respuestas (2)
Walter Roberson
el 4 de Mayo de 2016
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.
0 comentarios
MHN
el 4 de Mayo de 2016
Just use
save 'filename'
1 comentario
Walter Roberson
el 4 de Mayo de 2016
That would create 'filename.mat' -- literally "filename", not 's2.mat'
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!