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!