MATLAB BUILDER JA 2 Guía de usuario Pagina 127

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 292
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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
Vista de pagina 126
1 2 ... 122 123 124 125 126 127 128 129 130 131 132 ... 291 292

Comentarios a estos manuales

Sin comentarios