Clear Filters
Clear Filters

Is there a faster way calculating the y value of a gaussian line of fit?

3 views (last 30 days)
I was wondering how to find the y value of a gaussian line of fit. It gives me the coefficients (a1, b1, c1, a2...) and the equation for the line, but I have to manually do put it in the calculator to find the answer. I have about 20 terms, so I was wondering if there was a faster way to calculate it and find that y value. I am very new to MATLAB, so I hope you all can help me out. I will greatly appreciate it. Thank you!!!

Answers (1)

Walter Roberson
Walter Roberson on 3 Feb 2018
If you are using fit() to produce a cfit object, then you can call the cfit object like it was a function in order to calculate the value at the given location. For example,
cf = fit(...., xdata, ydata);
x_to_project = linspace(-10, 10);
y_projected = cf(x_to_project);

Community Treasure Hunt

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

Start Hunting!