Description |
These tools find the best way to reduce the size of a table, given either the desired number of points or the maximum tolerable error. The resulting table allows faster interpolation and requires less memory.
Specifically, given an input 1D, 2D, or n-D table and a desirable number of breakpoints (or allowable mean squared error), these functions will calculate the best placement of the breakpoints to fit the input table. The user can specify how the table values should be interpolated using linear, spline, nearest methods, etc. The breakpoints, new table, and mean squared error of the fit are returned.
The optimal placement of breakpoints is taken to be the placement resulting in the minimum mean squared error of the new table evaluated at the original table's breakpoints with the specified interpolation scheme. For regularly sampled input tables, this acts as an integral of error over the table's area. This allows irregular sampling of the original table to focus on critical (e.g., rapidly changing) areas of the table.
To get started, either load the app and click "Help", enter "TableOptimizerGui" at the command prompt, or see find_best_table_demo.pdf.
Requires the Optimization Toolbox(TM).
Supports (but does not require) the Parallel Computing Toolbox(TM).
Generating Simulink(TM) lookup tables (Simulink is not required for normal operation) |