Each time i run my simulation i get the error attached below. Please help

1 回表示 (過去 30 日間)
John
John 2018 年 9 月 13 日
回答済み: OCDER 2018 年 9 月 13 日
Please see the attached image.

採用された回答

OCDER
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 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by