Octave // Matlab TutorialHelp
In order to complete this course, you'll need access to the programming language of Matlab or Octave. Matlab is a proprietary software for which a free, limited license is being offered for the duration of this course. Octave is a free, open-source alternative to Matlab.
**_Why should I prefer Octave or Matlab?
**Matlab and Octave will both suit the purposes of this course, but there are a few differences that you should consider when choosing one or while demoing both.
What is the cost?
For the duration of this course, both software packages are available free of charge. Octave is distributed under the GNU General Public License, which means that it is always free to download and distribute. After the course, Matlab can be licensed to individuals or companies for use at a specified rate.
Is there a difference in quality?
There are several subtle differences between the two software packages. Matlab may offer a smoother experience (especially for Mac users), contains a larger number of functions, and can be more robust to failure. With that being said, the functions used in this course are available in both packages, and many students have successfully completed the course using either.
_How do I download the software? _To get one or both of the distributions, follow the directions below:
Octave Installation
InstructionsNote: the resources for this course include downloadable installation packages for Octave version 3.2.4 (you'll find links to these packages in the instructions below), which was the latest version at the time of the course's first session in 2011. Updates to Octave occur frequently, and information about the latest updates can be found on the Octave website. The examples that you'll see in lectures and other pages in this course reference version 3.2.4, but we encourage you to install more recent versions if you would like to take advantage of new features and updated interfaces. Students in recent sessions of the course have used newer versions successfully to submit the assignments (that is to say, there are no known compatibility issues between the material in the course and newer versions of Octave). If you are interested in downloading a newer version, please consult the Octave website and the Octave Wiki pages forWindows users and Mac users.
Windows Instructions
- Download Octave: Octave-3.2.4_i686-pc-mingw32_gcc-4.4.0_setup.exe
- Run the file and when prompted to allow the program to make changes to this computer, click Yes.
- You should see the following installation screen. Click next to continue.
- The next screen shows the license agreement. Click next to continue.
- In the following screen, you can choose where to install Octave to. The default installation directory is recommended. Click next to continue.
- Next, you can choose which components to install. In this class, we will often use functions from the image package. Scroll down the list and select the image package to be installed. Then, click next to continue.
- Now, you can select a start menu folder to place the Octave shortcuts. Click install to begin the installation.
- Octave should begin installing.
- You should see the following screen.
Click Finish to complete the installation.
- You can now run Octave using the shortcut from the Start Menu. This will launch the following window.
- You're all set! Once you're in Octave, you can begin experimenting with the Octave commands (e.g., try typing 2+3). To get help in Octave, you can type "help command-name" (e.g., help plot). More information can also be found at the Octave documentation.
When starting on the programming assignments for the class, be sure to change directory using the cd command first so that Octave knows where the files are.
Mac OS X Instructions
- To run Octave, we first need to verify that you have X11 installed.
Open the Applications folder and then open the Utilities sub-folder. Look for X11 in this folder, if the application exists, then you have X11 installed.
If you do not have X11 installed, you can download and install X11 from here: X11-2.6.3.dmg (Leopard) or XQuartz-2.6.3.dmg (Snow Leopard).
- Download Octave: octave-3.4.0-i386.dmg
- Mount the disk image (octave-3.4.0-i386.dmg) by double-clicking on it.
To install Octave, drag the Octave.app icon and drop it into the Applications folder as shown below.
- We will also be using additional plotting tools with Octave. These additional tools are in the Extras folder (shown in the previous image). When you open theExtras folder, you will see the Gnuplot installation disk image (gnuplot-4.4.3-aqua-i386.dmg).
- Mount the Gnuplot disk image (gnuplot-4.4.3-aqua-i386.dmg) by double-clicking on it.
To install Gnuplot, drag the Gnuplot.app icon and drop it into the Applications folder as shown below.
- You can now run Octave by launching it from the Applications folder. This will launch the following window.
- You're all set! Once you're in Octave, you can begin experimenting with the Octave commands (e.g., try typing 2+3). To get help in Octave, you can type "help command-name" (e.g., help plot). More information can also be found at the Octave documentation.
When starting on the programming assignments for the class, be sure to change directory using the cd command first so that Octave knows where the files are.
Linux Instructions
- On most modern Linux distributions, you should be able to install Octave using the package manager. For Ubuntu, the following commands should work for most:
sudo apt-get update sudo apt-get install octave3.2 gnuplot
For Fedora Linux, you can use:
sudo yum install octave
Software Sources
The mirrored software provided above were obtained from:
Matlab Installation Instructions
If you elect to download Matlab, you can use the following link. Complete instructions will be found in the pages therein:
--Download Matlab here--
For support or any questions related to Matlab installation, please post on the Matlab help forum.
You may also be interested in Matlab's tutorial videos (accessible via the links below), which provide a general introduction to Matlab as well as detailed tutorials for common tasks (such as mathematical operations, vectors, matrices, and programming constructs).
Introduction to MATLAB
Learning Module | YouTube Link |
What is MATLAB? | https://www.youtube.com/watch? |
The MATLAB Environment |
Mathematical Operations in MATLAB
Learning Module | YouTube Link |
MATLAB Variables | |
MATLAB as a Calculator | https://www.youtube.com/watch? |
Mathematical Functions | |
Logical Operators |
Vectors in MATLAB
Learning Module | YouTube Link |
Creating Vectors via Concatenation | |
Creating Uniformly Spaced Vectors (Colon Operator) | |
Creating Uniformly Spaced Vectors (linspace function) | |
Accessing Elements of a Vector | |
Conditional Data Selection | |
Vector Arithmetic |
|
Matrices in MATLAB
Learning Module | YouTube Link |
Creating Matrices | |
Array Creation Functions | |
Array Size and Length | |
Concatenating Arrays | |
Matrix Multiplication |
Visualization in MATLAB
Learning Module | YouTube Link |
Line Plots | |
Multiple Plots | |
Annotating Graphs | |
Visualizing 3-D Data Using pcolor |
Programming Constructs in MATLAB
Learning Module | YouTube Link |
If-Else Statements | |
For Loops |
|