Undefined function 'eq' for input arguments of type 'struct'
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
pamela sulis
am 27 Okt. 2015
Bearbeitet: pamela sulis
am 28 Okt. 2015
Hi! I create this code in which s is a struct
if(s(1,1)==[])
i=i+1;
end
I have an error: 'Undefined function 'eq' for input arguments of type 'struct', I don't understand the error's meaning. Someone can help me, thanks
2 Kommentare
Stephen23
am 27 Okt. 2015
Do you want to test if the structure is empty?
If s is a structure, then s(1,1) will also be a structure, which clearly is not a number and so does not make sense to check if it equals something else.
Akzeptierte Antwort
James Tursa
am 27 Okt. 2015
Does this do what you want?
if( isempty(s) )
3 Kommentare
James Tursa
am 27 Okt. 2015
Bearbeitet: James Tursa
am 27 Okt. 2015
I know. It is for readability ... at least to my eyes. Could be as you surmise, because it looks more like C or Fortran, so my brain doesn't have to think as much in determining what is on the line.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures 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!