Plotting a trendline without distorting gradient of trendline

1 view (last 30 days)
Hi everyone,
My task is to plot a set of arrays against each other, but the trendline must go through a certain point on the plot (this point is not the origin though). All the solutions I found online seem to shift the the trendline to this point rather than adjust the gradient of the trendline.
A dirty solution I came up with is to make about 100 new entries into each array of the point that the trendline must pass through so that the gradient was skewed towards this point. It works very well, however I am looking for a more elegant solution. Does anyone have one?
Many thanks!

Answers (0)

Community Treasure Hunt

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

Start Hunting!