Conversion to cell from double is not possible.

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

采纳的回答

Adam Danz
Adam Danz 2020-3-28
编辑:Adam Danz 2020-3-28
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 ^

更多回答(0 个)

类别

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

产品

Community Treasure Hunt

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

Start Hunting!

Translated by