Matlab file saving permission denied problem.

6 visualizaciones (últimos 30 días)
M S
M S el 7 de En. de 2023
Respondida: Image Analyst el 7 de En. de 2023
I do the following code but when I try to save the 'database' the result is coming out as "Unable to write file database: permission denied."
I can't understand why this happens. please help me.
This is my code:
clear
clc
%store features
for i=1:3
filename=strcat('D:\Project\Matlab files\Youtube code\ku', num2str(i),'.wav');
b = audioread(filename);
%[z, fs(1)]= audioread(filename);
%sound(z, fs(1))
FE=VoiceFeatures(b);
try
load database
F=[F;FE];
FN=[FN;i];
database=[database;F;FN];
save database
catch
F=FE; %Features
FN=i;
save database
end
end
and this is showing in command window:

Respuestas (1)

Image Analyst
Image Analyst el 7 de En. de 2023
Look like you might have the file open in MATLAB or in some other program, like the operating system's media player program so it's locked and you can't change it. Make sure it's not open in any other program. Then try putting
fclose('all');
at the beginning of your program. If it's open in MATLAB, this should close it.
Attach database.mat if you still have trouble.

Categorías

Más información sobre Introduction to Installation and Licensing 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!

Translated by