Save paired values from a FOR loop

6 次查看(过去 30 天)
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;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by