Unleashing the true power of Matlab

Posted by mazimadu on Feb. 2, 2016, 3:18 p.m.

If you ever had to use Matlab in college raise you hand! Go on, show of hands in the comments!

MATLAB is far and away the single most powerful piece of software I have ever used. It is responsible for doing everything from solving very complex equations to simulating the aircraft controls. It can be used to design and test multicore CPU circuits and output the whole design into C++ code. It can even make windows programs that have fancy 3D animations.

And it can plot fancy graphs!

Yet sadly, very few people can tap into the potential of this piece of software. Despite it being used by every Engineering and Computer Science major, not that many people know how to plot some of those fancy graphs it is so good at making. I recall many a day when I helped 3.5 GPA students on scholarships properly type in the code "plot(x,y)". ROCKET SCIENCE!

But right now, I an not doing rocket science with the software. I am doing something related to robotics. You see, finding the position of a device using an accelerometer is very, VERY hard to do. In fact it is so hard you need a gyroscope and compass just to correct the errors in angle and velocity. This is the reason so many Wii games had such bad controls. Despite almost every phone having these 3 sensors, there is still some research to be done in this area. As I mentioned in an earlier post, google is using this technology along side others in their Project Tango initiative.

So what does this have to do with Matlab? Since the sensors are only good for getting raw data, you will need to find a means to process, verify and experiment with that data before you start making apps with them. Linear acceleration and Euler angles are really cool and all, but how can you be sure some guys fancy equations make sense, or work as intended. You don't want to be making an app to find that out.

Below is a Matlab simulation taken from an IMU (Inertial Motion Unit) which is basically the 3 motion sensors of a phone, without the phone. This is the most impressive demo I have seen in this field and the results speak for themselves.

In the project I am trying to do I needed to get the sensor data from my phone to the program so I can calculate the position. The above video uses logged data stored on the IMU which has to be processed after it is reconnected to the computer. Luckily, my phone and work station are connected to the same WiFi signal. All I needed to do was know my PC and phones IP then I could send data from the sensors. Results are below:

With this working I can now use what I have learned to make a tracking app using QT. This makes my life a whole lot easier. It is amazing what this program can do, my college needs to teach it more effectively so we a can unleash its true power.

Comments

mazimadu 8 years, 2 months ago

I don't understand the joke. Who is this guy?

mazimadu 8 years, 2 months ago

Ok, I get it. I got my bachelors without mastering matlab. I can relate!

Omega_Squid 8 years, 2 months ago

Matlab rocks for biological population growth models!

Unaligned 8 years, 2 months ago

My thoughts with Matlab throughout algebra (and calculus I think) were "Oh we're using this super advanced tool (when the educational license forbids from investigating with it you know you're using something fancy) to transpose matrices or add columns or some crap and most of us are never going to use it again once we're done and even if we did it'd be long since the last time so we'd have to probably learn it all again"

I'm pretty sure I got extra points when I submitted my answers with the "spy" or "penny" instructions at the end of my assignments though.

Jani_Nykanen 8 years, 2 months ago

How it's possible I had never heard of MATLAB before…? (Answer: because you cannot use it to make games)

mazimadu 8 years, 2 months ago

Quote:
because you cannot use it to make games
Of couse you can use it to make games. It is fully capable of doing that.

I assume the real reason you haven't heard of it is because you are an art major.

Jani_Nykanen 8 years, 2 months ago

Quote:
I assume the real reason you haven't heard of it is because you are an art major.
Uh, I'm a math major.

Quote:
Of couse you can use it to make games. It is fully capable of doing that.
It can? Sweet.

EDIT: Just noticed I can get the software with my university account. Nice.

S3xySeele 8 years, 2 months ago

Haven't done the whole college thing yet, so I've never used MATLAB. Looks pretty interesting though.

Ferret 8 years, 2 months ago

I'm a lab instructor for an entry level engineering course where the students use matlab to do very rudimentary tasks, it seems like a shame to have the students do such boring tasks on it. I have no idea if those students ever use matlab again after that class.

mazimadu 8 years, 2 months ago

@ Ferret

Most usually don't. I only started using it seriously when I started my masters course. It is used regularly by systems engineers since it is the tool that can get most jobs done. All other engineering disciplines use specific tools for specific jobs. Matlab is more a swiss army knife, like photoshop.

@Jani_Nykanen

You are a math major and you never used matlab? What does your college teach you to use? Mathematica? GNU Octave? Excel? Lol

Also, Don't try to make a game with matlab. Unless you are making hardware, what you may make may resemble a BASIC program.