MATLAB, draw tolerances in a plot similar to errorbar in matlab, but perpendicular to points in the curve.

6 views (last 30 days)
I have two arrays time and output, and I want the tolerances to be shown on a plot. I know that errorbar(time,output,err) does this in matlab, but I want the bars to be perpendicular to the point in the curve. errorbar only provides horizontal or vertical bars.

Answers (1)

John D'Errico
John D'Errico on 4 Nov 2023
Edited: John D'Errico on 4 Nov 2023
You can want code to do as you want, but it won't help. And there is no version of errorbar that will do as you want. This means you will need to write the code yourself.
That means you need to compute the normal vector to the curve at any point.
Then compute the length of those error bars. I'm not entirely sure how you have chosen to compute such a perpendicular error bar, but this is your project, not mine.
Finally, plot them yourselves, using your own code. You can use tools like patch at this point.

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!