ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array subset using condition

I have a 2D array which i want to split into 2 subset using a condition. Say i have

X              y

125         1.5
585         1.1
798         1.0
1054        0.75
3586        1.12

i need to split the array to two subsets with thos eof below 1000 and above 1000.

help please...

0 Kudos
Message 1 of 15
(6,333 Views)

What have you tried so far?  Attach your work.  This sounds like homework. 

 

This is a relatively easy problem.  We can point you in the right direction but don't expect us to do your homework for you.  Take a look at for loops and tunnel indexing

0 Kudos
Message 2 of 15
(6,323 Views)

no it is not.

it is a part of a whole analysis program im making.

You see i have summary of frequency peaks  which changes every signal i input. i need a subset array for those peaks recognized as below 1000 and above 1000.

 

2.JPG

 

 

0 Kudos
Message 3 of 15
(6,314 Views)

Hi camr,

 

so you should change that fixed "index" input to some variable value - using a search function would be a good idea…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(6,300 Views)

@GerdW wrote:

Hi camr,

 

so you should change that fixed "index" input to some variable value - using a search function would be a good idea…


can you suggest a search function?

i tried using search 1D function but it wont work as my array values never coincide with 1000. its index location also varies.

 

0 Kudos
Message 5 of 15
(6,279 Views)

Threshold 1D Array will do what you want…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 15
(6,273 Views)

threshold array wont work as I have a 2D aray. I have tried that as well and doesnt work.

0 Kudos
Message 7 of 15
(6,268 Views)

But it will work on your 1D X value column…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 15
(6,264 Views)

@GerdW wrote:

But it will work on your 1D X value column…


yes it will work but the value is wrong... thus it wont give me my desired output

4.JPG

0 Kudos
Message 9 of 15
(6,251 Views)

@GerdW wrote:

But it will work on your 1D X value column…


yes it will work but the value is wrong... thus it wont give me my desired output

4.JPG

0 Kudos
Message 10 of 15
(6,250 Views)