MATLAB: Do I receive an error message that cannot find some variable after running Fixed-Point Advisor in Simulink Fixed point 6.1 (R2009a)

abnormaladvisorexitfixed-pointfunctionundefinedvariable

Once I launch the Fixed-Point Advisor GUI from my model using Simulink Fixed Point 6.1 (R2009a), I right click on 'Fixed-Point Advisor' in the 'Fixed-Point Advisor' GUI and select 'Run to failure.'
However, I receive the following error message.
Abnormal Exit: Undefined function or Variable 'blkdiagram'
I am not able to find any information on 'blkdiagram' in my model.
This error occurs when we specify the data type, say 'int8', in the ' Propose data type and scaling' under 'Perform Data Typing and Scaling' in the 'Fixed-Point Advisor' GUI.

Best Answer

This issue has been resolved in Simulink Fixed Point 6.2 (R2009b).
To work around this issue in Simulink Fixed point 6.1 (R2009a), execute the following steps.
1. You need to modify the following file.
$MATLABROOT\toolbox\fixedpoint\fixedpointtool\@fxptui\@sfchartresult\isInSubsysToScale.m
$MATLABROOT is the root directory where MATLAB is installed and can be known by executing the following command at the MATLAB Command Prompt.
matlabroot
2. Add the following line of code to this file
blkDiagram = bdroot(topSubSystemToScale.getFullName);
right after this line in the existing code
subsys = fxptui.getsfsubsys(h);
3. Once you have modified the file, save it and execute the following command at the MATLAB Command Prompt.
rehash toolboxcache
4. Restart MATLAB.