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

4 visualizzazioni (ultimi 30 giorni)
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!!!

Risposte (1)

Walter Roberson
Walter Roberson il 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);

Categorie

Scopri di più su Interpolation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by