How to store sequence of images generated from MATLAB online in a Folder

I have written a code to convert a numerical sequence into a image applying continuous wavelet transform 'scalogram'. I want to save the images into a folder either in cloud or in my computer drive. The following is my code
fb = cwtfilterbank('Signallength',length(x),'Wavelet', 'amor');
colormap = jet(128);
folderpath = fullfile ('E:\','SARS1');
cfs = abs(fb.wt(x));
im = ind2rgb(im2uint8(rescale(cfs)),colormap);
filename = strcat(folderpath,sprintf('%d.jpg',k));
imwrite(imresize(im, [512,512]),filename);
But the code giving me error as:
Error using imwrite
Unable to open file "E:\/SARS_11.jpg" for writing. You might not have write permission.
Is there any way to save it into a folder in online matlab drive my 'mkdir' command ? Otherwise how can I store it into my personal drive?

回答 (2 件)

yanqi liu
yanqi liu 2022 年 5 月 20 日
yes,sir,may be check the folder,such as
fb = cwtfilterbank('Signallength',length(x),'Wavelet', 'amor');
colormap = jet(128);
folderpath = fullfile ('E:/','SARS1');
if ~exist(folderpath, 'dir')
mkdir(folderpath);
end
cfs = abs(fb.wt(x));
im = ind2rgb(im2uint8(rescale(cfs)),colormap);
filename = fullfile(folderpath,sprintf('%d.jpg',k));
imwrite(imresize(im, [512,512]),filename);

1 件のコメント

S Kar
S Kar 2022 年 5 月 20 日
Thank you for the answer but still got an error message as:
"Output file write error --- out of disk space?".

サインインしてコメントする。

Hisham
Hisham 2022 年 5 月 31 日
編集済み: Hisham 2022 年 5 月 31 日

0 投票

MATLAB Online can only save to your MATLAB Drive, and not directly to your physical computer, so you will have to save the files to a folder in your MATLAB Drive and then download the folder to your physical machine.

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

質問済み:

2022 年 5 月 19 日

編集済み:

2022 年 5 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by