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

4 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 21 de Ag. de 2023
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:

Más respuestas (0)

Categorías

Más información sobre Lookup Tables en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by