Does anyone know how to do this problem
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ethan am 5 Nov. 2014
Kommentiert: David Sanchez am 5 Nov. 2014
MATLAB has timing functions that allow your program to monitor how much time has elapsed. These are called tic and toc. The function toc returns the amount of time since the last tic. Use a while loop to do the following for a total of 4 seconds. Every 0.3 seconds print, using fprintf, the message “The elapsed time is:” followed by the elapsed time.
lim = 0.3;
a=rand;%whatever your program does here
tmp = toc;
fprintf('The elapsed time is %g\n', tmp)
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!