Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Undefined operator '>' for input arguments of type 'cell'. Error in sif (line 374) if (hist(i,1)> a)

1 visualización (últimos 30 días)
amal abbbes
amal abbbes el 25 de Feb. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
for l=1:siz
hist=rt(l);
max=[1 hist(1,1)];
for i=1:36
a=max(2);
if (hist(i,1)> a)
max= [i hist(i,1)];
end
end

Respuestas (1)

dpb
dpb el 25 de Feb. de 2018
Apparently rt is a cell array containing a cell. Hence need to "use the curlies, Luke!" to dereference the content. Try
if hist{i,1}>a
instead.
NB: However, I strongly suggest to use a different variable name than hist; hist is a builtin Matlab histogram function that you've aliased here...
>> which hist
C:\ML_R2016b\toolbox\matlab\datafun\hist.p
>>
For a more precise answer would need to see result of
whos rt
and
whos hist
to see the actual storage pattern.
  2 comentarios
amal abbbes
amal abbbes el 26 de Feb. de 2018
Editada: amal abbbes el 26 de Feb. de 2018
j'ai essaye avec votre méthode mais il ya a une autre erreur qui s'affiche malgré que j'ai bien vérifie les boucles et les dimension des matrices Index exceeds matrix dimensions.
dpb
dpb el 26 de Feb. de 2018
Show code and results as requested with any error in context...no can see your terminal from here.

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by