Hi , i have a matrix and need to extract the column in this way , thank you

clear all
clc
A=[ 1:16;17:32;33:48;49:64] ;
% i need to exctract the [ 1 5 9 13 ] column vectro from matrix A and put them in another matrix B with diminsion 4x4
% the rest of the column i need them in another matrix C with dimensione 4x12
% thank you

 採用された回答

madhan ravi
madhan ravi 2019 年 5 月 19 日
idx= [ 1 5 9 13 ];
A(:,idx) % 4 X 4
A(:,setdiff(1:size(A,2),idx)) % 4 X 12

1 件のコメント

mina massoud
mina massoud 2019 年 5 月 19 日
編集済み: madhan ravi 2019 年 5 月 19 日
thank you madhan ravi , you are always the best :)

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

その他の回答 (0 件)

カテゴリ

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

製品

リリース

R2019a

質問済み:

2019 年 5 月 19 日

編集済み:

2019 年 5 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by