Combine values of many elements into a single element

1 回表示 (過去 30 日間)
pavlos
pavlos 2016 年 1 月 3 日
編集済み: Jan 2016 年 1 月 3 日
Hello,
Consider a matrix A 100x7:
1 NaN 2 0 1 6 5
1 NaN 2 0 1 1 4
....
How can I form a new matrix 100x1 that takes the columns A(3:6) and combines them into a single element?
The new matrix should have 1 column:
2016
2011
...
Thank you.
Pavlos

採用された回答

Jan
Jan 2016 年 1 月 3 日
編集済み: Jan 2016 年 1 月 3 日
A = [1 NaN 2 0 1 6 5; ...
1 NaN 2 0 1 1 4];
R = A(:, 3:6) * [1000; 100; 10; 1];

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by