In Matlab, strings are just arrays of characters. So what you really do is compare two arrays. This has an elementary comparison, that is, a characteristic character. So you can do:
all(class(s) == 'double')
but this will give a runtime error if the line length class(s)was not 6. It would be much safer to do:
strcmp(class(s), 'double')
But you really have to do:
isa(s, 'double')
source
share