MATLAB COMPILER RELEASE NOTES Guide de l'utilisateur Page 118

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 716
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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 =
Vue de la page 117
1 2 ... 113 114 115 116 117 118 119 120 121 122 123 ... 715 716

Commentaires sur ces manuels

Pas de commentaire