Conversion to cell from double is not possible.

g = {};
for k=1:4
g(k) = {fspecial('gaussian',[2 2],k)};
end
dx = {}; dy = {}; h1=[-1 0 1];h2=[1 0 -1];
for k=1:4
dx(k) = imfilter(g{k},h1);
dy(k) = imfilter(g{k},h2);
end
It gives me the error : Conversion to cell from double is not possible.

 Réponse acceptée

Adam Danz
Adam Danz le 28 Mar 2020
Modifié(e) : Adam Danz le 28 Mar 2020
dx{k} = imfilter(g{k},h1);
dy{k} = imfilter(g{k},h2);
% ^ ^ Use curley brackets
or
dx(k) = {imfilter(g{k},h1)};
dy(k) = {imfilter(g{k},h2)};
% ^ wrap in a cell ^

2 commentaires

thanks a lott
Adam Danz
Adam Danz le 28 Mar 2020
Modifié(e) : Adam Danz le 28 Mar 2020
Glad I could help.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by