MATLAB Basic Commands

Basic Commands

Cell Mode

Default Desktop

Integration - Numeric
Integration - Symbolic

Matrix Operations
and Linear Algebra

Plotting

Programming

Regression - Polynomial

Vector Operations

MATLAB is a professional level software package designed to use matrices for a majority of the calculations. It has a robust programming toolbox and has been used to create many industrial applications.

To get help with a particular MATLAB function enter help function name. For example, enter

help abs

At the simplest level, MATLAB is a calculator.

3+4

To use a previously typed line, use the ↑ key and then edit the line as needed. To create a row vector [1 2 3 4] enter

[1,2,3,4]

or use the notation [start:stepsize: end]. For example, enter

[1:2:15]

The colon notation can also be used inside other functions. For example, enter

sin(0:pi/6:pi/2)

To create a table of (x, y) values, first create the x values and then the table of values. Note the use of " .^  " to create the exponent.

x=[-3:1:3]

mytable=[x;x.^2]

To see the table in a vertical orientation use the transpose command " '  ".

mytable'

MATLAB is primarily used in decimal format it does have the ability to use rational numbers. This option can be set using the format command. Compare the following

format rat

4/8

format long

4/8

format short

4/8


 

 

 

Ohlone College home page
Please contact bbradshaw@ohlone.edu
with your questions, comments, and suggestions.
Terms and Conditions of Use & Disclaimer.
Copyright © 2006 Ohlone College. All rights reserved.