MATLAB BUILDER JA 2 Guida Utente Pagina 186

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 292
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 185
4 Using MWArra y Classes
To construct a MWCharArray object w ith the specified dimensions, use
public static MWCharArray newInstance(int[] dims)
The elements of the array are all initialized to zero.
To construct a
MWCharArray object with the specified dimensions and
initialized with the supplied data, use
public static MWCharArray newInstance(int[] dims,
Object data)
Input Parameters
dims
Array of dimension sizes. Each dimens ion size must be nonnegative.
data
Data to initialize the array
Example Constructing a Character Array Object with newInstance
Create an MWCharArray object containing the text Hello:
int[] dims = {1, 5};
char[] chArray = {'H', 'e', 'l', 'l', 'o'};
String str = new String(chArray);
MWCharArray A =
MWCharArray.newInstance(dims, str);
System.out.println("The array string is \"" + A + "\"");
When run, the example displays this output:
The array string is "Hello"
dispose. MWCharArray inherits this method from the MWArray class.
4-110
Vedere la pagina 185
1 2 ... 181 182 183 184 185 186 187 188 189 190 191 ... 291 292

Commenti su questo manuale

Nessun commento