Tutorials Home

Basic Matlab

- Workspace
- Vectors
- Matricies
- Linear Systems
- Vector Operations
- Loops
- Plots
- Executables
- If Statements

Simulink

- Simulink Tutorial
- Bouncing Ball
- Inverted Pendulum
- Spring-Mass System

MCEN 2023
Statics & Structures

- Folding Platform
- Forces on a Truss
- Forces on a Wing

MCEN 2024
Material Science

MCEN 2063
Mechanics of Solids

MCEN 3017 / ECEN 3010
Circuits & Electronics

- Simulink Tutorial

MCEN 3021
Fluid Mechanics

- Colebrook Solver (Moody Chart)
- Pipe Losses
- Draining Tank

MCEN 3022
Heat Transfer

- Modeling Ice Buildup
- Temperature Distribution
- Unsteady Heat Conduction

MCEN 3025
Component Design

MCEN 3030
Computational Methods

- Gauss-Jordan Elimination
- Roots of Nonlinear Equations
- Polynomial Interpolation
- Systems of Differential Equations
- Numerical Integration

MCEN 2043
Dynamics

- Spring-Mass System
- Bouncing Ball
- Bouncing on Oscillating Floor.
- Plotting a Henon map
- Inverted Pendulum

MCEN 4043
System Dynamics

CU Mechanical Engineering

course specific Matlab tutorials



The Matlab Workspace

Matlab, short for 'Matrix Laboratory,' is among the most powerful mathematics programs available for commercial use, particularly for numerical work. Matlab come equipped with a sustantial library for doing most operations you could ever think of and the ability to create your own functions and programs to provide and infintely customizeable mathematics interface. In order to begin using Matlab, we will start with the basics and gradually introduce more complicated topics.

Accessing Help

Perhaps the best place to start is by introducing that infinte source of knowledge, the matlab help library. This can be accessed by pressing the button with a quesion mark at the top of the screen or simply typing 'help' at the command prompt.

>> help
[a long list of help topics follows]

To get more help on a specific topic or function, type 'help' followed by the command.

>> help fft
[a help message on the fft function follows].

The Matlab Environment

The Matlab environment is very similar to a Unix shell if you are familiar with that (and if you are, don't fear) and some commands are the same. It is slightly different than the graphical interface you might be used to, but it can do pretty much anything you might need.

Basic operations such as addition, multiplication are very intuitive and just as you would expect:

>> 4+5

ans = 

     9

>> 3^3

ans = 

     27
	 
>> 2*(2+1)^2

ans = 

     18

>> ans

ans = 

     18

Matlab conveniently stores the answer to the last operation as the variable 'ans' which can be used by like any other variable. If you would ever like to suppress the output of an operation, simply follow the statement with a semicolon. The answer is still stored but the output will not be displayed on the screen.

>> 4+5;
>> ans

ans = 

     9
	 
>> ans+5

ans = 

     14

Now that you know the basics of how matlab works, we can now introduce the next building blocks, vectors!


Click here to go back to the tutorials home page.