how can i fix this error?

1 Ansicht (letzte 30 Tage)
Mira le
Mira le am 30 Okt. 2019
Kommentiert: Mira le am 30 Okt. 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 Kommentare
langrg
langrg am 30 Okt. 2019
Hi,
You can replace:
if S{p}==S{j}
by :
if isequal(S{p}, S{j})
Mira le
Mira le am 30 Okt. 2019
thank you it works, the execution become low

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by