Lookup Table in Simulink
5 ビュー (過去 30 日間)
古いコメントを表示
Hello
How can I design a table consisting of two inputs and two outputs using the lookup table tool in Simulink?
For example, the first input is length, the second input is width, the first output is area, and the second output is volume
0 件のコメント
採用された回答
Paul
2023 年 11 月 14 日
Hi wafaa,
If the area and volume are both represented by by 2D arrays of the same size, and if the length and width input breakpoints are the same for both, then you can use the n-D Lookup Table block.
Store the area and volume arrays in a 3D array with the first page being the area table and the second page the volume table.
Then, in the block parameters, specify Number of Table Dimensions as 3, and the table data 3D array and the length and width breakpoints in the Table Data, Breakpoints 1, and Breakpoints 2 parameters (assuming you want to specify those parameters via Dialog) respectively. Specify Breakpoints 3 as 1:2.
The first two external inputs to the block are the length and width values for the lookup. Make the third input a Constant block with the Constant Value parameter set to 1:2.
2 件のコメント
Paul
2023 年 11 月 14 日
Suppose area and volume are both 3x3 arrays
area = rand(3);
volume = rand(3);
Create a 3D array as
tabledata = cat(3,area,volume)
Enter tabledata or the cat(3,area,volume) as the Table Data block parameter.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Lookup Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!