"You might not have write permission." error in MATLAB cloud

조회 수: 1 (최근 30일)
Gabriel
Gabriel 2023년 5월 6일
댓글: Gabriel 2023년 5월 6일
I'm trying to save a plot as a jpg using imwrite in MATLAB cloud, but the following error occurs:
Error using imwrite
Unable to open file "/MATLAB Drive\images_d=1_w=0.05_l=0.1_N=40/img_1.png" for writing. You might not have write permission.
It's weird as when I run the same code in MATLAB desktop, everything works fine. Is there any kind of restriction about saving stuff in MATLAB cloud?
Thank you!

채택된 답변

Walter Roberson
Walter Roberson 2023년 5월 6일
MATLAB Cloud runs on Linux systems. On Linux systems, depending on exact context, \ in a file name might just be another character, or might "introduce" a two character special sequence. There does not happen to be a special sequence designated by \i so if \i happened to occur in a context that was expecting the possibility of special sequences, then the \i might lead to an error message because of the bad sequence, or the \i might be treated as just two characters, '\' and 'i'
On Linux systems, \ is never treated as a directory separator.
Moral of the story: use fullfile() to construct paths.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by