01--数据导入
之前在Matlab/Simulink的一些功能用法笔记(二)中有介绍过数据的导入到MATLAB工作区间
本次主要是想介绍下数据的复用
我们以NEDC工况数据为例:

通过下列3种方法进行导入:
1.通过导入Excel表数据,使用From Workspace模块

选择 数值矩阵 导入

会在工作区生成该数据

使用From Workspace模块读取数据即可
(求解器定步长,步长0.01,仿真时间1180s)

运行:

2.通过Signal Builder模块




运行结果:

3.通过表格
首先复制数据:

打开Model Explorer
在Model Workspace内添加变量,把复制的数据填到[]内

插入时钟模块和表格模块,表格模块按如下填写变量

运行结果:

02--数据复用
有时候仿真需要不停的重复使用数据,以上3种方法我想到的是第3种,因为是通过查表实现的,所以可以使用取余模块,让时间取余后reset
把仿真时间改为6000s
运行结果:

工况数据在附件,自取