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

3 次查看(过去 30 天)
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!!!

回答(1 个)

Walter Roberson
Walter Roberson 2018-2-3
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);

类别

Help CenterFile Exchange 中查找有关 Fit Postprocessing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by