extracting data from a cell (in cell the data are images) and i need to store them seperately

조회 수: 1 (최근 30일)
I need to extract the all the contents in a cell and i need to all the contents in a cell
first row in one folder
second row in oone folder
third row in one folder
fourth row in one folder

채택된 답변

Image Analyst
Image Analyst 2021년 9월 21일
You can do something like this:
[rows, columns] = size(EO)
for row = 1 : rows
folder = sprintf('Row %d', row);
if ~isfolder(folder)
mkdir(folder);
end
for col = 1 : columns
baseFileName = sprintf('Row %d, Column %d.png', row, col);
fullFileName = fullfile(folder, baseFileName);
imwrite(EO{row, col}, fullFileName);
end
end
Adapt as needed.

추가 답변 (1개)

Harikrishnan Balachandran Nair
Harikrishnan Balachandran Nair 2021년 9월 22일
Hi,
I understand that you are trying to store the images from each row in different folders.
You can use the 'mkdir' function in matlab to create a subfolder in the current folder , or in the specified parent folder.
For writing an image into a specified file , you can use the 'imwrite' function.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by