フィルターのクリア

fastest way to divide a matrix columns into two matrices ?

2 ビュー (過去 30 日間)
farzad
farzad 2015 年 3 月 20 日
コメント済み: farzad 2015 年 3 月 20 日
Hi All
I have an m*n matrix
I want to take out the fifth column (all the m rows) to one matrix , and alll of the other collumns , to another , how to do that ?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 3 月 20 日
編集済み: Azzi Abdelmalek 2015 年 3 月 20 日
%If A is your matrix
A=randi(10,5,8) % example
c5=A(:,5) % the fifth column
B=A(:,[1:4 6:m]) % remaining matrix

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by