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

3 次查看(过去 30 天)
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
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 个)

类别

Help CenterFile Exchange 中查找有关 Lookup Tables 的更多信息

标签

尚未输入任何标签。

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by