the length of the first element in cell array ab
is 1, because it is a single element. If you want the length of the contents of that element you need to use curly brackets, such as, length(a{1})
.
Why does MATLAB tell me the length of the string '01' is 1?
-
30-08-2022 - |
Pregunta
I have a cell array ab
, where ab(1)='01'
. MATLAB gives me that length('01')=2
, but that length(ab(1))=1
. Why is this? How can I make it not so?
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow