Hey all, I am plotting some data using matlab and have a question.(adsbygoogle = window.adsbygoogle || []).push({});

Basically, this is what I'm trying to do. I am calling a bunch of data from Excel, plotting this data in MATLAB (it gives me two lines), and then calculating the polyfit values for each line so I can find the equation y = mx +b for each one. I have no problem Doing all of this, but what I want to do next is display the polyfit data in thelegendof the graph. I'm confused if this is possible with the legend function.

So in other words where it says 'Best Fit of Reflection 1' and 'Best Fit of Reflection 2' I want to somehow place the data calculated by polyfit in the form y = mx +b. Any suggestions? Thanks in advance.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab: Data from Best Fit Lines into Legend

Loading...

Similar Threads - Matlab Data Best | Date |
---|---|

Matlab Plotting Data | Mar 18, 2017 |

Matlab How to extract data from existing JPEG/TiFF graph? | Oct 27, 2016 |

Exporting data points to Excel with Matlab? | Jun 23, 2015 |

Extracting multiple data in a MATLAB matrix | Sep 23, 2014 |

Entering simulink 3D look-up table data from MATLAB | Apr 2, 2014 |

**Physics Forums - The Fusion of Science and Community**