フィルターのクリア

how to change the columns of matrix using row index

1 回表示 (過去 30 日間)
nadia nadi
nadia nadi 2015 年 7 月 27 日
コメント済み: nadia nadi 2015 年 9 月 13 日
dear all,
I have this matrix
a=[1 0 0 0 1 0; 0 0 1 0 0 1;1 0 1 0 0 0;0 0 1 0 0 1;1 1 0 0 0 0;1 0 0 0 0 0;0 0 0 1 0 0];
I chose first row and wrote it as [ 1 1 0 0 0] and I want to rearrange the matrix depends on I, I used the index
a=[1 0 0 0 1 0; 0 0 1 0 0 1;1 0 1 0 0 0;0 0 1 0 0 1;1 1 0 0 0 0;1 0 0 0 0 0;0 0 0 1 0 0];
row=a(1,:);
s=find(row==1);
row1=[0 0 0 1 1 0];
s1=find(row1==1)
s2=find(row1==0)
%a=a(:,row1);give error
to here I don't now how to use the index of row1 to change a, can anyone help me please.
regards

採用された回答

Walter Roberson
Walter Roberson 2015 年 7 月 27 日
  1 件のコメント
nadia nadi
nadia nadi 2015 年 9 月 13 日
Dear Walter,
sorry for late to accept your answer. Thanks.
Nadia

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by