Normal Distribution - using 24x45x65 matrix. - How to do this?

1 visualización (últimos 30 días)
awda
awda el 22 de Abr. de 2014
Comentada: Star Strider el 24 de Abr. de 2014
Hello
I have a set of data in a matrix of: 24x45x65 --> hours x days x customers i want to make a normal distribution plot for each hour of lets say 1 customer on y-axis. so there will be 24 Graphs. then i can show the mean of it..lower and upper boundry on the plot. its data of some customers using energy in different times of the day..(before going to Work and coming back from the Work) example(used pain
t :P)
is it possible to do so? i will include my data to this file..so its easier to understand :)
thanks in advance, help will be appreciated alot.

Respuesta aceptada

Star Strider
Star Strider el 22 de Abr. de 2014
Editada: Star Strider el 22 de Abr. de 2014
This seems to work:
load x_weekday
xwkd = x_weekday;
for k1 = 1:size(xwkd,1)
hrmx = xwkd(k1,:,:); % All data for hour ‘k1’
hrmn(k1) = mean(hrmx(:)); % Mean
hrsd(k1) = std(hrmx(:)); % Standard deviation
end
N = numel(hrmx);
figure(2) % Plot Mean ± Standard Deviation
errorbar([1:24], hrmn, hrsd)
grid
xlabel('Hour')
ylabel('kWh ± SD')
figure(3) % Plot Mean ± Standard Error
errorbar([1:24], hrmn, hrsd/sqrt(N))
grid
xlabel('Hour')
ylabel('kWh ± SE')
It plots the data for all customers. To plot data for a particular customer, say Customer #10, change this line:
hrmx = xwkd(k1,:,:); % All data for hour ‘k1’
to:
hrmx = xwkd(k1,:,10); % All data for Customer 10 for hour ‘k1’
  10 comentarios
awda
awda el 24 de Abr. de 2014
ok thanks alot :)
Star Strider
Star Strider el 24 de Abr. de 2014
Again, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by