Perform Operation on only even rows.

How would I go about performing an operation only on the even rows. For example, you have matrix A and you want to cirshift only the even rows. Thanks

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 29 日

0 投票

A=randi(9,10,4)
idx=2:2:size(A,1);
Ae=A(idx,:)
Ae1=circshift(Ae,[0 -2])
A(idx,:)=Ae1

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

タグ

質問済み:

2015 年 7 月 29 日

回答済み:

2015 年 7 月 29 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by