Creating a function similar to a sawtooth function
Show older comments
Hello
I am trying to create a function similar to the sawtooth function. I would like a simple set of commands that would create a 1xn matrix of values based on the input of a maximum number and step size. For example I'd like to give the input of 20 for the maximum and a step size of 5 and receiver a matrix of the following form.
[0 5 10 15 20 15 10 5 0 -5 -10 -15 -20 -15 -10 -5 0]
The sawtooth function seems to create something similar but I was hoping someone could seggest another way that could produce the matrix as I am showing.
Thank you
Accepted Answer
More Answers (0)
Categories
Find more on Introduction to Installation and Licensing 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!