12-30-2014 01:10 AM
I have a set of data with 58 columns and 5000 rows. However, I need to find offset for all the elements in this 5000x58 set of data. Is there an easier way to put all the data (offset) into an array in one shot other than using build array function? This is because if I use the build array function, I will need to separate all the data into 58 columns by indexing them. This is too time consuming.
Thanks for the suggestion! Have a good day! 🙂
12-30-2014 03:00 AM
How are you planning to find the offset? Do you have any reference value? It would be good if you can post the code that you have developed (In 2011 version please).
12-30-2014 06:24 AM
@VanessaWen wrote:
This is because if I use the build array function, I will need to separate all the data into 58 columns by indexing them. This is too time consuming.
Why not just use an autoindexing FOR loop?
But the heart of your problem is what is the mathematical definition of offset? Once we have that, then we can get somewhere.
12-30-2014 02:23 PM - edited 12-30-2014 02:23 PM
@VanessaWen wrote:
I have a set of data with 58 columns and 5000 rows. However, I need to find offset for all the elements in this 5000x58 set of data. Is there an easier way to put all the data (offset) into an array in one shot other than using build array function? This is because if I use the build array function, I will need to separate all the data into 58 columns by indexing them. This is too time consuming.
You need to explain in much more detail, because your problem is not clear.
Is this a 2D array with 58 columns and 5000 rows?
What is your definition of "offset"?
Where does the offset value come from?
Is "offset" it the same for each row (or column) or does it depend on the data?
What is the definition of "one shot"?
Why would you need to seperate all the data into columns in order to use build array?
It it "too time consuming" to write the program or is the execution slower than expected?
Is the final output a 1D or 2D array or something else?
Please attach a VI containing a small 2D array diagram constant with typical data, then show us what kind of output you would expect after applying the described operation.
12-30-2014 11:13 PM
If the formula is the same to compute the offset across your 5000x58 matrix, then why not use simple numeric functions to do it in "one shot"?
01-01-2015 08:25 AM
Hi Altenbach,
The data is obtained through DAQ and it consists of 58 columns and 5000 rows. Each column represents one type of data. For eg, column 1 is current, column 2 is voltage.
For type of data, there will be a desired value input by the user. The offset will be obtained by subtracting the data obtained through DAQ from the desired value.
My idea is to extract the data element by element from each column. When the last element of each column is reached, the program will extract the data from the next column.
However, I am not sure exactly how to implement this idea.
Hopefully this explaination is detailed enough. So sorry for not being able to elaborate in detailed in the first post.
VanessaWen
01-01-2015 08:37 AM
01-01-2015 11:45 AM
@VanessaWen wrote:
For type of data, there will be a desired value input by the user. The offset will be obtained by subtracting the data obtained through DAQ from the desired value.
See my confusion? Initially you said you "need to find" the offset, now you are saying that the user enters the offset. Does this mean you have a 1D array of 58 offsets, one for each column? How is the user supposed to enter all those?
In any case, once you have that array of offsets, place a single subtract node inside a FOR loop. Now transpose the 2D array and autoindex both arrays (2D transposed data and 1D offsets) on the left loop boundary, subtract the scalar offset from each colum, autoindex again at the right boundary and transpose again to generate the adjusted 2D array.
01-04-2015 10:43 PM
Hi Dennis,
That's what I am doing now: Index all columns at once and do the subtraction at once. However, I feel that it is not efficient.
The desired values are input by the user, it's just a numeric control.
VanessaWen
01-04-2015 10:49 PM