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.

 採用された回答

Adam Danz
Adam Danz 2020 年 3 月 28 日
編集済み: Adam Danz 2020 年 3 月 28 日

1 投票

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 件のコメント

valerio auricchio
valerio auricchio 2020 年 3 月 28 日
thanks a lott
Adam Danz
Adam Danz 2020 年 3 月 28 日
編集済み: Adam Danz 2020 年 3 月 28 日
Glad I could help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

製品

質問済み:

2020 年 3 月 28 日

編集済み:

2020 年 3 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by