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 Solvers49
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15633 Solvers
-
How to find the position of an element in a vector without using the find function
2752 Solvers
-
Create a Multiplication table matrix...
594 Solvers
-
728 Solvers
-
Add a row of zeros on top of a matrix
254 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!