Computer Solution of Engineering Problems


Matlab Example Programs and Utilities

Sort by: Name | Most recent

ascii_art.m
ASCII art example

base_conversion.m
Convert a number from one base to another
Supports decimals, bases up to 36, only positive numbers

bounce.m
Bouncing ball game
A good example of animation and real-time user interaction

cell_extract.m

center_mass_image.m
Compute the center of mass of an image
by treating each pixel as a point mass

coulomb.m
Electric forces in a system of particles - Coulomb's Law

create_animation.m
Example of creating a movie (avi) file from a series of plots

dictionary_read.m
Example of reading a ~500,000 word dictionary into Matlab
This example loads all words into a cell array and keeps a track of
the count of the lengths and displays all words over 20 characters long

digitize.m
Example of reading an image, rotating it, and digitizing data from it.

ef_shooter_gui.m
Engage golf ball gun analysis/simulator
A GUI for setting parameters and displaying results of a 'shooter'

file_text_table.m
Example of creating a text file with a table of data

gpa2.m
GPA calculator example
reads and writes text data files

image_cropper.m
Interactive image cropping
Prompts user for a file name of a file that contains one or more
images that are to be rotated and cropped. The user then clicks on the
corners of the images and Matlab extracts, rotates, crops, and
saves the sub-image(s).

image_edge_detect.m
Image processing edge detection example
Compares different algorithms

image_marker_example.m

image_trans.m

image_transparency.m
Image transparency example
Shows how to use and make a transparency matrix with an image

imagemenu.m
Image menu example
Shows a set of images and allows the user to select one

kick3d.m
Demo of how to show a 3D trajectory on an image

mario2.m

matrix_growth_times.m

menuplus.m

movieread.m
Example of reading a movie (AVI) file
Displays a montage of individual frames in a figure window
and creates a file with a montage of frames and displays the file

optimization_trough.m
Solution to a trough optimization problem
Includes surface and parameter plotting

physics_block_on_incline.m
A general solution for a box on incline with force and friction
Has routines for drawing straight and curved vectors

plot_date_scale.m
Example of creating a plot with time of day on the x axis

polystring.m
Function to format a polynomial coefficient list as an equation text

projectile2003.m
Projectile motion with a target and drag - example from EF 102 2003

quakeplot.m
Example of importing data and plotting

rockytop2.m
Example of playing a song
Parses a text string of 'notes' and plays the song by generating the appropriate
frequency curves. Minimal documentation.

send_email.m

simpson.m
Approximate integral using composite simpson rule
http://en.wikipedia.org/wiki/Simpson's_rule

simulation_hibbler_12_19.m
Simulation of a car 'crash' with extensive plotting

sound_fader.m
Demonstrate playing a music file with a fade in and out

space_invaders.m
Simple space invaders game
Example of simple real-time user interaction
Ugly code with minimal comments

switcher.m
Example of using a switch statement with a menu

temperature_from_web.m

text_bottles.m
Example of working with text
Displays the complete lyrics to '99 bottles of beer...'

text_placement_example.m
Example of centering text in a figure

timer_demo.m
Example of using a timer to simulate a clock ticking

truss_wrs.m
A large truss analysis program with many different examples
Creates plots of geometry, results, FBDs, and equations

vector_drawing.m
Example of a generalized function for drawing a vector
Uses a structure for specifying parameters

webpage_create.m
Example of how to create a web page with Matlab output
Has functions for putting tables, text, titles, and images on the page