LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do we have to transpose a 2-d array to index it more efficiently?

Solved!
Go to solution
I have a 2d string array that is 8 columns wide and 100k rows. In order to index it, I have to transpose it. Why?
0 Kudos
Message 1 of 17
(3,574 Views)

It depends on what method of indexing you want to use to access your data. Are you using autoindexing for loops? If so, those will index rows and if you want column data that is the reason for the transpose being needed. If you want to just use index array you can explicitly state which column you want.

Message 2 of 17
(3,563 Views)

Why would one way (non-transposing) make me run out of memory, while the other would not?  Basically all I wanted to do was chop off the top 23 rows of the array.

0 Kudos
Message 3 of 17
(3,550 Views)

 


@dt1804 wrote:

Why would one way (non-transposing) make me run out of memory, while the other would not?  Basically all I wanted to do was chop off the top 23 rows of the array.


 

You can remove the top 23 rows without indexing the array.

It sounds to me like somewhere along the way you are making extra copies of the array,

which would explain why you are running out of memory.

 

You should just use the "array subset" function with the offset for rows wired to 22.

Cory K
0 Kudos
Message 4 of 17
(3,546 Views)

@dt1804 wrote:

Why would one way (non-transposing) make me run out of memory, while the other would not?  Basically all I wanted to do was chop off the top 23 rows of the array.


You left that fairly substantial and important bit of information out of your post Smiley Wink. Cory's solution is your best bet for this type of operation. Although, I'm surprised your code is causing memory issues with an array that size, even if you are using the inefficient delete from array within a loop. If you post your code some more suggestions can be offered.

0 Kudos
Message 5 of 17
(3,539 Views)

I am sorry, that's is exactly what I have tried, but if I don't transpose the array first I get the "not enough memory" error.

0 Kudos
Message 6 of 17
(3,537 Views)

 


@dt1804 wrote:

I am sorry, that's is exactly what I have tried, but if I don't transpose the array first I get the "not enough memory" error.


If it wouldn't be a problem for you, would you mind posting your code so we can see  exactly what you are trying?

 

Cory K
0 Kudos
Message 7 of 17
(3,533 Views)

Again, please post the code.

0 Kudos
Message 8 of 17
(3,532 Views)

Here is the code.   The files it asks for can be any long rowed files.

 

thanks

0 Kudos
Message 9 of 17
(3,519 Views)

Blah, I don't have 2010 installed yet. 3 Options, 

 

1. post a screenshot

2. wait for someone to come along with 2010 (which will be pretty soon I'm sure), or

3. save it back to 2009 and I'll take a look at it.

 

 

0 Kudos
Message 10 of 17
(3,511 Views)