필터 지우기
필터 지우기

Save paired values from a FOR loop

조회 수: 3 (최근 30일)
Agent Cooper
Agent Cooper 2014년 7월 22일
댓글: Agent Cooper 2014년 7월 22일
I have the following FOR loop
I = imread('image.png')
for i = 2:1:5
init = ones(i)
[J,PSF] = deconvblind(I,init)
end
and I would like to save all the [J,PSF] pairs.
I tried using
for i = 2:1:5
init = ones(i)
[J,PSF] = deconvblind(I,init)
[X(i),Y(i)] = [J,PSF]
end
but I got the " Dimensions of matrices being concatenated are not consistent. " error.
Could, anyone, please, give me a hint on how to solve this?

채택된 답변

David Young
David Young 2014년 7월 22일
You could save them in cell arrays:
X{i} = J;
Y{i} = PSF;
or in a single cell array with two rows:
X{1, i} = J;
X{2, i} = PSF;
  댓글 수: 1
Agent Cooper
Agent Cooper 2014년 7월 22일
Thank you very much for your answer.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by