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?

¿Fue útil?

Solución

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}) .

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top