how to move image to a folder in for loop

i have 10 images. and i divide every image into 4 parts.now i want store first part of all images into one folder,second part of all images into second folder... respectively. so what is the code for it..

답변 (2개)

Adewale Obaro
Adewale Obaro 2018년 8월 10일
편집: Adewale Obaro 2018년 8월 10일

0 개 추천

THIS WILL DEFINITELY HELP YOU
destinationFolder = 'C:\Users\ADEWALE\Desktop\FACE\Matlab Projects\MATLAB projects\PCA ICA LDA\traindatabase';
if ~exist(destinationFolder, 'dir') mkdir(destinationFolder);
end
i=randi([140,200]);
baseFileName = sprintf('%d.JPG',i); % e.g. "1.png"
fullFileName = fullfile(destinationFolder, baseFileName);
imwrite(processed_img, fullFileName);

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2013년 4월 22일

편집:

2018년 8월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by