Why are the results of the size function different from the whos function Size?
Mostrar comentarios más antiguos
Why are the results of the size function different from the whos function Size?
Here is an example:
>> excelstring = strfind('ABC DUMP.txt','.xls')
excelstring =
[]
>> size excelstring
ans =
1 11
>> whos excelstring Name Size Bytes Class Attributes
excelstring 0x0 0 double
Respuesta aceptada
Más respuestas (1)
the cyclist
el 15 de Jun. de 2011
Because the syntax for what you wanted is
>> size(excelstring)
Looks like your syntax is giving the size of the string 'excelstring', rather than that of the variable named excelstring.
1 comentario
Chirag Gupta
el 15 de Jun. de 2011
To explain further, size excelstring is equivalent to asking MATLAB to compute size('excelstring').
MATLAB takes the arguments as strings if they are not passed in parenthesis ()
Categorías
Más información sobre Whos en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!