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

1 次查看(过去 30 天)
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