How so I change "Lookup Table" block parameter values during simulation
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 21 Aug. 2023
Beantwortet: MathWorks Support Team
am 19 Sep. 2023
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?
Akzeptierte Antwort
MathWorks Support Team
am 21 Aug. 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:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Lookup Tables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!