Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

select data from an existing dataset based on the weekday

Asked by Locks on 3 May 2013

Hi,

I have a matrix with 18 columns and over 100'000 rows and in each rows there are stored different characteristic for a specific data. In column 6 is the date in this form:

for example 730853 for the 02-Jan-2001  

Now I would like to create a new matrix that consists only if those rows where the date refers to a Wednesday, is that possible?

0 Comments

Locks

Products

No products are associated with this question.

1 Answer

Answer by Azzi Abdelmalek on 3 May 2013
Edited by Azzi Abdelmalek on 3 May 2013
Accepted answer
Example 
d1=730853
dates=datestr(d1:d1+100,'ddd-mm-yyyy')
M=[cellstr(dates) num2cell((1:101)')]
M=M(ismember(dates(:,1:3),'Wed','rows'),:)

1 Comment

Locks on 3 May 2013

perfect thanks

Azzi Abdelmalek

Contact us