【问题标题】:Simulink does not load data from .mat fileSimulink 不从 .mat 文件加载数据
【发布时间】:2016-06-24 11:04:36
【问题描述】:

我正在尝试使用“From file”块从 Simulink 中的 .mat 文件将我的数据加载到我的仿真模型中。我正在使用 Matlab 2012a。我的数据文件是实数的一维向量(双精度型),尺寸为 1x200。

当我运行我的模拟时,我收到以下错误:

在 Matlab 首选项中,我已经将“保存可加载的 MAT 文件”设置为选项“Matlab 7.3 版或更高版本”,但这不起作用。我也测试过这种方法但没有成功:http://www.mathworks.com/matlabcentral/answers/47422-simulink-does-not-support-loading-the-input-data-in-file
如有任何想法,我将不胜感激。

【问题讨论】:

  • 请尝试创建 am minimal reproducible example。内容是什么?是否只需要一个来自文件块来重现您的问题?
  • @Daniel 我相信,我的问题是不言自明的。我在 .mat 文件中有某些数据,我想在 Simulink 的仿真模型中使用它们,并使用“来自文件”块。但是,使用此块时出现此错误。我想知道什么可能导致这个错误以及如何避免它。

标签: matlab simulation simulink


【解决方案1】:

根据From File 块帮助中的文档(通过按块对话框上的Help 按钮获得):

Matrix format can be used only for vector, double, noncomplex  signals. Each
column of the matrix must have a time stamp in the first row and a vector
containing the corresponding data sample in the subsequent rows.

您的 1x200 矢量与此格式不匹配。您需要添加代表时间的第一行。

【讨论】:

    猜你喜欢
    • 2023-04-06
    • 2015-04-22
    • 1970-01-01
    • 2017-02-22
    • 1970-01-01
    • 2013-12-28
    • 2020-07-17
    • 1970-01-01
    • 2015-06-13
    相关资源
    最近更新 更多