fitting a function to data by changing a variable
1 ビュー (過去 30 日間)
Robert Roy 2018 年 8 月 21 日
コメント済み: Saumya Goel 2018 年 8 月 30 日
stem='I:\Engineering\ChemEng\LaserGroup\Robert\Data\PMT HAB Measurements\21st Sept PMT HAB Profile\HAB Measurements\Eq1.7HAB';
Hi there, I would like to fit the data read in by 'stem' to myfun which is a modelled function in a different script which changes the variable named dp? Thanks
dpb 2018 年 8 月 21 日
"... myfun which is a modelled function in a different script "
Have to save myfun as an m-file; functions in scripts are local within the script and thus aren't visible outside the script.
If the function you are referring (myfun) is defined in a script, then it is going to be a local function and cannot be accessed outside the script. In that case, as dpb pointed out you may have to save myfun as an m-file and add it to the MATLAB path.
Also, make sure you are passing the argument as function handle in nlintfit function. Please find the documentation for the nlintfit function.
If you would like to know more about the function handle, you can find here.
その他の回答 (0 件)
Find more on Linear and Nonlinear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!