cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar

Matrix Utility Functions

Started ‎11-08-2022 by
Modified ‎11-08-2022 by
View Fullscreen Exit Fullscreen

A useful utility function for matrices is the Loc function. This function takes a Boolean matrix as its argument, and returns a matrix with the locations, or positions, of all of the true elements in the matrix. Now, remember that JMP interprets zero as false and non-zero values as true. So if the argument supplied is simply a matrix, or a variable storing a matrix, the Loc function returns a matrix of the locations of all of the nonzero elements. But you can also specify a Boolean comparison, like m greater than In this case, the Loc function takes the result of the comparison function as its argument. The comparison returns a Boolean matrix of ones where the comparison is true, and zeroes where the comparison is false, and then the Loc function returns a matrix of the location of the ones -- the non-zero values. And, if you want the actual values, rather than the locations, you can subscript the matrix with the Loc function. Finally, you can get the extreme values--that is, the minimum or maximum--of a matrix using the Min or Max functions. Or, you can get the location of the first occurrence of the minimum or maximum value using either the Loc Min or Loc Max function.