Matlab file saving permission denied problem.
6 次查看(过去 30 天)
显示 更早的评论
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:

0 个评论
回答(1 个)
Image Analyst
2023-1-7
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!