How to bin the data set for two variables which will have some specific range at some specific interval?

1 view (last 30 days)
I have excel datasheet like screenshot attached above. Firstly I want to segregrate the according top gear position. After that a RPM and torque binning have to be done like the screenshot attached below.
I want to get the above mentioned matrix from the raw data
  1 Comment
Debanjan Maity
Debanjan Maity on 26 Nov 2018
I don't need the occurance of the dataset. Histcount will give the no of occurence of the two variable. But there is also a third variable i.e. time. I need the time at the specific RPM and torque step.

Sign in to comment.

Answers (1)

Bruno Luong
Bruno Luong on 26 Nov 2018
Check out
histcounts2
histogram2
  3 Comments
Bruno Luong
Bruno Luong on 26 Nov 2018
Edited: Bruno Luong on 26 Nov 2018
"Histcount will give the no of occurence of the two variable"
Not only, look at the fourth and fifth output arguments:
[N,Xedges,Yedges,binX,binY] = histcounts2(___)
It gives you which of the RPM/Torque case a data fall into. You just need to sum up the corresponding time (for example using accumarray).
When you provide a screen capture, you'll get a at best a description of what to do.
Debanjan Maity
Debanjan Maity on 27 Nov 2018
Edited: Debanjan Maity on 27 Nov 2018
I am not getting the time distribution. Basically i need the joint distribution of torque and RPM in terms of time from the time data. Like for RPM range of 700-800, and torque range og 30-40 for gear 1 there is only one data i.e. at the time of 1.2 sec. So the data will fill up as .2 in the bin as the gear has spent only .2 sec at the specific range.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!