Error on opening MATLAB Function block in Simulink

5 views (last 30 days)
Whenever I add a MATLAB Function block in a Simulink model and double-click it, instead of a script opening with function y = fcn(u), I get a blank script while the following error/warning message pops up in the MATLAB command window and MATLAB becomes unresponsive.
Warning: Error occurred while executing the listener callback for event MLFB
defined for class slmle.internal.slmlemgr:
Operands to the logical AND (&&) and OR (||) operators must be convertible to
logical scalar values. Use the ANY or ALL functions to reduce operands to
logical scalar values.
Error in slmle.internal.MLFBEditor/callback
Error in slmle.internal.MLFBEditor/init>@(varargin)obj.callback(varargin{:})
Error in slmle.internal.slmlemgr/action
Error in slmle.internal.slmlemgr/init>@(varargin)obj.action(varargin{:})
Error in message.internal.executeCallback
> In slmle.internal.slmlemgr/action
In slmle.internal.slmlemgr/init>@(varargin)obj.action(varargin{:})
In message.internal.executeCallback
In slmle.internal.MLFBEditor/createToolStripContext
In slmle.internal.MLFBEditor/open
In slmle.internal.slmlemgr/open
In slmle.internal.EMLEditorApi/documentOpen
In open_editor (line 72)
In eml_man (line 56)
In eml_function_man>create_ui (line 169)
In eml_function_man (line 26)
In eml_chart_man>create_ui (line 104)
In eml_chart_man (line 20)
In dispatch_task (line 12)
In eml_man (line 66)
In studio_redirect>try_specialized_editor_open (line 761)
In studio_redirect>open_object (line 775)
In studio_redirect (line 33)
In sfprivate (line 15)
In slsf>blk_open_method (line 784)
In slsf (line 55)
This happens only on my PC though. This does not happen when I use a MATLAB Function in someone else's PC.
How do I resolve this issue?
  1 Comment
Ramtej
Ramtej on 8 Apr 2024
Assuming you are getting this error for every MATLAB function block across all Simulink models and the MATLAB function block is valid. The error seems to be quite specific and suggests there might be an issue with your MATLAB installation or configuration since you mentioned that issue is unique to your PC. Reinstalling the MATLAB might fix your issue.

Sign in to comment.

Accepted Answer

R
R on 8 Apr 2024
Hi Tirthankar,
I encountered a similar problem previously. In my case, the error occured because the path to the Simulink model file included special characters, particularly the '#' symbol. The presence of a hash symbol in the path can cause it to be misinterpreted, resulting in the loss of all information following the hash. I suggest relocating the model files to a directory that does not contain any special characters, with an emphasis on avoiding '#'.
Hoping this resolves the issue!

More Answers (0)

Categories

Find more on Schedule Model Components in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!