How to shift a matrix
Mostrar comentarios más antiguos
Say I have a matrix that is 3x3:
1 2 3
4 5 6
7 8 9
I want to shift the top and bottom rows:
1 2 3
4 5 6
7 8 9
This would expand it into a 3x4 matrix yes but i mostly want to know how specifically to do this shifting. I was told the imwarp function could help but im not sure. I'm thinking I would have to define a matrix for the first one to shift to? Or something like that?
4 comentarios
the cyclist
el 11 de Oct. de 2019
Do you mean a numeric array, or a cell array?
If a numeric array, what do you want in the "empty" spaces (which cannot be empty in a numeric array). Zero? NaN?
Aldo Hernandez
el 11 de Oct. de 2019
Adam
el 11 de Oct. de 2019
They way you have drawn your shifting suggests more than a 3x4 output as your shifted numbers fall in the gaps between the row below/above, which would require a larger matrix to include. Or are the 1, 5 and 7 supposed to all line up in the 2nd column?
Aldo Hernandez
el 11 de Oct. de 2019
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!