Curve Fitter Polynomial Plots Strangely In Script
Hello,
I am trying to analyze some doppler shifts on a spectrogram. I am using the Matlab Curve Fitter Tool to fit a curve to very specific data. The curve fitter works well. It generates polynomial parameters but when I try to graph this polynomial in a normal script, the output looks nothing like the graph in the curve fitter.
Here is the curve fitter:
Here is the curve fitter polynomial output:
And when I try taking these values (p1, … p10) and plotting the polynomial in a regular script, the output looks like this:
Which looks nothing like the curve in the curve fitter app. Additionally, the y-axis for the script graph is way off. I have tried playing around with the scaling outputs that the polyfit() function gives me but I haven’t made any progress. I have also tried to use the "center and scale" option but haven’t gotten that to work either. I clearly don’t understand something fundamental with this tool.
Thanks in advance for any help!
Here is my script’s code: (p values pulled straight from the curve fitter app)
p1 = 0.0067;
p2 = -1.7909;
p3 = 155.6940;
p4 = 1.1965e+03;
p5 = -1.2672e+06;
p6 = 1.1048e+08;
p7 = -4.9186e+09;
p8 = 1.258e+11;
p9 = -1.7629e+12;
p10 = 1.0551e+13;
x = 40:0.01:50;
p = [p1 p2 p3 p4 p5 p6 p7 p8 p9 p10];
plot(x, polyval(p, x));Hello,
I am trying to analyze some doppler shifts on a spectrogram. I am using the Matlab Curve Fitter Tool to fit a curve to very specific data. The curve fitter works well. It generates polynomial parameters but when I try to graph this polynomial in a normal script, the output looks nothing like the graph in the curve fitter.
Here is the curve fitter:
Here is the curve fitter polynomial output:
And when I try taking these values (p1, … p10) and plotting the polynomial in a regular script, the output looks like this:
Which looks nothing like the curve in the curve fitter app. Additionally, the y-axis for the script graph is way off. I have tried playing around with the scaling outputs that the polyfit() function gives me but I haven’t made any progress. I have also tried to use the "center and scale" option but haven’t gotten that to work either. I clearly don’t understand something fundamental with this tool.
Thanks in advance for any help!
Here is my script’s code: (p values pulled straight from the curve fitter app)
p1 = 0.0067;
p2 = -1.7909;
p3 = 155.6940;
p4 = 1.1965e+03;
p5 = -1.2672e+06;
p6 = 1.1048e+08;
p7 = -4.9186e+09;
p8 = 1.258e+11;
p9 = -1.7629e+12;
p10 = 1.0551e+13;
x = 40:0.01:50;
p = [p1 p2 p3 p4 p5 p6 p7 p8 p9 p10];
plot(x, polyval(p, x)); Hello,
I am trying to analyze some doppler shifts on a spectrogram. I am using the Matlab Curve Fitter Tool to fit a curve to very specific data. The curve fitter works well. It generates polynomial parameters but when I try to graph this polynomial in a normal script, the output looks nothing like the graph in the curve fitter.
Here is the curve fitter:
Here is the curve fitter polynomial output:
And when I try taking these values (p1, … p10) and plotting the polynomial in a regular script, the output looks like this:
Which looks nothing like the curve in the curve fitter app. Additionally, the y-axis for the script graph is way off. I have tried playing around with the scaling outputs that the polyfit() function gives me but I haven’t made any progress. I have also tried to use the "center and scale" option but haven’t gotten that to work either. I clearly don’t understand something fundamental with this tool.
Thanks in advance for any help!
Here is my script’s code: (p values pulled straight from the curve fitter app)
p1 = 0.0067;
p2 = -1.7909;
p3 = 155.6940;
p4 = 1.1965e+03;
p5 = -1.2672e+06;
p6 = 1.1048e+08;
p7 = -4.9186e+09;
p8 = 1.258e+11;
p9 = -1.7629e+12;
p10 = 1.0551e+13;
x = 40:0.01:50;
p = [p1 p2 p3 p4 p5 p6 p7 p8 p9 p10];
plot(x, polyval(p, x)); curve fitter, line of best fit, polynomial, matlab, doppler, doppler shift, spectrogram, curve fitting MATLAB Answers — New Questions