How so I change "Lookup Table" block parameter values during simulation
3 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2023-8-21
回答: MathWorks Support Team
2023-9-19
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
2023-8-21
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lookup Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!