- I have in Matlab two time signals
y1(t1)
andy2(t2)
. - The sample rate of
t1
andt2
is different (t2
has a lower sample rate). - Goal: I want to mask
y1
based on the value ofy2
: Wheny2
is zero theny1
should be zero. - Problem: Because of the different sample rates, I have trouble achieving this –> do you have an idea?
- The 2nd diagam shows teh desiged output für
y3
(= maskedy1
) (green).
t1 = 0:0.01:10;
y1 = sin(t1*10);
% plot(t1, y1)
t2 = 0:1:10;
y2 = t2.*[0 1 1 0 0 1 1 1 1 0 0];
% stairs(t2, y2)
plot(t1, y1)
hold on
stairs(t2, y2)
hold off
% I need a y3 with time t1.
% y3 is zero when y2 is zero.
% y3 = ???
Current output for y1(t1) [blue] and y2(t2) [orange]
Desired output for y3(t1) [green]