【问题标题】:Estimate Simulation time in matlab在matlab中估计模拟时间
【发布时间】:2015-03-26 17:06:11
【问题描述】:

我有一个 matlab 代码,它对矩阵执行操作,例如将一个矩阵乘以另一个矩阵,然后对结果进行一些处理。我的矩阵大小为 10000*10000。那么,有没有办法知道模拟需要多长时间,甚至模拟完成的百分比。当我通过终端在服务器上运行模拟时,我只有终端屏幕,我不知道它是否正在运行或它在哪里。

谢谢。

【问题讨论】:

  • 您可以为较小的矩阵计算程序时间,然后推断估计的运行时复杂度。

标签: matlab


【解决方案1】:

解决此问题的一种简单方法是在代码中添加几行代码,以显示模拟到达的位置。

例如,如果您的工作流程中有多个单独的阶段,则可以添加诸如

之类的行
% Code to analyse the widget.

fprintf('Completed analysing the widget.')

fprintf('Now processing the results.')

% Code to process the results.

如果循环中有迭代过程,可以添加如下代码:

for i = 1:n

    fprintf('Now starting stage %d', i)

    % Code to do stage i

    fprintf('Completed stage %d', i)

end

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多