Normal Distribution - using 24x45x65 matrix. - How to do this?
2 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!