MATLAB: Form a matrix with specific day types

datesMATLABmatricesmatrix manipulationStatistics and Machine Learning Toolbox

Hello,
Please help me with the following.
I have a matrix with dates as entries in the form:
01/01/2013 2 a
01/02/2013 3 b
01/03/2013 4 c
etc.
The right side digits denote the type of day, "1" is for Monday, "2" for Tuesday, "3" for Wednesday etc. and "a", "b" and "c" are values that are recorded in the specific dates.
How can I extract all the Mondays of the year with the respective values in a seperate matrix?
The new matrix should have the form:
01/07/2013 1 aa
01/14/2013 1 ab
01/21/2013 1 ac
etc.
Thank you very much. Best,
Pavlos

Best Answer

M={'01/01/2013' 2 'a'
'01/02/2013' 3 'b'
'01/03/2013' 4 'c'
'01/01/2013' 2 'a'
'01/02/2013' 2 'b'
'01/03/2013' 4 'c'}
day=2;
idx=ismember(cell2mat(M(:,2)),day)
out=M(idx,:)