Problem 42463. Calculate trends in time series
Create a new variable that has trends in input series. If t+1 is bigger than or equal to t, than trend in t will be 1, otherwise 0. The end value of trend will always be zero
x = [2; 3; 0; 1; 2; 2; 1; 5; 6; 3];
y = [1; 0; 1; 1; 1; 0; 1; 1; 0; 0];
Solution Stats
Problem Comments
-
1 Comment
Pramit Biswas
on 27 Jul 2015
good one
Solution Comments
Show commentsProblem Recent Solvers48
Suggested Problems
-
Change the sign of even index entries of the reversed vector
553 Solvers
-
542 Solvers
-
Returning a "greater than" vector
256 Solvers
-
Sum of odd numbers in a matrix
574 Solvers
-
149 Solvers
More from this Author92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!