How to shift collum of matrix to the right ?
Afficher commentaires plus anciens
Dear All,
I am trying to reshape my image by shifting the collum of matrix to the right.
Coud someone help me ?
[

I want to apply this method for my image as bellow
Thanks you so much!
Han
Réponses (1)
A = eye(10)
A = circshift(A(3,:),1)
You can use circshift function to shift position of zeros in the matrix as above
3 commentaires
VBBV
le 19 Oct 2022
In the above e..g matrix, elements of 3rd row in the matrix A is shifted by 1 step, Similarly if you want to shift 2 steps use
A = circshift(A(3,:),2)
Jenifer NG
le 19 Oct 2022
Jenifer NG
le 19 Oct 2022
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!