Lookup Table in Simulink

조회 수: 5 (최근 30일)
wafaa almayahi
wafaa almayahi 2023년 11월 13일
댓글: Paul 2023년 11월 14일
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

채택된 답변

Paul
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
wafaa almayahi
wafaa almayahi 2023년 11월 14일
이동: Paul 2023년 11월 14일
Thank you for your answer, but I don't understand what you mean by the first and second pages to enter the values of the output
Paul
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)
tabledata =
tabledata(:,:,1) = 0.0067 0.3951 0.5523 0.8955 0.5017 0.9367 0.2048 0.7986 0.8123 tabledata(:,:,2) = 0.0032 0.0055 0.0774 0.1875 0.4014 0.4446 0.6051 0.1831 0.1433
Enter tabledata or the cat(3,area,volume) as the Table Data block parameter.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lookup Tables에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by