MATLAB 无法从 Simulink 检查中找到 class
MATLAB cant find class from Simulink Check
MATLAB 找不到工具箱的 class - 我该怎么办?
基本上我想使用工具箱库slmetric的Width class,但是MATLAB找不到这个库。我该如何正确解决该问题?
>> misraWidget.setWidths(slmetric.dashboard.Width.Medium);
Undefined variable "slmetric" or class "slmetric.dashboard.Width.Medium".
或
>> getWidths(misraWidget)
Error using slmetric.dashboard.CustomWidget/getWidths
The class 'slmetric.dashboard.Width' contains a parse error, cannot be found on MATLAB's
search path, or is shadowed by another file with the same name.
我尝试使用 "which" 来更好地理解发生了什么并比较组的结果,这意味着存在 slmetric.* 和宽度的结果:
>> which slmetric.dashboard.Group
slmetric.dashboard.Group is a built-in method % slmetric.dashboard.Group constructor
>> which slmetric.dashboard.Width
'slmetric.dashboard.Width' not found.
>> which slmetric.dashboard.Width.Medium
'slmetric.dashboard.Width.Medium' not found.
我正在尝试以 this tutorial on how to customize your metrics dashboard for the toolbox Simulink Check. I use the Simulink Bounce Demo 为例。如果有人能向我解释如何在 MATLAB 中解决此类问题,我将不胜感激。 MATLAB 中的 "build/linking" 被隐藏了,所以我真的不明白如何处理这些事情。我通过搜索找到的最好的东西是 "which" 命令。
我设法解决了我的问题。回答我的一般问题如何找到更多关于包的信息:
而不是 'which' 我使用了 ?命令来探索我在包中知道的 class 的元数据。从那个 class 我提取了包的元数据,找到了包的所有 classes,选择了合适的一个,找到了 class 的所有方法的列表,还找到了合适的那个。这不是真正的用户友好,但它有效。
meta_group = ?slmetric.dashboard.Group
meta_package = meta_group.ContainingPackage
meta_classes = meta_package.ClassList
for i=1:7
disp(meta_classes(i).Name)
end
meta_widget = meta_classes(5)
widget_methods = meta_widget.MethodList
for i=1:38
disp(widget_methods(i).Name)
end
对于我的具体问题:我改用了 setWidthInt,它不依赖于使用 Width 枚举,但我仍然没有找到。我在
中寻找枚举
meta_classes.EnumerationMemberList
但是包中的所有 class 都是空的。
MATLAB 找不到工具箱的 class - 我该怎么办?
基本上我想使用工具箱库slmetric的Width class,但是MATLAB找不到这个库。我该如何正确解决该问题?
>> misraWidget.setWidths(slmetric.dashboard.Width.Medium);
Undefined variable "slmetric" or class "slmetric.dashboard.Width.Medium".
或
>> getWidths(misraWidget)
Error using slmetric.dashboard.CustomWidget/getWidths
The class 'slmetric.dashboard.Width' contains a parse error, cannot be found on MATLAB's
search path, or is shadowed by another file with the same name.
我尝试使用 "which" 来更好地理解发生了什么并比较组的结果,这意味着存在 slmetric.* 和宽度的结果:
>> which slmetric.dashboard.Group
slmetric.dashboard.Group is a built-in method % slmetric.dashboard.Group constructor
>> which slmetric.dashboard.Width
'slmetric.dashboard.Width' not found.
>> which slmetric.dashboard.Width.Medium
'slmetric.dashboard.Width.Medium' not found.
我正在尝试以 this tutorial on how to customize your metrics dashboard for the toolbox Simulink Check. I use the Simulink Bounce Demo 为例。如果有人能向我解释如何在 MATLAB 中解决此类问题,我将不胜感激。 MATLAB 中的 "build/linking" 被隐藏了,所以我真的不明白如何处理这些事情。我通过搜索找到的最好的东西是 "which" 命令。
我设法解决了我的问题。回答我的一般问题如何找到更多关于包的信息:
而不是 'which' 我使用了 ?命令来探索我在包中知道的 class 的元数据。从那个 class 我提取了包的元数据,找到了包的所有 classes,选择了合适的一个,找到了 class 的所有方法的列表,还找到了合适的那个。这不是真正的用户友好,但它有效。
meta_group = ?slmetric.dashboard.Group
meta_package = meta_group.ContainingPackage
meta_classes = meta_package.ClassList
for i=1:7
disp(meta_classes(i).Name)
end
meta_widget = meta_classes(5)
widget_methods = meta_widget.MethodList
for i=1:38
disp(widget_methods(i).Name)
end
对于我的具体问题:我改用了 setWidthInt,它不依赖于使用 Width 枚举,但我仍然没有找到。我在
中寻找枚举meta_classes.EnumerationMemberList
但是包中的所有 class 都是空的。