Saturday, February 9, 2013

Programming Is What's Playing on TV, Right?

...Wait, you mean computer programming? Oh...



Well, I'll be the first to admit I didn't know a thing about programming. But, as it's necessary to know the basics of programming to get to know Matlab and ultimately use it to create predictive models, I decided to poke my head out of my shell of ignorance and learn a little about programming. 

So what is programming?

It's the process of scheduling shows on television.

Just kidding. We're talking about computer programming. 

Computer programming is the process of designing source codes (instructions) that tell a computer what to do. The source code is commonly written in some programming language. There are several types of programming languages. Matlab is an example of a high-level language. This means that programming in Matlab features a lot more abstraction from the machine language of the computer. High-level languages such as Matlab are easier to learn and use as they use more natural language elements and automate processes coded in low-level languages.

Here's an example of basic programming in Matlab:



As you can see, the Matlab language is not so far off from our own. Here, let me break it down, starting from the first line. 

"Assume x is a random 1x1 matrix between 0 and 1.
If x is greater than 5,
let y equal 1.
Or if x is less than 5,
let y equal 2.
Or if x equals 5,
let y equal 3.
That's all!

Pick an x value.
x equals 0.6068
So y equals 2."

Not too hard to understand, right?

Now compare that with an example of low-level programming language:

8B542408 83FA0077 06B80000 0000C383
FA027706 B8010000 00C353BB 01000000
B9010000 008D0419 83FA0376 078BD98B
C84AEBF1 5BC3


 .....What is that ugly mess? Boy, I'm sure glad I don't have to deal with that!

See you next time!

4 comments:

  1. Hi Lu! Very interesting! So, are you finding Matlab user friendly? Is it easier or harder to learn than expected?

    ReplyDelete
  2. Hi Mrs. McConaghy! I've never used anything like Matlab before, so I'm not sure how user friendly it is compared to similar programs. So far, I'm getting along alright though. The built-in help section is pretty useful.

    ReplyDelete
  3. I'm so proud of you! You're learning how to program math stuff. I hope Linear Algebra proves useful.

    ReplyDelete
    Replies
    1. Thanks Mrs. Bailey. Knowing a bit about matrices certainly helps! ;)

      Delete