Effacer les filtres
Effacer les filtres

Save paired values from a FOR loop

1 vue (au cours des 30 derniers jours)
Agent Cooper
Agent Cooper le 22 Juil 2014
Commenté : Agent Cooper le 22 Juil 2014
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?

Réponse acceptée

David Young
David Young le 22 Juil 2014
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 commentaire
Agent Cooper
Agent Cooper le 22 Juil 2014
Thank you very much for your answer.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by