From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-10-2015 05:29 AM
Hi there,
I have an sorted array, in which some elements have increasing values, I want to find gaps between values in that array and I want to create new sub array according to gaps between values.
For example I have this array:
[104,105,106,107,108,154,155,156,157,175,176,180,191,192,193]
Which I want to have is those arrays:
[104,105,106,107,108]
[154,155,156,157]
[175,176]
[180]
[191,192,193]
is there any way to do that?
Thanks.
04-10-2015 05:45 AM
Hi kahlenberg,
is there any way to do that?
Yes, there is.
04-10-2015 05:50 AM
Thanks for quick reply. Yes, my first intention was also so, but I wonder If there is a labview function doing this. It seems there is not 🙂
04-10-2015 06:07 AM - edited 04-10-2015 06:07 AM
Hi kahlenberg,
I wonder If there is a labview function doing this. It seems there is not
There is a full palette of array functions. There are comparison functions. There are math functions.
So there are a lot of LabVIEW functions allowing you to do what you want to do!
You know this process is called PROGRAMMING!?
To give a hint:
(This is made with LV2009, with more recent versions you can use conditional tunnels…)
04-10-2015 07:33 AM
Hi GerdW,
...You know this process is called PROGRAMMING!?
Why is there Search1DArray function then, if it can be also programmed by programmer?
I know what Programming is, thanks for teaching me.
I just would like to know whether there is such a function like Search1Darray or not.
If yes, I don't want to invent the wheel again. If not, I can do it myself.
BTW, Thanks for code.
Regards.
kahlenberg.
04-10-2015 07:38 AM
Hi kahlenberg,
you were asking for a function, that should search for some "gaps" and split your array into smaller array parts. No, such a function does NOT exist.
But you can use several other functions to reach your goal. That was what I was teaching you…
And yes, you can even use Search1DArray for your task…