I am struggling with my Matlab homework.
I have a datetime array called "date" and two arrays (X and Y) of the type double containing measurements for each time step.
I have to do the following task:
Select all time steps where both X AND Y are larger than their respective Z value. Store the dates of these time steps in a new variable. Name it 'C'
Z and Y are 52584x1 double vectors and date is a vector of the format 52584x1 datetime (dd.MM.yyyy hh:mm)
I tried:
%Some Dummy Data:
Y = 1:8:80
X = 2:4:40
t1 = datetime(2013,11,1,8,0,0)
t2 = datetime(2013,11,10,8,0,0)
date = t1:t2
Z = 8;
for i = length(date)
if X(i) > Z && Y(i) > Z
C=date(i)
end
end
I guess something is wrong with C=date(i)
Thankful for any help!