save images produced in for loop in a .mat file

조회 수: 3 (최근 30일)
Eirik Kvernevik
Eirik Kvernevik 2021년 6월 8일
댓글: Eirik Kvernevik 2021년 6월 9일
I want to do the following :
In the following for loops I want to save the produced image imageiD(i).reg(j) in a .mat file
It is important that the images are ordered according to the indexes i and j in the loop so I can easily find them and use them later.
How can I do this ?
here are the for-loops :
for i = 1:K1
for j = 1:K2
imageiD(i).reg(j) = registerImage(Moving,Fixed);
end
end

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 8일
Here is the completed code:
for i = 1:K1
for j = 1:K2
imageiD(i).reg(j) = registerImage(Moving,Fixed);
FN= strcat(['DATA' num2str(i)], '.mat');
save(FN, 'imageD') % Saved mat files will be DATA1.mat, DATA2.mat, ...
end
end
  댓글 수: 2
Eirik Kvernevik
Eirik Kvernevik 2021년 6월 8일
편집: Eirik Kvernevik 2021년 6월 8일
Thank you for the fast reply Sulaymon. However, your solution is not exactly what I wanted. I would like two indexes in the .mat file. your solution is possible for me to use, but it would be more convenient with (for example) Data{1}.1 Data{1}.2 .....Data({1}.K2
Data{2}.1 Data{2}.2 .......Data{2}.K2
-
-
-
Data{K1}.1 Data{K1}.2.......Data{K1}.K2
I want only one .mat file to store everything in.
how can I do this ?
Eirik Kvernevik
Eirik Kvernevik 2021년 6월 9일
I will rephrase my question in a new question

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by