MATLAB: Combine values of many elements into a single element

MATLABmatrixmatrix arraymatrix manipulationStatistics and Machine Learning Toolbox

Hello,
Consider a matrix A 100×7:
1 NaN 2 0 1 6 5
1 NaN 2 0 1 1 4
….
How can I form a new matrix 100×1 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

Best Answer

A = [1 NaN 2 0 1 6 5; ...
1 NaN 2 0 1 1 4];
R = A(:, 3:6) * [1000; 100; 10; 1];