How so I change "Lookup Table" block parameter values during simulation

I am using a "Lookup Table" in my Simulink model in MATLAB R2018b, however, I would like to change/update my "Lookup Table" breakpoint and output table data parameters for the block during the model's simulation. I want to do this as not all my data is known at the start of my simulation.
How can I achieve this?

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2023년 8월 21일

0 개 추천

You could achieve this in MATLAB R2018b by utilizing the "Interpolation Using Prelookup" block and updating the table data input of the "Interpolation using Prelookup" using the appropriate function for your use case. Attached is an example ("varyLUT18b.slx") which uses a MATLAB function block to update the "Interpolation using Prelookup" table data input based on the modulo of the simulation time (but this could be done via a method that fits your use case). 
Note that the table for the "Lookup Table" block has to be of fixed size, but you should be able to control the extrapolation by ensuring you have reasonable values inside.
While this approach will work for R2018b, if you are able to upgrade to a more recent release, you could utilize the "Parameter Writer" block from MATLAB R2022a onwards. This block allows you to write to block parameters during simulation, so you can update or modify your inputs breakpoints and output table value parameters during simulation as you obtain more data. The "Parameter Writer" block documentation page is linked below:

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Event Functions에 대해 자세히 알아보기

제품

릴리스

R2022a

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by