who to replace a row in matrix ?

how to replace a row of matrix with the vector extract from another matrix for example
A = [ 1 0 1 1 0 1
1 0 1 0 1 1
1 1 1 0 1 0 ]
B = [ 0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0 ]
and i want a function to move row from A to B but in the same position of row for example
  • i want to move the first row in A and the function must Put it in First row in B

1 件のコメント

John D'Errico
John D'Errico 2016 年 4 月 3 日
Please stop asking the same question repeatedly.

サインインしてコメントする。

回答 (1 件)

li yan
li yan 2016 年 4 月 3 日

3 投票

you just need to do like this
B(1,:) = A(1,:);

カテゴリ

ヘルプ センター および File ExchangeShifting and Sorting Matrices についてさらに検索

質問済み:

2016 年 4 月 3 日

回答済み:

2016 年 4 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by