01-22-2016 02:37 AM
Hello,
I have a 1D array of a cluster of 2 elements, 1d array of integers and 1d array of double (please see attached screen-shot)
I need to get indexes 0, 2, 4, 6,8..and so on, and put them in index 1 of Array21.
So the resulting Array21_new will have indeces 0,2,4,6,8... at index 0; and indeces 1,3,5,7,9... at index 1.
This has to be inside a loop
Any clever .vi?
Thanks in advance
01-22-2016 02:41 AM - edited 01-22-2016 02:43 AM
Hi loba,
- use Decimate1DArray to get every second array element.
- use an autoindexing FOR loop to iterate over your "1D array of cluster"…
Any clever .vi?
We will not do your work for you! (Especially when it sounds like homework!)
Start by attaching your own attempt or solution. Ask for specific problems with your code.
We will comment your VIs or help you to solve (specific) problems.
That's the way a forum works!
01-22-2016 03:52 AM
Hi GerdW,
sorry if it sounded like I was trying to deliver my job to somebody else.
Please see the attached .vi and run it if possible.
My problem is that I dont understand how to use "Decimate 1d Array" block in a dynamic way, the block has no input for indexing.
NEW_cluster is the result Im looking for, in this example it goes up to 3, but it has to go up to N. How?
01-22-2016 05:19 AM
loba wrote:
My problem is that I dont understand how to use "Decimate 1d Array" block in a dynamic way, the block has no input for indexing.
The Decimate 1D Array is resizable. If you have it show 2 elements, it will seperate the array into 2 arrays. The first array will be from elements 0, 2, 4, etc while the other array will have elements 1, 3, 5, etc.
01-22-2016 05:28 AM
Yes the Decimate 1D Array is resizable, but only in edit-mode.
I need to feed an array with a non-fixed dymension, so it needs to resize depending on the dymension.
This block is perfect for what I need to do but it only account for fixed-size structures, there must be an other way...
01-22-2016 06:49 AM - edited 01-22-2016 06:52 AM
Hi loba,
the Decimate 1D Array is resizable, but only in edit-mode.
Yes, sure.
I need to feed an array with a non-fixed dymension, so it needs to resize depending on the dymension.
So what's the problem here?
DecimateArray takes any 1D array of "non-fixed length" and (when set to two outputs) gives you the "even" elements on the first output!
On your VI: Why do you decimate to three output arrays when you say you need every second array element?
01-22-2016 07:01 AM
what a smart ass
01-22-2016 07:43 AM
Things Not To Do
You asked questions on how to do something. Two very knowledgable people tell you how. You state a function that was recommended wouldn't work. A reply said it would when used properly. No need to get upset.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-22-2016 08:02 AM - edited 01-22-2016 08:03 AM
loba wrote:
I need to feed an array with a non-fixed dymension, so it needs to resize depending on the dymension.
This block is perfect for what I need to do but it only account for fixed-size structures, there must be an other way...
No it doesn't. I works on any sized 1D array. Perhaps you just need an example of how it works...
