MATLAB: Apparently unpredictable errors on evenly spaced breakpoints for Prelookup Block

errorevenly spaced breakpointsprelookup

Dear all,
I am having Trouble with the Prelookup Block using the Index search method "Evenly spaced Points".
Even when using the example code from http://de.mathworks.com/help/simulink/ug/characteristics-of-lookup-table-data.html#br3_ved I often receive an error that my breakpoint data is not evenly spaced to the last bit.
This error seems to come only if the breakpoint data has both negative and positive data, and even then not always. I have created a minimal working example to further investigate this:
Depending on the Manual Switches the error Comes up or not. Is this a known issue, or does anyone have any idea how to fix this?
I am using Simulink 8.4.
Thank you for your help!
Tobias

Best Answer

Hi everyone, I solved that issue by writing a short script that manipulates the breakpoint vector in a way to assure evenly spaced breakpoints down to the last bit of precision. However, could this functionality not be part of the prelook up block? Maybe at least as an optional setting? I think slight manipulation of some breakpoint data in the 15th decimal place will not modify simulation results or lookup table output in most cases.