Checking the quality of a measured data in matrix: 24x45x65 using pcolor function?

Hello
i have a matrix of : 24x45x65 -> 24 hours x 45 days x 63 customers(last customer have more data so it goes to 65)
however the normal power usage of a customer is 0.3-1.3 or something depending on when and how long its used...but datas like 5+ or 0 for long time has to do with bad quality or so.. i wanna see if its possible using the Pcolor matlab function or any other function to plot me a quality measurement or show me in other ways where the data is bad.. the file with datas is attached
thanks for helping alot

Answers (1)

If you want the indices of the zero power usage entries and power usage >=5 , I suggest:
load x_weekday
xwkd = x_weekday;
pzro = [];
pex = [];
for k1 = 1:size(xwkd,3)
[rz,cz] = find(xwkd(:,:,k1) == 0);
pzro = [pzro; rz, cz, repmat(k1,size(rz))]; % Indices for zero power usage
[rx,cx] = find(xwkd(:,:,k1) >= 5);
pex = [pex; rx,cx,repmat(k1,size(rx))]; % Indices for excessive power usage (5 kWh here)
end
The pzro matrix has the indices of the zero entries as [row column page] corresponding to [Hour Day Customer] (if I remember correctly). The pex matrix has indices of power usage >=5 kWh, in the same order and format.

4 Comments

thanks it is helpful :).
btw are u familiar with pcolor? a matlab function.
can i use that to show 1 customer/all customers bad quality of data. the good thing about pcolor is it displays the data of same range in 1 color and data with extreme observation in another...i just dont know how to make it so it only shows data over 5kWh and at 0 in RED...rest in blue or yellow if its around 1-5 kwh..
that would be awesome...and life saving :D
This took a while because it kept producing a completely black plot. Then I realised the reason was that your data were so large that the it exceeded the resolution of the plots. I trimmed the data plotted so the individual elements were visible.
Here’s the code, but the plot isn’t very informative:
load x_weekday
xwkd = x_weekday;
gtmtx = zeros(size(xwkd,1),numel(xwkd(1,:,:)));
ltmtx = zeros(size(xwkd,1),numel(xwkd(1,:,:)));
for k1 = 1:size(xwkd,1)
hrdata = xwkd(k1,:,:);
hrvct = hrdata(:);
pmen(k1) = mean(hrvct); % Mean for each hour
v1 = find(hrvct' > pmen(k1));
gtmtx(k1,v1) = 0.85;
v2 = find(hrvct' <= pmen(k1));
ltmtx(k1,v2) = 0.15;
gtmen(k1) = length(gtmtx(k1,:)); % Number > Mean for each hour
ltmen(k1) = length(ltmtx(k1,:)); % Number < Mean for each hour
pctgt(k1) = 100*gtmen(k1)/length(hrvct(k1,:)); % Percent greater than mean
hrmtx(k1,:) = hrvct;
end
x = 1:size(xwkd,1);
y = 1:size(hrvct);
pmtx = ((gtmtx + ltmtx)/2);
pmtxrng = [min(pmtx(:)) max(pmtx(:))];
figure(1)
pcolor(pmtx(:,1:300)');
colormap(jet)
axis ij
you'r right, not so informative :). i guess we wanted to show the quality of the measurement..and searched the net..found someone used similare method. but they probably had less data or something else.. guess we have to search for a new method to talk about the quality of the mismatchs and so on.
and thank you again for trying :)

This question is closed.

Asked:

on 27 Apr 2014

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!