필터 지우기
필터 지우기

find the euclidean distance

조회 수: 1 (최근 30일)
vasantha malairamar
vasantha malairamar 2017년 4월 5일
댓글: Jan 2017년 4월 5일
for bd=1:144
for fd=1:128
D =(sum((fe(bd,fd)-U(bd,fd)).^2));
s=sqrt(D);
end
end
Undefined operator '-' for input arguments of type 'cell'.
Error in samptest (line 239) D =(sum((fe(bd,fd)-U(bd,fd)).^2));

답변 (2개)

Walter Roberson
Walter Roberson 2017년 4월 5일
D =(sum((fe{bd,fd}-U(bd,fd)).^2));
  댓글 수: 2
vasantha malairamar
vasantha malairamar 2017년 4월 5일
same error.....
Jan
Jan 2017년 4월 5일
Then U is a cell also?!

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


Jan
Jan 2017년 4월 5일
편집: Jan 2017년 4월 5일
The error message is clear: One or two of the arguments of the - operation is a cell, but you cannot perform arithmetic operations with cells.
Use the debugger to find the reason of your problem. Type this in the command window:
dbstop if error
Now run the code and wait until Matlab stops at teh error. Now check the types of the locally used variables:
% D =(sum((fe(bd,fd)-U(bd,fd)).^2))
class(fe)
class(U)
Perhaps walter's suggestion does not work, if if was not fe but U -- well, his idea is still correct and I'd expect you can apply the changes for U by your own.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by