MATLAB Community

MATLAB,社区等

Model-Based Design in the MATLAB Desktop

为了纪念我们最新的博客塞思(Seth)金宝app在Simulink上,本周我将致力于MATLAB台式机中基于模型的设计的一些有用功能。

The following is a survey of the various tools that come with MATLAB (available to everybody, depending on release), and how they can be used in a Simulink-based workflow. I’ve broken up the tools into two categories: those used for model setup, and those used for data analysis.

Tools for setting up/running your model include the MATLAB Editor, the EML Editor, Path Tool, and the File and Directory Comparisons.

The MATLAB Editor
如果您已经关注此博客了一段时间,那么您可能会知道MATLAB编辑器了解C和TLC文件,提供缩进,以及对这些语言的匹配和语法突出显示。这使您可以编写或编辑S-函数和TLC脚本,而不必从MATLAB中切换。


MATLAB Editor

MATLAB编辑器对于编写模型回调也很有用(我发现更容易调试整个M文件,而不是试图将复杂的代码挤入块属性中的小框中)。当然,这非常适合编写测试程序,sl_customization.m文件和数据分析脚本。


嵌入式MATLAB(EML)编辑器

The EML editor (opened when by double-clicking an EML block) is built on top of the regular MATLAB editor, providing all the nice M-file features, plus information related to the execution and building of a Simulink model. In particular it has toolbars for configuring the data ports and building the model.


EML编辑


The Path Tool

Thepathtool(File -> Set Path…) is a GUI for managing your MATLAB path. My Simulink projects tend to have a more complicated directory structure than my MATLAB projects. This is usually due to managing several libraries in addition to my model, its callbacks, and all my test and model advisor files. I find this GUI helpful for moving directories up and down the path, as well as making sure I have everything I need.


路径工具


Shortcuts

MATLAB shortcuts on the main toolbar are useful to do each of the followingaddpath相关任务:设置库,将公共参数值加载到工作区,移动生成的代码或启动外部实用程序systemcommand. We’ve even provided you with the Simulink icon to mark such shortcuts.

Shortcuts

Those were some of the tools available for creating models – the following three items are tools for analyzing the results of running a model or the results of generating code from实时研讨会.


File and Directory Comparisons

比较工具非常适合查看快速模拟的运行(RSIM)之间的差异。这些仿真的输出(输出块,已记录信号或文件块)可以使用比较工具(在R2008A中更新,可以比较比较垫子文件,而无需将它们加载到工作区中,可以将其保存为运行之间的垫子文件和可以比较的垫子文件。金宝app)。

您还可以使用该工具比较生成的代码文件。是否想快速查看如果您调整子系统选项或数据类型,生成的代码如何更改?生成代码,更改并重新生成新位置(请确保仅生成而不是生成和构建 - 您仍然获得代码,但需要更长的时间)。实际上,该工具的R2008A版本可让您通过比较目录然后钻入单个文件开始。


F&D比较
A comparison ofsf_engine.cafter changing the Engine subsystem of the sf_car demo to a reusable function.


Time Series Tool

The Time Series Tool (tstool)可用于绘制和操纵时间序列数据,例如信号记录生成的时间序列数据。该GUI提供了快速绘制和过滤统计信息的动作。在下面的屏幕截图中,我记录了x1x2signals of theVDPdemo model and loaded them into the timeseries tool after running the model with the command:tstool(logsout).


Time Series Tool


Variable Editor

The variable editor is useful for editing complicated arrays of data, such as filter coefficients, look-up table data, or index selectors.


Variable Editor

Making full use of Simulink requires generating MATLAB code and data, which you can interact with using your favorite Desktop tools. Let us know what else you think is handy for model-based design in MATLAB

|

注释

To leave a comment, please click这里to sign in to your MathWorks Account or create a new one.