Error on opening MATLAB Function block in Simulink
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
Ramtej
2024-4-8
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.
采纳的回答
R
2024-4-8
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!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Schedule Model Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!