
lookup table error in simulink
28 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
vishnuvardhan naidu tanga
el 29 de Mayo de 2020
Editada: Johannes Lips
el 28 de Feb. de 2025
Hello I am trying to model a 2D lookup table in simulink. I am calling the break points and table data from workspace. When i run it it shows an error as "the number of dimensions specified by the 'Table data' parameter (1) must match the 'Number of table dimensions' parameter value (2)." but when I check the table dimensions are table data: 1x9000 and break point 1 : 1x9000 and break point 2: 1x9000 all are same. But still I am getting this error. Please guide me through it.
0 comentarios
Respuestas (2)
Sai Sri Pathuri
el 2 de Jun. de 2020
Check whether you have set Number of table dimesions to 1, since your data is one-dimensional

4 comentarios
Sai Sri Pathuri
el 2 de Jun. de 2020
Set Number of table dimensions (I highlighted it in above screenshot) to 1 in the dialog box, because your input is one-dimensional
Johannes Lips
el 28 de Feb. de 2025
Editada: Johannes Lips
el 28 de Feb. de 2025
The problem, which was not properly addressed in the previous answer, is the table data itself, not the dimensionality parameter.
For the 2D lookup table, you ought to use a row vector of length n1 for breakpoints 1, a row vector of length n2 for breakpoints 2, and a 2D matrix with size n1 x n2 for the table data.
Preprocessing (reshape or interpolate) of the 1x9000 data of this question is necessary to obtain the required inputs for the 2D lookup table block.
rangeX1 = %choose based on data e.g. min(x1):stepx1:max(x1)
rangeX2 = %similar
[X1grid, X2grid] = meshgrid(rangeX1, rangeX2);
% Create the scattered interpolant for your original data
F = scatteredInterpolant(x1, x2, y, 'linear', 'none');
% Evaluate the function on the grid
Ygrid = F(X1grid, X2grid);
Then use rangeX1, rangeX2 and Ygrid for the breakpoints and table data.
0 comentarios
Ver también
Categorías
Más información sobre Nonlinearity en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
