How to shift elements in a row matrix?
Afficher commentaires plus anciens
Suppose i have a vector x=[1 1 1 1 0 0 1 1] i want 1 bit shifting such that the output is x1=[0 1 1 1 1 0 0 1] x2=[0 0 1 1 1 1 0 0]
How to do this??
Réponse acceptée
Plus de réponses (1)
Matt J
le 20 Oct 2017
x1=zeros(size(x));
x1(2:end)=x(1:end-1)
4 commentaires
Darsana P M
le 20 Oct 2017
Matt J
le 20 Oct 2017
Why not?
Darsana P M
le 21 Oct 2017
Anu
le 25 Août 2018
i want this code to execute for every iterations.I need to run it for 64 times and i need to display from 1to 64.how could i do this?
Catégories
En savoir plus sur Array and Matrix Mathematics 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!