MATLAB BUILDER JA 2 Guide de l'utilisateur Page 127

  • 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 126
Using Class Methods
When run, the example displays this output:
Clone of matrix A is:
123456
7 8 9101112
13 14 15 16 17 18
compareTo. This method compares the MWArray object with the i nput object.
It returns a negative integer, ze ro,orapositiveintegerifthe
MWArray object is
less than, equal to, or greater than the specified object, respectively.
The prototype for the
compareTo method is as follow s:
public int compareTo(Object obj)
See the compareTo method in interface java.lang.Comparable for a full
description of the return value.
Input Parameters
obj
Array to compare this MWArray object to
Example Comparing MWArrays with compareTo
Create a shared copy of the MWArray object and then compare it to the original
object. A return value of zero i ndicates that the two objects a re equal:
Object S = A.sharedCopy();
if (A.compareTo(S) == 0)
System.out.println("Matrix S is equal to matrix A");
When run, the example displays this output:
Matrix S is equal to matrix A
4-51
Vue de la page 126
1 2 ... 122 123 124 125 126 127 128 129 130 131 132 ... 291 292

Commentaires sur ces manuels

Pas de commentaire