Is there a way to store execution times on a disk?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Steven Deng
am 13 Okt. 2022
Kommentiert: Star Strider
am 13 Okt. 2022
I am coding a program that add integer numbers, from 1 to N, one by one, where N is supposed to be an input.
However, I am also given the task of having the program take each intermediate result, storing them onto a disk, and report on execution times.
The first part is working out well, but I have no clue how to do the second part. Is this task possible for MATLAB to do?
So far, I have:
function fact = addInteger(n)
fact = 0;
for i = 1:n
fact = fact + i;
end
end
0 Kommentare
Akzeptierte Antwort
Star Strider
am 13 Okt. 2022
4 Kommentare
Star Strider
am 13 Okt. 2022
My pleasure!
I don’t see how your code differs significantly from mine, though, at least with respect to the tic and toc calls.
If my Answer helped you solve your problem, please Accept it!
.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!