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

thanks a lott
Adam Danz
Adam Danz 2020년 3월 28일
편집: Adam Danz 2020년 3월 28일
Glad I could help.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

질문:

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