Thursday, September 27, 2007

Matlab Tutorial

Learning the Basics of Matlab

If any of you reading this happens to be a student at Purdue University, especially the freshmen in ENGR126H, you will understand what I mean when programming is HARD! I am very new to the methods of creating computer programs and I find it difficult sometimes to get your concept down into Matlab. Writing in code and having the correct syntax is hard to master. Here are a few things that I have picked up though in the few months I have been using the Matlab programming system.



One of the more simple commands that is useful to learn is the clear command. This command clears the page on which the output and input data is shown. I started out running my program time after time, printing out data each time which made the window cluttered with a lot of unnecessary numbers that were used in the previous program runs. Simply writing in clc at the top of your program will clear out all the old data so your new inputs and outputs can clearly be found after ever run through of your program.



Another good command that I use often use is size or length command. These help you when you are working with any kind of vector or list of numbers in columns or rows. Length helps you find how many elements are in a row vector. Size does one better; it comes up with how many rows and columns are in the given set of data. To use both commands, simply type size(data set) or length(data set).



Well that is all for my first "issue" of Matlab Tutorial, hope this helps out anyone who has to use a computer language to get something accomplished. If you are just dying to know more about Matlab and computer programming and can't wait for my next addition to Matlab Tutorial, then check out some of these links: University of Florida Matlab page; University of Michigan Engineering Matlab page; MathWorks Resource Page


No comments: