calculating the time
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a code which runs for 10 iterations in this i want to calculate the time for each iteration and find the minimum time for iteration,please help
0 Kommentare
Akzeptierte Antwort
Wayne King
am 22 Mai 2012
You can use tic and toc.
t = zeros(1,100);
for n = 1:100
A = rand(n,n);
b = rand(n,1);
tic
x = A\b;
t(n) = toc;
end
[mintime,I] = min(t);
2 Kommentare
Weitere Antworten (1)
Wayne King
am 22 Mai 2012
Just save the CR values in a vector, then query which one is the max
3 Kommentare
Jan
am 22 Mai 2012
Dear kash, there is no reason for shouting.
"but not getting the result" is vague. I guess you get a detailed error message instead, because you try to assign the array CR to one of its elements. This is not possible for obvious reasons.
But the questions about the compression ratio do not concern the original question, such that it it recommended to open a new thread. Otherwise it gets impossible to accept the best answer.
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices 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!