09-17-2009 12:28 PM
09-17-2009 12:45 PM
09-17-2009 12:48 PM
You would first need to define what you mean by transposing a 3D array, as it depends on what you're swapping. Also, there's no need to use the matrix datatype - stick with arrays. Have you tried a search? This has come up before:
http://forums.ni.com/ni/board/message?board.id=170&message.id=218890
http://forums.ni.com/ni/board/message?board.id=170&message.id=63107
09-17-2009 12:50 PM
Darin.K wrote:
First you need to better define your transpose operation. In 3D it is not well-defined (as far as I know). Second, only 2D arrays can be converted to matrices. Finally, do you need to "transpose" your array and pass it to another VI or are you doing the manipulation yourself. I ask this because in C I would simply change the pointer math and leave the array alone. In LV this would mean leaving the array alone but changing how you index it depending on whether you were dealing with the matrix or its transpose.
Yeah, question marks were going through my head about 3D transposing because I can think of two different ways it can be "flipped on its side." Convertible matressess sounds like a futon. LOL glad to see someone uses the "proper" plural of "matrix." Now let's see you use "indices" somewhere in your next post! Kudos. 🙂
09-17-2009 12:57 PM
09-17-2009 01:45 PM
if you transpose in 2D you swap rows for columns.
Basically you change the order in which the arrays are indexed if you would use stacked FOR loops.
If we retain the analogy for 3D arrays, there are several swaps possible.
Starting with x,y,z, we get several possibilities:
x,z,y
y,x,z
y,z,x
z,y,x
z,x,y
Any of the five can be done very efficiently. Are all dimensions the same?