MATLAB Answers

0

how can i fix this error?

Asked by Mira le on 30 Oct 2019
Latest activity Commented on by Mira le on 30 Oct 2019
"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 Comments

langrg
on 30 Oct 2019
Hi,
You can replace:
if S{p}==S{j}
by :
if isequal(S{p}, S{j})
Mira le on 30 Oct 2019
thank you it works, the execution become low

Sign in to comment.

1 Answer

Answer by Sai Bhargav Avula on 30 Oct 2019
 Accepted Answer

Hi, One way is by using isequal function.
For Example
if isequal(S{p},S{j})

  0 Comments

Sign in to comment.