Functions | |
endif | if (ischar(s)) s_was_char |
endif | if (iscellstr(s)) for i |
endfor else | error ("strtrunc: s must be a character string or a cell array of strings") |
endif | if (s_was_char) s |
endif endfunction!error < Invalid call to strtrunc > | strtrunc () |
!error< s must be a character string or a cell array of strings > | strtrunc (1, 1)%!assert(strtrunc("abcdefg" |
!assert (strtrunc("abcdefg", 10),"abcdefg") | |
!assert (strtrunc({"abcdef","fedcba"}, 3),{"abc","fed"}) | |
Variables | |
function | s |
else | s_was_char = false |
!error< s must be a character string or a cell array of strings > | abcd |
!assert | ( | strtrunc({"abcdef","fedcba"}, 3) | ) |
!assert | ( | strtrunc("abcdefg", 10) | , | |
"abcdefg" | ||||
) |
endif if | ( | s_was_char | ) |
endif if | ( | iscellstr(s) | ) |
endif if | ( | ischar(s) | ) |
endif endfunction !error<Invalid call to strtrunc> strtrunc | ( | ) |
else s_was_char = false |