How to get elements from large matrix

2 ビュー (過去 30 日間)
James
James 2012 年 6 月 6 日
Hi,
If I have a large matrix, and would like to extract elements from 3 column. How do I write the Matlab code? Example:
A = [2 3 5 7 9 1 1 4 5 6; 3 3 2 4 5 6 2 4 6 7;9 2 3 9 4 5 3 9 2 9]
How do I write the code to get elements in all rows of columns 1, 7 and 9 ?
Thanks

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 6 月 6 日
out = A(:,[1 7 9])

その他の回答 (1 件)

James
James 2012 年 6 月 6 日
Thanks for your help guys. The problem is now solved!

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by