how can i fix this error?

조회 수: 10 (최근 30일)
Mira le
Mira le 2019년 10월 30일
댓글: Mira le 2019년 10월 30일
"Undefined operator '==' for input arguments of type 'cell'."
this error appear when I want to compare the similarity between two element in cell like that:
for j=1:numel(S)
if S{p}==S{j}
S{j}={};
end
end
Thanks
  댓글 수: 2
langrg
langrg 2019년 10월 30일
Hi,
You can replace:
if S{p}==S{j}
by :
if isequal(S{p}, S{j})
Mira le
Mira le 2019년 10월 30일
thank you it works, the execution become low

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

채택된 답변

Sai Bhargav Avula
Sai Bhargav Avula 2019년 10월 30일
Hi, One way is by using isequal function.
For Example
if isequal(S{p},S{j})

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by