How to save genetaed figures after each loop and put all generated areas in one matrix?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I downloaded a code from MATLAB cummnity to perform my peak deconvolution. I have muliptle txt datasets. I need to get the curve and area under the peaks after each iteration.Then I need to plot the figures and put all generated areas under each peak. in one materix. But when I ran this code, it only gves me the last iteration result. I am wondering if anyone could help me with. I have uploaded all the dataset and code in google drive. Please find them in the following link.
Thank you,
MCC
回答 (1 件)
Maxim
2020 年 3 月 26 日
As far as I know there is no simple way to get the fitting constants at each iteration as an output. Read the function description, maybe I've missed something.
You can artificially do it by changing the maximum number of iterations, running the script and increasing this number each time.
You can do it by changing the number after 'MaxIter', on line 44 in fitV.m.
1 件のコメント
Ameer Hamza
2020 年 3 月 26 日
Allthough I haven't seen the OP's code but if the issue is to extract values at each iteration of lsqcurvefit can you can specify OutputFcn as an option to the optimizer https://www.mathworks.com/help/optim/ug/lsqcurvefit.html#buuhcjo-options. This function is called by the optimizer after each iteration. For example, check this: https://www.mathworks.com/matlabcentral/answers/510713-is-it-possible-to-store-the-intermediate-values-of-fmincon
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!