MATLAB COMPILER RELEASE NOTES Guía de usuario Pagina 118

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 716
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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 pagina 117
1 2 ... 113 114 115 116 117 118 119 120 121 122 123 ... 715 716

Comentarios a estos manuales

Sin comentarios