Which Method for Classification in MATLAB?

I have a set of seven parameters which are numerical values (i.e. current readings, pitch, roll and yaw angles, acceleration, etc..) and I use them to classify a vehicle behavior.
For example, if:

pitch=12 degrees
yaw=41 degrees
Y_acc = 10 m/s^2

then the vehicle behaviour is classified as A otherwise if

pitch=15 degrees
yaw=42 degrees
Y_acc = 11 m/s^2

then the vehicle is classified as B, and so on..

What is the best way to implement this kind of classification in Matlab?
Should I use a simple neural network? Or a classification method like SVM?
Is there any tutorial or example?

I have a set of data where each set of parameters is related to a specific behavior, so I can use this to train my model.

Thank you!
Rocco GalatiR&D EngineerAsked:
Who is Participating?
Hopefully you can determine useful, human meanings for Type A and Type B terrain classifications.

Looking at your example:
   A ==> current = 10,  skid = 5, yaw = 6
   B ==> current = 12,  skid = 2, yaw = 7

I don't know what current and skid mean, but the difference between these two classifications is
   current and yaw increase by 20% and skid decreases by 60%.

If you assign nominal values for each type of terrain, you can use Euclidean distance as a classifier.  For example, the distance from A to B would be
   d = sqrt( (10-12)² + (5-2)²  + (6-7)²)  =  sqrt(14)

If all of your classifications are not a significant distance apart, you might need to include factors to increase the sensitivity of some terms or combine adjacent classifications.

The same distance classifier will let you match new terrains to you existing data base, with a well defined margin of error.  A lot of bad matches will indicate that you need more definitions.
I can see why you may need to classify the operating mode of you vehicle.
But how many classifications do you think you need?  And why can't you define them by hand?

You can go fastest in a straight line e on a smooth, flat road.
You can't go as fast uphill due to power constraints.
You may have to be more careful on bumpy roads, in turns, and downhill or sidehill driving to insure safe operation.

What other situations are you worried about?  Can you detect skids and stalls?
This article may be helpful, at least it was for me.

Does current mean motor current, and is it related to speed?

Does your data set include examples of control failures you are trying to avoid?  
  1. Flipping over backwards while climbing a hill, or forward when descending?  These would be pitch errors.
  2. Flipping sideways while traversing a step slope would be a roll error.  
  3. Going too fast on an unfavorably banked turn would be a roll situation as well.
  4. Not sure what a yaw situation would be.  Skidding or spinning sideways down a hill perhaps.
Rocco GalatiR&D EngineerAuthor Commented:
Hello d-glitch and thank you for your support!

I already have the algorithm to classify my vehicle behavior and it works very well when I run it on the dataset I already have.
What i need is to have a classification method which is able to compare the results from the datasets I already have and match them with other datasets.

To be more specific, my algorithm is able to detect the terrain type while the vehicle moves over it.
I need to find a classification method which helps me to detect the terrain type even when I use different datasets.

Each terrain is defined by specific sensors values, i.e. current = 10, skid=5, yaw=6, then terrain == A, otherwise if current = 12, skid = 2, yaw = 7, then terrain == B, and so on.

Let's say I have a table T with all the values related to each specific terrain types.
I would like to use a classificator which is able to compare the data coming from new datasets against the values contained in my table T and let me know if the new data are compatible with the data in the table T.

For example, by using the classificatior, I can understand whether the values from a new dataset include features similar to terrain type A or similar to terrain type B.
I believe this is the best approach, but I am biased.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.