Using Simulink to import data tables and apply algorithms

2 views (last 30 days)
I’d like some assistance in creating a Simulink model – I’m a MATLAB user, but haven’t used Simulink in about 10 years. Basically, I need to import two tables (one static and one dynamic) which shall include row/column names and numbers (doubles). Subsequently, a third table will be created to include results from Tables 1 and 2, then an algorithm shall be applied to the third table. After applying the algorithm, I wish update table 2 and repeat this process every 5 seconds.
My first step is to simply import the data tables. I am considering the ‘constant’,’ import from .mat’, and ‘import from workspace’ blocks. Any recommendations on the best method for doing this?
Any help is appreciated.

Answers (1)

Kaustubha Govind
Kaustubha Govind on 8 Mar 2011
The From File and From Workspace blocks are best if you have a vector of input (time) samples. However, since your tables (or at least one of them) are constant w.r.t. time, I would recommend using the Constant block. However, you will need to remove the row/column names and create array constants of type 'double', since Simulink cannot handle non-numeric datatypes.
For Table 2 - you could use something like a Unit Delay block whose initial output is the constant value at t=0. Its input should be connected to the output of your algorithm that updates Table 2.

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!