Display elapsed time on plot

9 ビュー (過去 30 日間)
Edna Zheng
Edna Zheng 2022 年 7 月 27 日
編集済み: Ayush 2023 年 11 月 16 日
Hi, I want to find the elapsed time it took my network training program to find the parameters NAD for each of the hidden layers. However, I accidentally cleared all my data in my workspace. what should I do to find the elapsed time?
  1 件のコメント
David Hill
David Hill 2022 年 7 月 27 日
Whenever you complete a task, record the clock.
for k=1:100
%do stuff;
c(k,:)=clock;
end

サインインしてコメントする。

回答 (1 件)

Ayush
Ayush 2023 年 11 月 16 日
編集済み: Ayush 2023 年 11 月 16 日
Hi Edna,
I understand that you want to find the elapsed time took for your network to train.
You can use the “tic” and “toc” functions for finding the elapsed time to train the network. The “tic” function is called at the beginning of your network training program, to start the timer. After the training program is completed use the “toc” function, which will stop the timer and calculate the elapsed time for the whole process.
Please refer to the following pseudo code below for better understanding:
% Start the timer
tic;
% Run your network training program
% ... (your code here) ...
% Stop the timer and get the elapsed time
elapsedTime = toc;
% Display the elapsed time
fprintf('Elapsed time: %.2f seconds\n', elapsedTime);
For more information on “tic” and “toc” function refer the link below:
Regards,
Ayush

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by