필터 지우기
필터 지우기

Convert cfit model to C code

조회 수: 1 (최근 30일)
Tony Tse
Tony Tse 2017년 12월 7일
편집: Tony Tse 2017년 12월 7일
Hello,
How do I convert a cfit object (piecewise polynomial) and export that to standard C code as a function? I want to run the function from a microcontroller.
I am only interested in the value and not the other methods. I have attached the foo.mat which contains the cfit object and the script that I use to call it.
I should have an entry point function somehow with the model?
Edit: Alternatively I can reconstruct the piecewise polynomial model as a function. I would also like to know for future reference, whether I can export other curve fitting algorithm from Matlab into C? Such as Lev-mar (parametric fitting)?
  댓글 수: 1
Tony Tse
Tony Tse 2017년 12월 7일
편집: Tony Tse 2017년 12월 7일
I looked at it further and ended up extracting the breaks and coefs using unmkpp, which are hardcoded in my microcontroller. I converted mkpp and ppval into C. Hopefully this will work well.
I am still wondering about parametric curve fitting in C though.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by