-
Notifications
You must be signed in to change notification settings - Fork 3
Histogram2
ds.Histogram2(ChannelX, ChannelY, [minValueX, maxValueX; minValueY, maxValueY])
ds.Histogram(__, Name, Value)
ds.Histogram(ChannelName, [minValue, maxValue])
creates a bivariate histogram plot of ChannelY
vs ChannelX
using the supplied datasources (ds
). The bivariate histogram is limited to ChannelX
values between minValueX
and maxValueX
; and ChannelY
values between minValueY
and maxValueY
ds.Histogram(__, Name, Value)
Additional optional parameters can be passed to the Histogram2
using Name-Value pairs
The name of the x-axis channel used to generate the bivariate histogram plot. For a list of possible channel see allLogged
.
The name of the y-axis channel used to generate the bivariate histogram plot. For a list of possible channel see allLogged
.
Histogram will only look at values between the minValue
and maxValue
, samples outside of that range will be ignored.
It is recommended to start with a range significantly larger than the anticipated range. Once an initial histogram has been generated, further refinements can be made to the values of minValue
and maxValue
as needed.
The range for ChannelX
is given by minValueX
and maxValueX
.
The range for ChannelY
is given by minValueY
and maxValueY
.
Sets the units used to report the channel values. Specified as a cell array {unitX, unitY}
, where unitX
is the units for ChannelX and unitY
is the units for ChannelY.
See getChannel for more information about unit conversions.
Number of bins used to generate the histogram, specified as two positive integer: [nBinsX, nBinY]
. Where nBinX
is the number of bins for ChannelX
and nBinY
is the number of bins for ChannelY
.
Defaults to 50 bins on both axes.
Normalization methods used, specified to one of following:
Normalization | Description |
---|---|
'count' |
The height of each bar is the number of observations in each bin |
'probability' |
The height of each bar is the number of observations in each bin divided by the total number of observations. The sum of the bars height's is one |
'pdf' |
Default Normalization. The height of each bar is (number of observations) / (total observations * area of bin). The sum of the bars volumes is one. |
Goal: Generate a G-G Circle using datasources from the 2016 FSAE Michigan competition.
First poll Datamaster for datasources from the competition
dm = Datamaster;
%Get Datasource that occurred during the competition (May 10-15th 2016)
ds = dm.getDatasource('StartDate', '2016-05-10', 'EndDate', '2016-05-15');
Using dm.allLogged
, we find that the channel for longitudinal acceleration is called 'G_Force_Long'
, and the channel for lateral acceleration is called 'G_Force_Lat'
. Let's assume that acceleration is less than 3G in all directions. Finally, set 'unit
' to {'G', 'G'}
so that the data stored in 'G_Force_Long'
'G_Force_Lat'
and is returned using units of 'G' and not using the SI units.
figure %Create a new figure for plotting
ds.Histogram2('G_Force_Lat', 'G_Force_Long',... %Plot longitudinal vs lateral acceleration
[-3, 3; -3, 3], 'unit', {'G', 'G'}) %We expect acceleration to be less than 3G
dm = Datamaster;
%Get Datasource that occurred during the competition (May 10-15th 2016)
ds = dm.getDatasource('StartDate', '2016-05-10', 'EndDate', '2016-05-15');
figure %Create a new figure for plotting
ds.Histogram2('G_Force_Lat', 'G_Force_Long',... %Plot longitudinal vs lateral acceleration
[-3, 3; -3, 3], 'unit', {'G', 'G'}); %We expect acceleration to be less than 3G
- Access Methods
- Helper Methods
- Graphing Methods