How to use fminsearch function in SIMULINK in a MATLAB function block?
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to fit a set of data points (time(t)) governed by the following equation
Vt = x4 - (x1/[(t^x2)*{log^x3(t)}])
to a set of known Vt and t values. x1, x2, x3 and x4 are the 4 parameters to be optimised. I initialise values for the parameters to be optimised and try and do a least squares error estimate by using fminsearch function. This works fine in MATLAB. But when trying to do the same online in a MATLAB function block in SIMULINK, i encounter the following problem
1.) I cannot use NESTED or ANONYMOUS functions as they are not supported for code generation. fminsearch syntax allows me to pass variables exclusively through a NESTED function or through an ANOMYMOUS function in a function handle.
How do i circumvent this problem?
Documentation of MATLAB 2014a and 2014b says that it supports fminsearch for code generation.
댓글 수: 0
답변 (1개)
Claudio Rey
2023년 9월 7일
I am getting pretty disppointed that there is no answer on using fminsearch within Simulink. using coder.extrinsic DOES NOT HELP.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!