Data availability analyse (Visual )
11 views (last 30 days)
Show older comments
Hi gugys. I have a dataset:
K=65x1511 % where 65 is the number of houses and 1511 is the number of measurements.
What i want is to check the data availability of the measurements by plotting a figure like below, where the red pixels mean that the data is available while white mean that it is not available. But since i dont know which function is used to create such a data i'm totally lost.
Plz help.
9 Comments
Geoff Hayes
on 26 Apr 2014
Edited: Geoff Hayes
on 26 Apr 2014
So how does that information translate to the above image? The third dimension is customers and so corresponds to the y-axis, but how would you use the hours and days info for the x-axis?
So we have 63 days worth of information, with usage over a 24 hour period for each of those 63 days (for each of the 65 customers). So for one day, do you draw a red line (for customer i) for each hour that his/her energy consumption exceeds some pre-defined threshold? And leave as a white line otherwise?
per isakson
on 26 Apr 2014
Edited: per isakson
on 26 Apr 2014
Could the information of K be represented by a 2D (24x63) array
Customer
where
Customer( iiHour, iiDay )
holds the number of customer for hour==iiHour and day==iiDay ???
Accepted Answer
Star Strider
on 26 Apr 2014
Edited: Star Strider
on 27 Apr 2014
I am assuming that if data are not available over all Hours and all Days, those data are set to zero. (If something else is the indicator, you will have to make appropriate changes to the code.) Briefly, I created a matrix of random integers that included zero, the took the product across either Hours or Days (since you did not specify what you wanted), so the data were available across all Houses. Any zero over Days or Hours for a particular House would then produce a zero for that House, indicating that at least one datum was missing. I then plotted them.
K = randi(30, 24, 63, 65)-1; % Create Data
HouseXHrs = squeeze(prod(K,2)); % Product across ‘Days’
HouseXHrs(HouseXHrs > 0) = 10;
HouseXHrs(HouseXHrs <= 0) = 60;
HouseXDay = squeeze(prod(K,1)); % Product across ‘Hours’
HouseXDay(HouseXDay > 0) = 10;
HouseXDay(HouseXDay <= 0) = 60;
figure(1)
pcolor(HouseXHrs)
xlabel('Houses')
ylabel('Hours')
axis equal
colormap(jet)
figure(2)
pcolor(HouseXDay)
xlabel('Houses')
ylabel('Days')
axis equal
colormap(jet)
This produces for figure(2):
It is not exactly as you posted, but it is as close as I can get with MATLAB graphics.
2 Comments
Star Strider
on 28 Apr 2014
My data here are random integers. I don’t have your data, so I have no idea what your data look like when plotted this way. I simply provided you with a way to plot them yourself, using MATLAB graphics.
Insert your data for variable K and go from there.
More Answers (0)
See Also
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!