11-13-2017 12:03 PM
So, simply reshape to 16 columns and take the 12 column subset.
11-13-2017 12:29 PM
Ive tried that and I keep getting an output nowhere near what it should look like.
11-13-2017 01:57 PM
I don't think your "should be" output is correct. If you are triplicating 8 elements, then the first few elements starting with 0 or 16 are identical, so your rows should start pairwise identical.
As a first step, change the code to numeric and give each element a unique number. Now you can see where things go wrong and what ends up where.
Here's a quick example that seems to do what you describe. Modify as needed. Once things fall into place, go back to boolean arrays.
11-14-2017 06:40 PM
Okay thanks alten! Ill work on that. Im sure I can figure it out from that!
11-15-2017 12:42 PM
After working on it I realized that it does not repeat the initial input 3 times over.. my mistake. But some progress has been made!
I have a VI that is very very close to what I need as an output but im missing one crucial step in generating the array. I know insert into array should not be used but im trying to insert two deleted selections of the 24 bits per row array together then interweave this with the first 12 bits of the 24 bits per row array to generate the "desired output".
For some reason im missing 5 rows of the the initial input/desired output from my resulting array! This is where my problem lies why are they missing?
Thanks again for any help.
11-15-2017 01:04 PM
@RichardTalbot wrote:
I know insert into array should not be used but im trying to insert two deleted selections of the 24 bits per row array together then interweave this with the first 12 bits of the 24 bits per row array to generate the "desired output".
You need to be more specific. It does not help if you attach convoluted code that gives the wrong answer. Best would be if you would try it on the numeric array first as in my earlier example. Generate an appropriate input and tell us how the output should look like there.
11-15-2017 03:14 PM
@RichardTalbot wrote:
After working on it I realized that it does not repeat the initial input 3 times over.. my mistake. But some progress has been made!
I have a VI that is very very close to what I need as an output but im missing one crucial step in generating the array. I know insert into array should not be used but im trying to insert two deleted selections of the 24 bits per row array together then interweave this with the first 12 bits of the 24 bits per row array to generate the "desired output".
For some reason im missing 5 rows of the the initial input/desired output from my resulting array! This is where my problem lies why are they missing?
Thanks again for any help.
Here is a little less convoluted way to get your desired output (at least for the first 10 rows). It also will scale for larger data sets. I'm sure there is a better way to do it. I just can't think right now how to build a better mousetrap.
I too have NO IDEA where the last 5 rows of data come from. The "initial Input" has 120 elements (15x8 array). If you reformat to 12 columns, you only get 10 rows (10x12 array has 120 elements). There is no more data to process unless you reuse/repeat some of the old data.
11-15-2017 10:26 PM
I got it! Thanks guys
11-16-2017 08:44 AM
@jamiva wrote:
Here is a little less convoluted way to get your desired output (at least for the first 10 rows). It also will scale for larger data sets. I'm sure there is a better way to do it. I just can't think right now how to build a better mousetrap.
The main problem is that you constantly resize the array in the shift register for no good reason at all. This can be hard on the memory manager. If this is really the solution (and the number of rows is divisible by three), all we need is the following.
We can operate on the original array e.g. as follows, but yes, there are probably still better solutions. 😄
11-16-2017 01:26 PM - edited 11-16-2017 01:32 PM
Also, while I hope that the compiler can make my above code operate in place with a single output allocation, I am not 100% sure, given the splitting, appending, and the concatenating tunnel.
To be sure that things are done efficiently, we can do the allocation of the output more explicitly. In this case it could look as follows.