Subscribe Bookmark RSS Feed

Loc values within a range in a matrix

aallman

Contributor

Joined:

Feb 28, 2017

Is there a way to search a matrix for values within a certain range? 

For example if my matrix is [1, 2, 5, 7, 8] is there a way I can look for values that are 4<x<6 (returning 5 or position 3)

2 REPLIES
uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

a = [1, 2, 5, 7, 8];
b = Loc(a>2 & a <8);

Try this 

Best
Uday
txnelson

Super User

Joined:

Jun 22, 2012

Documentation on all of the Matrix operators is located in either

     Help==>Books==>Scripting Guide==>Matrices

or

     Help==>Scripting Index==>Loc

 

If you are going to be using matrix manipulation in JMP, I strongly suggest you read the Matricies section in the Scripting Guide

Jim