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

조회 수: 1 (최근 30일)
awda
awda 2014년 4월 22일
댓글: Star Strider 2014년 4월 24일
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.

채택된 답변

Star Strider
Star Strider 2014년 4월 22일
편집: Star Strider 2014년 4월 22일
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
awda
awda 2014년 4월 24일
ok thanks alot :)
Star Strider
Star Strider 2014년 4월 24일
Again, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by