Time
进行代码节执行时间测量的时间端(MATLAB 代码生成)
说明
返回时间向量,该向量对应于测量代码节执行时间的时间段。Time
= NthSectionProfile
.Time
示例
获取代码节的时间向量
打开此示例以获取本教程的文件:
kalman01.m
- 卡尔曼估计器的 MATLAB® 函数test01_ui.m
- 要测试kalman01.m
的 MATLAB 文件plot_trajectory.m
- 绘制实际目标轨迹和卡尔曼估计器输出的文件position.mat
- 输入数据
openExample('ecoder/KalmanFilterExample')
设置并运行 SIL 执行。
config = coder.config('lib'); config.GenerateReport = true; config.VerificationMode = 'SIL'; config.CodeExecutionProfiling = true; codegen('-config', config, '-args', {zeros(2,1)}, 'kalman01'); coder.runTest('test01_ui', ['kalman01_sil.' mexext]);
执行结束时,您会看到以下消息。
To terminate execution: clear kalman01_sil
Execution profiling report available after termination.
点击链接 clear kalman01_sil
。
### Stopping SIL execution for 'kalman01'
Execution profiling report: report(getCoderExecutionProfile('kalman01'))
创建一个保留执行时间数据的工作区变量。
executionProfile=getCoderExecutionProfile('kalman01');
获取第二个代码节的配置文件。
secondSectionProfile = executionProfile.Sections(2);
获取代码节的时间向量。
time = secondSectionProfile.Time;
输入参数
NthSectionProfile
— coder.profile.ExecutionTimeSection
对象
由 coder.profile.ExecutionTime
属性 Sections
生成的对象。
输出参量
Time
— 时间
双精度
对代码节进行测量的时间段(秒)。以向量形式返回。
版本历史记录
在 R2013a 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)