who to use string as input?

1 visualizzazione (ultimi 30 giorni)
Refael
Refael il 27 Apr 2013
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!

Risposta accettata

Iman Ansari
Iman Ansari il 27 Apr 2013
Hi. Try this:
function anyFunction(anyString)
length(anyString{1})
end

Più risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by