convert time & calculate performance
Afficher commentaires plus anciens
I need to represent the performance of multple programs by time elapsed vs size.But I don't know how to convert time I got. Also is my way correct to represent my Data ?
I will appricated any help.
X=[ '0m45.364s','0m45.097s','0m46.984s','0m44.962s','1m29.656s']; % this is time elapsed
Y = [200,400,600,800,1000,1200,1400,1600,1800,2000]; % the size
figure
hold on % allow all vectors to be plotted in same
% figure
plot(t, X, 'blue', t, Y, 'red', t, Z, 'green')
title('Row versus column ') % title
ylabel('Matrics size') % label for y axis
xlabel('Millisecond') % label for x axis
legend('Trial 1', 'Trial 2')
legend('Location','NorthWest') % move legend to upper left
6 commentaires
Walter Roberson
le 8 Avr 2019
You have different number of entries in X and Y?
You will need to use {} for X instead of [] and you will need to convert to a numeric time. duration() with InputFormat option for the conversion.
Brave A
le 8 Avr 2019
Walter Roberson
le 8 Avr 2019
Modifié(e) : per isakson
le 8 Avr 2019
duration(CellArrayOfCharacterVectors, 'InputFormat', 'm''m''s.SSS''s''')
I wrote the conversion format from memory. It might need an adjustment.
Brave A
le 8 Avr 2019
Walter Roberson
le 8 Avr 2019
I do not have access to matlab at the moment.
Did you change to {} in X? The [] you have would create one long character vector instead of a collection of items.
Brave A
le 8 Avr 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Legend dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!