How to shift elements in a row matrix?
이전 댓글 표시
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??
채택된 답변
추가 답변 (1개)
Matt J
2017년 10월 20일
x1=zeros(size(x));
x1(2:end)=x(1:end-1)
댓글 수: 4
Darsana P M
2017년 10월 20일
Matt J
2017년 10월 20일
Why not?
Darsana P M
2017년 10월 21일
Anu
2018년 8월 25일
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?
카테고리
도움말 센터 및 File Exchange에서 Array and Matrix Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!