making a up down ramp
Show older comments
For a assignment I am supposed to make a ramp function that goes up plaeteous and then goes back down. My proffesor said use a time array but I do not know what that means. I tried using a peicewise command but that did not work.
6 Comments
Ameer Hamza
on 30 Oct 2020
Can you show what have you already tried?
Adam Danz
on 30 Oct 2020
You're describing a step function which can be plotted several ways. Step functions have duplicate x-values when the function steps upward or downward making them easy to create using a simple plot() command. You could also use Matlab's heaviside() function or step().
Alexander Manderfeld
on 30 Oct 2020
Adam Danz
on 30 Oct 2020
That's even easier.
By the way, I can assure you the functions I mentioned early work. I think what you mean is that you tried the functions but they didn't achieve the trapezoidal changes you described in the comment above.
Stephan
on 30 Oct 2020
Show us what you have done so far and where your specific problem is. Also is there more information about the assignment? Maybe piecewise is not that what your professor wants you to use.
Alexander Manderfeld
on 30 Oct 2020
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!