Avoid a cycle using lsqcurvefit (or lsqnonlin)
이전 댓글 표시
Hi everybody,
I have many curves of experimental data (n*1000) and I need to apply lsqcurvefit function to determine the coefficients of equations. As a result I expect two coefficients to each of my curve. So indeed I can use lsqcurvefit in a cycle to each of my curve. But if there is a way to apply this function without cycle?
Best regards
답변 (1개)
Star Strider
2016년 9월 25일
0 개 추천
You would have to do your regressions iteratively in a loop.
I would ask lsqcurvefit for all the outputs, and then store them in a cell array (in a separate assignment line) in the event you find it necessary to calculate confidence intervals on the parameters or the fit, or otherwise compare the individual regressions from a statistical perspective.
댓글 수: 4
Star Strider
2016년 9월 25일
Kerim Khemraev’s ‘Answer’ moved here —
Star Strider,
Does that mean that I cannot avoid a loop? Because that loop would take a lot of time
Star Strider
2016년 9월 25일
Yes.
Knowing only what you have described, you cannot avoid a loop.
Star Strider
2016년 9월 25일
Kerim Khemraev’s ‘Answer’ moved here —
Ok. Then is there another way to solve my problem with least-squares methods without a loop? What do you think?
Star Strider
2016년 9월 25일
It depends what your problem is.
I have no idea what it is, so I cannot provide a more exact solution.
카테고리
도움말 센터 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!