LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get rid of the zeroes after sub-division of arrays?

OK, back to the original problem.
 
You have several options.
  1. Ben's cluster is probably the simplest, at the expense of more complex data structures. I would go with that, especially if the sizes are vastly different. For simplicity, you can also use a simple bundling operation (see image)
  2. You could add another column containing the valid data size for each row (not shown).
  3. You could substutute NaN for all invalid elements. (see example image, lower output)
  4. You could just go with the 2D array, then use the "sizes array" you already have whenever you process the 2D array again to use the valid subset (not shown).

Here are some more issues.

  1. All the indexing values should be I32, the native data for size and index terminals and sizes. Using DBL is silly and wasteful and can potentially lead to rounding issues.
  2. You seem to have a problem because the sum of all subset sizes (49664) is larger that the input array size (49608). At one point you'll run out of data.
 

Message Edited by altenbach on 04-11-2007 08:51 PM

Message 11 of 14
(842 Views)

Thanks

its good to know these basic rules

0 Kudos
Message 12 of 14
(839 Views)
I didnt see your last post untill too late.
 
To change the indexing i need to use the conversion vis right?
 
I think the difference in the number of samples comes from the fact that in my code at some point i used a reshape array to increase the very last array to the same size as the rest, basically adding 56 more zeroes to it. I think that must be it. I remember some time ago when you responded back to one of my posts, you mentioned that reshape arry vi, and you told me to get rid of it. I should knew then Smiley Happy
0 Kudos
Message 13 of 14
(837 Views)


@madgreek wrote:
To change the indexing i need to use the conversion vis right?

There is nothing to convert. Just right-click on the diagram constants and select "Representation...I32".

You always want blue wires for true integer operation. (For example an array of size 20.4 can never exists).

Message 14 of 14
(807 Views)