Using Simulink to import data tables and apply algorithms
이전 댓글 표시
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.
답변 (1개)
Kaustubha Govind
2011년 3월 8일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!