MATLAB COMPILER RELEASE NOTES Guia do Utilizador Página 118

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 716
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 117
R2014a
3-6
V = validatestring('',{'Cantor','','Koch'})
V =
''
In versions of MATLAB prior to R2014a, the call to validatestring results in an error.
Compatibility Considerations
Change code that relies expects an error when testing the validity of an empty string.
matlab.lang.makeValidName and
matlab.lang.makeUniqueStrings functions for constructing unique
MATLAB identifiers
The matlab.lang.makeValidName function returns valid MATLAB identifiers from input
strings. The output names are not guaranteed to be unique. For example,
S = {'Item#','Item#','Price/Unit','1st order','Contact'};
N = matlab.lang.makeValidName(S)
N =
'Item_' 'Item_' 'Price_Unit' 'x1stOrder' 'Contact'
The matlab.lang.makeUniqueStrings function returns unique strings from input strings.
For example,
S = {'coffee' 'tea' 'coffee' 'water' 'coffee'};
U = matlab.lang.makeUniqueStrings(S)
U =
'coffee' 'tea' 'coffee_1' 'water' 'coffee_2'
Use these two new functions together to ensure that output strings are valid and unique
MATLAB identifiers. For example,
S = {'Item#','Item#','Price/Unit','1st order','Contact'};
N = matlab.lang.makeValidName(S);
U = matlab.lang.makeUniqueStrings(N,{},namelengthmax)
U =
Vista de página 117
1 2 ... 113 114 115 116 117 118 119 120 121 122 123 ... 715 716

Comentários a estes Manuais

Sem comentários