10-04-2017 09:35 AM
hello,
i have a matrix and i need to get lines of this matrix...
Any help please !
10-04-2017 09:58 AM
Hey Monty,
Can you be more specific on what you need from the matrix? Is it stored in a TS container or is it from your code module?
A screen shot of what you are trying to get would probably help, too
Thanks!
10-04-2017 09:58 AM
Can you give us some more information? I thought TestStand treats matrices as 2D arrays?
10-04-2017 10:08 AM
thanks for yours responses,
i have a 2D Table "A" and another one but 1D "B" : A[][] and B[].
i need to get lines of A, and stock them on B...
Finally i get a solution : B[] = A[0..][i]
You agree ?
10-04-2017 01:55 PM
The best way to do this is to use a for loop to go through each element of the array and cast the value at A[i][j] to B[i]. The question is do you want to do with with TestStand expressions, or make a code module.
I would suggest making a code module as it would be more straight forward, especially if you are using LabVIEW. With LabVIEW, simply use the index array function and pass your 2D array in as a control, and your 1D as an indicator to populate a array variable in TestStand.
The expression in TestStand would be similar, but more manual. You would need to create a for loop to step though each index, the write an expression to take the element and place it into an index in B. Something like:
for (int i = 0-->x)Locals.B[i] = Locals.A[i][0]
Again, I would recommend just making a code module to do this instead
Hope that helps!