how can i fix this error?

1 次查看(过去 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 中查找有关 Operators and Elementary Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by