Create a triangular function
Show older comments
Hello.
I want to create a function in MatLab, which represents the image below.

Now, I can easily create a linear function for one of the lines and set the remaining to some constant, but I fail to do it for the combined two.
I was thinking about making a piecewise function or perhaps an inequality with the following restrictions:
I simply can't get it to work for both. If you have an idea, I'd love to hear it.
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots 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!