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?
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!