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!

 採用された回答

Iman Ansari
Iman Ansari 2013 年 4 月 27 日

0 投票

Hi. Try this:
function anyFunction(anyString)
length(anyString{1})
end

1 件のコメント

Refael
Refael 2013 年 4 月 27 日
it's working
thank u !! :-)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Characters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by