MATLAB COMPILER RELEASE NOTES Betriebsanweisung Seite 118

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 716
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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 =
Seitenansicht 117
1 2 ... 113 114 115 116 117 118 119 120 121 122 123 ... 715 716

Kommentare zu diesen Handbüchern

Keine Kommentare