diary fuction is not working, what can i do ?

조회 수: 20 (최근 30일)
Akash kumar
Akash kumar 2013년 12월 26일
댓글: Steven Lord 2022년 4월 19일
>> diary ??? Error using ==> diary abc: Cannot open file: permission denied.
>> diary on ??? Error using ==> diary abc: Cannot open file: permission denied.
  댓글 수: 3
Gustavo Troiano
Gustavo Troiano 2022년 4월 19일
The folder where MATLAB is configured to save your diaries has no writing permission. You can either change the folder permissions (by default, inside your MATLAB installation folder, located at: /bin/win32 or /bin/win64), or run MATLAB as Administrator. I had the same problem and now it is working.
Steven Lord
Steven Lord 2022년 4월 19일
I strongly advise you not to create new files or modify existing files inside your MATLAB installation. Changing the current directory or creating a full file name (with path, using fullfile or something similar) and using that with diary would be my recommendations. You can't run this in MATLAB Answers (the diary function isn't supported) but you could in your local installation of MATLAB.
fn = tempname % Random temporary file name
diary(fn)
peaks % Will display in the diary file
diary off
type(fn)

댓글을 달려면 로그인하십시오.

답변 (2개)

Wayne King
Wayne King 2013년 12월 26일
편집: Wayne King 2013년 12월 26일
It seems you are trying to execute that command in a folder where you don't write permission.
Can you cd to a folder where you have write permission and try that command again?

John D'Errico
John D'Errico 2013년 12월 26일
편집: John D'Errico 2013년 12월 26일
Diary IS working, merely doing what it is capable of doing. Your operating system is preventing MATLAB form doing as you desire.
You don't have write access to the current directory. Read the error message. MATLAB is telling you it cannot open the file.
The fix? Simple. Either change your current directory to one where you DO have write access, or change the access privileges on that directory if you have permission to do so. You should also be able to specify a complete path for the diary file, into a directory where you again have write access.
  댓글 수: 1
Adeel Ashraf
Adeel Ashraf 2017년 6월 7일
편집: Adeel Ashraf 2017년 6월 7일
very simple answer just create new folder on desktop etc right click on it and copy path and paste on command window after write cd like this >> cd 'path' or cd 'C:\Users\Adeel011\Desktop\example-folder' thankx and enjoy

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by