MATLAB: Is there an example on how to use a 3D Look-Up Table in Simulink

dimensionallookndsimulink

I would like an example of how to use a 3D Look-Up Table in Simulink.

Best Answer

Here is a simple example on using the 3D Look-Up Table in Simulink. To run this example download the Simulink mode at the bottom of the page.
You will have to define the data of the look up table at the MATLAB command line because there is no direct way to create an arbitrary matrix with more than 2 dimensions using a single command; the Table Data prompt from the Simulink block will be used to enter the MATLAB variable name. Here is a simple 3D table that will convert a 3 digit binary number to its decimal equivalent:
data=[1 2; 3 4]
data(:,:,2)=[5 6; 7 8]
This will create the 3D matrix table. You can then run the Simulink model and move the Switches to see how it indexes into the matrix. For more information on the ND Look-Up table, navigate to:
<http://www.mathworks.com/help/toolbox/simulink/slref/ndlookuptable.html>
Related Question