lookup table optimizer claims function has states, but has non
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi everybody,
I try to use the loopup table optimizer for a function within a simulink block intended for hdl code generation.
the function is:
function T = fcn(input)
A=1.6157254;
B=-1.086193e+05;
C = 1.98e-25;
D=1.38e-23;
T=(C/(D*(log(input)-A)))*B;
the message I get is "the function to be optimized needs to be stateless"
any idea why i get this message and how to solve it?
Fabian
댓글 수: 0
답변 (1개)
Arnav
2024년 9월 16일
I understand that you are using Lookup Table Optimizer to optimize the function written in a MATLAB Function Block in Simulink for HDL Code generation. I was able to reproduce the error using the function you provided. The error dialog I received is shown below:
Since the function is already time invariant and stateless, this suggests that the error is due to operations * and / and these need to be converted into element-wise operations.
To convert * and / operations into element-wise operations, you can change the last line to:
T=(C./(D.*(log(input)-A))).*B;
I hope this might be helpful in resolving your query.
You may refer the following documentation link for more information about Lookup Table Optimizer:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Approximate Functions with Lookup Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!