select certain rows of a matrix dased on which data their elements are from
Show older comments
hi,
I have a matrix with several thousand rows and seven coulmns. In column 6 of each row can be seen the date of all the elements in that specific rows. The data set consist of days strting in january and ending in december of a specific year
I would like to select just those days that lie in a specific perdiod of time, let's say from 01/03 to 31/10
I have started with this:
%create matrix with 7 columns (F,K,PC,Price,T,date,r)
data=[F,K,PC,Price,T,date,r]
%enter period you will look at
%start date:
DateString='01-Mar-2002'
StartDate=datenum(DateString)
%end date
DateString='30-Oct-2002'
EndDate=datenum(DateString)
data=data(data(:,6)>=StartDate &...
data(:,6)=<EndDate)
the first comand creates the matrix which consists of 7 column. now basied on the start and end date entry, I would like to delete all the rows where the value of column 6 lies not in between 01 March and 30 October and save that new dataset under the name data
Unfortunately my code is not working and gives me this error: EDU>> create_dataset Error: File: create_dataset.m Line: 20 Column: 10 The expression to the left of the equals sign is not a valid target for an assignment.
Is there anybode who could help me resolve that problem?
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!