04-22-2019 10:16 PM - edited 04-22-2019 10:29 PM
For a given 2D array with different values, i'm trying to get the range for which the values are continuous. However I'm just get the end values for the logic I have developed.For Example: if the input array is
Then the output string array must be
Solved! Go to Solution.
04-22-2019 11:04 PM
So your stuck. You want your VI to behave a certain way, and it is not doing that.
Do you want us to just guess at what is going wrong?
If you want real help, then you should attach your VI so we can see what is wrong with it.
04-23-2019 01:18 AM - edited 04-23-2019 01:20 AM
Hi guy,
and while you attach your VI you also should explain the "logic" behind your desired algorithm!
get the range for which the values are continuous.
- do you search for "continuously declining" numbers? Can there be "continuously rising" ranges? What about "continuously the same" ranges?
- do such "ranges" also span more than one row?
- are these integers, floats, or strings?
04-23-2019 05:40 AM
04-23-2019 05:52 AM
04-23-2019 03:08 PM
Please resave your VI, but first put some values in the controls and save them as default. Empty controls doesn't provide us any meaningful data to test you VI.
I do see a Rube Goldberg in there where you auto-index on an array, but proceed to use Index Array with the i terminal on a branch of that array to access the elements. When you auto-index, it gives you each element one by one. No need for the wire branch Index Array and i node.
04-23-2019 03:20 PM
@curiousguy99 wrote:
For a given 2D array with different values, i'm trying to get the range for which the values are continuous. However I'm just get the end values for the logic I have developed.
Nothing in computing is "continuous". Your array values are quantized to the limitations of I32 and their position is quantized to integer index positions. It is not obvious how your 2D array of strings related to the input array at all. Please write a full paragraph explaining what algorithm you actually want.
(And yes, fill the control with typical default data before saving and attaching. We don't want to enter values into an empty array first.)
04-23-2019 06:19 PM - edited 04-24-2019 04:03 PM
So it seem you want to isolate ranges where the value decrements by one. Here's a very quick draft to get you started.
(For large inputs, I would only keep the max and min in the shift register, so modify if this is needed)
EDIT: slightly improved code can be found a few posts below.
04-23-2019 10:24 PM
Thanks a lot for your response!!
I noticed how over complicated my code was 😞 . This was a part of code where the each bit ( from 0-31 ) were assigned a bit definition name. I had to get get the position of the bits for the selected bit definition and populate the number of bits accordingly.The 2D array was the bit definition- occurrences array for which I had to calculate the position of the bits. Moreover something like this
04-23-2019 10:28 PM
I need to get back and start working on the basics to build more efficient and simple code like you did here. Thanks a lot for putting your time and effort on this post 🙂