how to plot time-based x-axis?

3 visualizaciones (últimos 30 días)
youngwoo OH
youngwoo OH el 10 de Abr. de 2021
Editada: youngwoo OH el 13 de Abr. de 2021
I want to set the x-axis to time and measure a specific performance change over time.
The currently implemented code structure is as follows.
The plot I want finally is "ave_throughput/time". So I want to show the value of ave_throuhgput as time increases.
  2 comentarios
Walter Roberson
Walter Roberson el 10 de Abr. de 2021
Which variable is time? Is it implicit in the iteration number?
Your code structure implies that num_stream should be increasing somewhere, but I do not see anywhere it changes?
youngwoo OH
youngwoo OH el 10 de Abr. de 2021
The length of the code I wrote was long and complicated, so I omitted some of it.
In the case of time, it is a variable that increases as the number of simulations increases, and num_stream means a fixed constant.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 10 de Abr. de 2021
numtime = 17; %or whatever
timevals = linspace(0, maximum_time, numtime);
arr_throughput_A = zeros(max_num_stream,numtime);
ave_throughput_A = = zeros(max_num_stream,numtime);
for timeidx = 1 : numtime
current_time = timevals(timeidx);
% Sum the performance change, Explanation and declaration of some variables have been omitted.
for loop = 1:num_simul
total_throughput_A = 0;
total_throughput_A = total_throughput_no_re_clustering + %The sum of factors that make up performance;
if (total_throughput_A ~= 0) %
arr_throughput_A(num_stream,timeidx) = arr_throughput_A(num_stream,timeidx) + total_throughput_A/time_point;
end
end
% Average of performance indicators
for i = 1:max_num_stream
ave_throughput_A(i,timeidx) = arr_throughput_A(i,timeidx)/num_simul;
end
% plot part
....
plot(timevals, ave_throughput); %will have one line per stream

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by