Simulink filtering of a table

4 次查看(过去 30 天)
Lucas Maiß
Lucas Maiß 2020-5-25
回答: Jonas 2020-5-28
Hello,
I have a table with 5 col of input states and one as output.
So for 0.6 & 0.4 & 0.5 & 310 & 100 as input I would like to output 0.0453 (row 1).
So my question is how do I perform such a task in Simulink, as the inputs are signals in a Simulink Model?
Have a nice day!
  2 个评论
Nishant Gupta
Nishant Gupta 2020-5-28
You can use 'Matlab Function' block to do this. Just write the relationship between inputs and outputs inside the block, then you will get the resultant output corresponding to input signals.
Refer to the following link to know how to implement MATLAB function using block:
Lucas Maiß
Lucas Maiß 2020-5-28
I have tried it with the Matlab Function by setting using 'Edit Data' and defining the table as 'parameter'. So that does work for arrays but not for tables. I have also managed to search in the array but I think that is not so efficient than searching in a table, am I right ?
And my solution to that are not much more efficient:
  • Loading a .mat file with the table inside the function -> has to load complete table every time step
  • Converting to a table -> will be performed also every time step
(The table is quiet large (45000x6) so an efficient way would be great, I am also willing to restructure the table if necessary)

请先登录,再进行评论。

回答(2 个)

Fangjun Jiang
Fangjun Jiang 2020-5-28
The straightforward way to do this is to use "n-D Lookup Table". You have a 5-D lookup table here. The first 5 columns are the loopup axis, the sixth column is the output data.
Notice the firtst 4 columns of data you show here didn't change value? I imagine the large (45000x6) array is the expanded view of the loopup table data. Take a look at the help and example model of the Simulink n-D Lookup Table block and figure out the proper data for it.

Jonas
Jonas 2020-5-28
Use a Direct Lookup Table with 5 dimensions.

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by