Each time i run my simulation i get the error attached below. Please help
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
OCDER
2018 年 9 月 13 日
Are you using cd, change directory, anywhere in your code to go to that Program File folder? What is your current working directory, when you type cd ?
Change your current working directory to one where you have permission to create files.
WorkDir = 'c:\Users\user_name\Desktop\MyFolder'; %Your working directory
if ~exist(WorkDir, 'dir')
mkdir(WorkDir) %Make sure you do have a directory
end
cd(WorkDir)
run your code now
The better solution is to find the code where you are trying to write files, and make sure to use the FULL FILE PATH, and not relative file path.
For instance,
plot(1:10, 1:10)
[FileName, FilePath] = uiputfile('*.png');
saveas(gcf, FileName) %will save to current working dir
saveas(gcf, fullfile(FilePath, FileName)) %will save to an exact location
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!