How to use a GUI to set the polynomial level for a graph after examining the data
Show older comments
Hi there - me again!
I'm trying to make my program more and more clever but keep falling down when not understanding how to enter variables into functions of Matlab that expect a certain order. My bit of code I've made nicely shows the graph I want to fit the curve to, but, when the user enters the polynomial level, I can't get fit() command to use it.
Any help appreciated! Should I be using a different command to fit()?
% Fit a polynomial to the data
prompt2={'Enter the level of polynomial to use):'};
% Create all text fields with the questions specified by variable prompt
box2title='Polynomial Selection';
% The main title of your input dialog interface.
answer2= inputdlg(prompt2,box2title);
[Width_fit, gof] = fit( v1,wdth, answer2, 'Normalize', 'on' );
It's exspecting things like 'poly5' rather than just 5.
Thanks
Vadim
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!