10-07-2009 12:27 PM
Please see attached vi. My objective is to output the items in column 3. The subarray should contain a 1D array consisting of 03, 13, 23, 33, 43, 53. As usual, the help file for this vi makes absolutely no sense. For the first index, it says
"index specifies the first element, row, column, or page to include in the portion of array you want to return...."
Since I'm drawing from a 2D array, this cannot be an element, and it's not a page, so it must be a row or column .. but which? row? I don't want ANY row. Column? I want column 3, length 6, but what do I enter in the other 2 indices? Same applies to index3. I believe I need to enter "column #3, length 6" but I don't know how. I could try all permutations & combinations of these 4 parameters until I get the desired result but that involves more programming than I want to do. Am I the only one who has trouble with NI's array help files? Can someone suggest what parameters to enter to achieve the desired results? I've already tried many logical approaches without the desired result.
10-07-2009 12:34 PM
10-07-2009 12:38 PM
10-07-2009 12:38 PM
10-07-2009 12:47 PM
10-07-2009 01:41 PM
10-07-2009 01:55 PM
Well, the help says that "If you wire a 2D array to the function, the function displays the index inputs for a row and column, respectively." I interpret that to mean that the first index input is for the row and the second index input is for the column. I also interpret type to mean the same dimension(s) and not string/dbl/etc. Of course, I've been using this for a lot of years and know how it's supposed to work.
10-07-2009 01:59 PM
wb2nvy wrote:
smercurio and Dennis, thanks for the help. That's exactly what I needed to know, but was blatantly absent from the NI help file for Array Subset. It's unfortunate I have to go to this forum & trouble you people for information that should be in the help file. In the context of smercurio's input that the output array must have the same dimensions as the input array, Dennis' explanation makes sense. But the help file doesn't say that. it only says the subarray is of the same type as array, which means string, double, integer, etc. How would any LV user discern that valuable tidbit from the help file? Or that the first 2 indices are looking for ROW information and not COLUMN information? Is there more complete documentation on these things you could direct me to?
Don't hesitate to post when the help is lacking.
The array operators where hard for me to get my head around at first. I rember the local NI sales type walking into our office as I was trying to learn how to use the array functions on a 3-d array and he rolled his eyes and went running for my bosses office since he was not going to ask about arrays.
As a general rule the indexes and size input are arranged from the last dimension that was added so it would be
Building
Floor
Isle
Shelf
Book
Page
line (row)
character (collumn)
if you were working with an 8D array (which is rediculous, I admit).
Ben
10-07-2009 03:58 PM
10-07-2009 10:17 PM
What version of LabVIEW are you using?
Dennis's post is the wording I see in LV 2009. Looking at LV 8.6 I see less wording
You can use the Index Array function to determine the shape of the subarray you want to access or modify. For example, use the Index Array function to extract a 1D row from a 2D array.
That wording isn't present at all in the .pdf you posted. So I'm guessing you are at LV 8.5 or earlier (I don't have the older versions on this PC to check.)
I'm guessing that over the versions, NI as improved the documentation a bit to help clarify those things that you were having an issue with.
Ben, Dennis,
Out of curiosity, what is the largest N for an N-dimension array you've ever used whether in LV or any programming language? Would you ever have gotten to the shelf or aisle level? What would come after building? Street?