Trying to create a base line that the function starts at.

Hey I need a have my graph start at 80 y-value and act normally, and the base value of 80 needs to be a flat dashed line across. I have called a function and I am just trying to plot it where it starts at the base value of 80. I have attached a screenshot of my matlab code.

 Accepted Answer

See the yline function to draw your flat dashed line.
What do you want to do if the data you've calculated starts at y = 50? Do you want to just add 30 to all the values?
What if it starts at y = 100? Do you want to subtract 20?
Or do you want to just add a value to that one point, or multiply by a scale factor that moves that first point to be at y = 80, or change the labels, or ... ?

1 Comment

So sorry for any confusion, I have attached my the graph i get when I run my code and what my graph should look like. Basically the dotted line on the correct graph is the basal glucose level of a healthy adult and after a meal the blue line is the spike in glucose and then the decrease for a healthy adult and the red line is the spike in glucose for a diabetic adult, I just need the baseline to ba at 80 mg/L so that after any meal the spike will always be above go above 80.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB 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!