Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

05-07-2009 07:54 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello everyone!!!

I have a problem: I have a huge 1D array and I need to split it in to sets of 8 elements as need to compare these 8 elements with another 1 D array of size 8. is this possible?

Thanks for the help!!

Solved! Go to Solution.

Highlighted
Options

05-07-2009 08:07 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Try the Decimate 1 D array. Read the help to see if it does what you want.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************

************ kudos always appreciated, but only when deserved **************************

Highlighted
Options
use the split 1-D array function in the functions palette

05-07-2009 08:13 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Harold Timmis

htimmis@fit.edu

Orlando,Fl

*Kudos always welcome:)

htimmis@fit.edu

Orlando,Fl

*Kudos always welcome:)

Highlighted
Options
Hello again.. But the size of my 1D array can be unknown and I wouldn't know how many sets of 8 I would have 2 divide it in to. What will I pass in to the index input of the split 1D array function?

05-07-2009 08:43 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Highlighted
Options

Is the input array guaranteed to have a length that is a multiple of 8? If it's not, what are you supposed to do?

smercurio_fc

Knight of NI

05-07-2009 09:00 PM - edited 05-07-2009 09:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Two straightforward ways (among others):

- Run a for-loop based (size of your array)/8 and then inside the loop use Array Subset to get each chunk of 8 elements. The comparison is done inside the loop.
- Use Reshape Array to reshape your 1D array into a 2D array that has 8 columns. The number of rows would be (size of your array)/8. Then auto-index a for-loop to pull off each row. The comparison is done inside the loop.

Is the input array guaranteed to have a length that is a multiple of 8? If it's not, what are you supposed to do?

Message Edited by smercurio_fc on 05-07-2009 09:01 PM

Highlighted
Options

05-07-2009 09:19 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

use a for-loop

Harold Timmis

htimmis@fit.edu

Orlando,Fl

*Kudos always welcome:)

htimmis@fit.edu

Orlando,Fl

*Kudos always welcome:)

Highlighted
Options

05-07-2009 09:51 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Yes the input array is a multiple of 8. thanks for the suggestions. ill give it a go:)

Highlighted
Options

05-07-2009 10:59 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Still think decimating would be easier, but that's JMHO.

Here's why: (Assume N pts)

Decimate (add outputs until you have 8 outputs total).

Now, the outputs will be 8 size N/8 arrays.

Next, concatenate them back together. Now you have a 2-D (8 x N/8) array.

Transpose it if you need it the other way around, and you're done.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************

************ kudos always appreciated, but only when deserved **************************

Highlighted
Options
True, but using Reshape Array allows you to do the same thing without having to hard-code the dimensions (i.e., the size of the Decimate and Build Array functions). The inputs to Reshape Array can be calculated using Array Size and the Quotient & Remainder function. More scalable.

smercurio_fc

Knight of NI

05-08-2009 09:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Highlighted
Options

05-10-2009 05:37 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello smercurio,

I am usind the Array subset to split my huge 1D array in to chunks of 8. But I am unsure as to what to pass in to the index input of the Array subset function. When I put it in a for loop, the index continuously changes. So what do I input?

Thanks!!