How to use fminsearch function in SIMULINK in a MATLAB function block?
3 ビュー (過去 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!