As the title says, Im trying to transpose an arbitrary matrix made from a 1d array. I can't even figure out how to start on this. I know that I need to use for loops. Is this even possible?
As the title says, Im trying to transpose an arbitrary matrix made from a 1d array. I can't even figure out how to start on this. I know that I need to use for loops. Is this even possible?
Of course!
You might want to start with declaring an array, eh?
For loops are very appropriate. Show some spunk and give it a shot, and upload your code when you get stuck. We can't help people to learn if they won't try. Programming requires study and practice.
I didn't know transposes have any effect on arrays of ranks less than 2. In other words, it must be at least 2-dimensional or greater. I'm talking about row/column/plane etc. transposes.
I figured out how to do it. Its just something like this:
for loop for row
for loop for col
New position of array is row + (col*3)
It may help someone
Probably more like row * WIDTH + col.