NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Knight of NI
altenbach
Posts: 23,145

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

[ Edited ]
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


LabVIEW Champion . Do more with less code and in less time .

Member
madgreek
Posts: 183
0 Kudos

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

Thanks

its good to know these basic rules

Member
madgreek
Posts: 183
0 Kudos

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

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 :smileyhappy:
Knight of NI
altenbach
Posts: 23,145

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



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).


LabVIEW Champion . Do more with less code and in less time .

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page