www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/NumberOfCharactersInCharacterVectorExample.m

    %% Number of Characters in Character Vector
% Create a character vector. To return the number of characters in the
% character vector, use the |strlength| function.
chr = 'The rain in Spain.'

%%
L = strlength(chr)