MATLAB BUILDER JA 2 Guide de l'utilisateur Page 119

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 292
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 118
Using Class Methods
Example Testing for an Empty MWArray
Display a message if array object A is an empty array. Otherwise, display
the contents of
A:
if (A.isEmpty())
System.out.println("Matrix A is empty");
else
System.out.println("A = " + A.toString());
When run, the example displays the contents of A:
A=123456
7 8 9101112
13 14 15 16 17 18
numberOfDimensions. This method returns the number of dimensions of
the array object.
The prototype for the
numberOfDimensions method is as follows:
public int numberOfDimensions()
Input Parameters
None
Example Getting the Number of Dimensions of an MWArray
Display the number o f dimensions for array object A:
System.out.println("Matrix A has " + A.numberOfDimensions() +
" dimensions");
When run, the example displays this output:
Matrix A has 2 dimensions
numberOfElem ents. This method returns the total number o f elements in
the array object.
4-43
Vue de la page 118
1 2 ... 114 115 116 117 118 119 120 121 122 123 124 ... 291 292

Commentaires sur ces manuels

Pas de commentaire