who to use string as input?
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
hi everyone
i'm trying to use a string as an input for a function,for example:
function anyFunction(anyString)
length(anyString)
end
the problem is matlb recognise anyString as 1by1 cell and not as 9 char...
thanks!
0 comentarios
Respuesta aceptada
  Iman Ansari
      
 el 27 de Abr. de 2013
        Hi. Try this:
function anyFunction(anyString)
length(anyString{1})
end
Más respuestas (0)
Ver también
Categorías
				Más información sobre Characters and Strings en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

