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

조회 수: 4 (최근 30일)
Trishal Zaveri
Trishal Zaveri 2018년 2월 3일
답변: Walter Roberson 2018년 2월 3일
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에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by