08-15-2012 10:25 AM
Hello, everyone
My TXT file is 8x2000 values
I want to find out the maximum in the first row
The second row..until the eight row
In each row and find the maximum value
First,I use "read from spreadsheet" this vi to read the txt file
However, this vi only have "all rows" and "the first row"
Please enlighten me greatly .3 Q-~~
08-15-2012 10:30 AM
Are trying to get the maximum out of the rows or out of the colums? There are 8 colums in your data file, so I'm thinking you really meant colums.
Once you have the 2D array, use the Array Index to get the colum you want and then the Array Max & Min to get the maximum value and/or index.
If you are trying to do this on all of the colums, transpose the array and then use a for loop with autoindexing.
08-15-2012 10:36 AM
You've started correctly with the Read From Spreadsheet File. You can then take the 2D output and wire it to a for loop. It will autoindex row by row.
p.s. It looks like your text file is really 2000 rows and 8 columns. You can configure the read to transpose if you really want 8 rows with 2000 columns.
08-15-2012 10:41 AM
yes , i mean trying to get the maximum out of the colums. sorry~
so i need use "read from spreadsheet.vi" at first to read my txt file ?
and then use "Array Index.vi" at second to find the colum i want
Third, use Array Max & Min.vi
thank you~
08-15-2012 11:11 AM
Not at all sure why you want to use the Index Array function.
08-15-2012 11:15 AM
To add to Dennis's comment, if you are looking for the max in all of the colums, use a for loop with the autoindexing. You will need to transpose the 2D array, but that is still better.