查看单个帖子
旧 2019-12-14, 20:13   #1
poster
高级会员
 
注册日期: 2019-11-21
帖子: 3,006
声望力: 66
poster 正向着好的方向发展
帖子 MATLAB测量函数运行时间

如何在MATLAB中打印函数的时间

例:

%%%TAKE TIME A = [2 1 3 ; 1 2 5 ;3 5 4 ] [U,S,V] = svd(A) %%%FINISH TIME 什么是语法?



回答:

您还可以使用tic和toc的非单数形式:

tStart=tic; A = [2 1 3 ; 1 2 5 ;3 5 4 ] [U,S,V] = svd(A) tElapsed=toc(tStart); 这样可以使用多个计时器。 (否则,必须确保仅将tic和toc用于一种测量)



更多&回答...
poster 当前离线   回复时引用此帖