MATLAB: How to evaluate a MATLAB expression in another workspace in MATLAB Report Generator 3.6 (R2009a)

MATLABrpt;rptgen

When you use the 'Evaluate MATLAB expression' Report Generator component, it only evaluates the expression in the Base workspace. Is there any way to have it evaluate the expression in the Caller's workspace?

Best Answer

This functionality is not available in MATLAB Report Generator 3.6 (R2009a).
Some of the workarounds that could be used are:
1) Using the ASSIGNIN function to assign the variables in the Base Workspace.
2) Save all the function workspace variables from into a MAT file just before the call to the REPORT function. Then load this MAT file in the Report Generator MATLAB code that evaluates in the base workspace.
3) If possible, change the function to a MATLAB script. This will automatically evaluate in the base workspace.