Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# MATLAB BASICS

3,452
views

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
3,452
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
251
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. 1 MATLAB ESSENTIALS PHYS100<br /> <br />1.1 BASICS<br />1.1.1 Start and Termination of a MATLAB Session2<br />1.1.2 Desktop Environment2<br />1.1.3 Saving Variables and Command Window Session & Variables8<br />1.1.4Floating-Point (Real) Numbers9<br />1.1.5Additional MATLAB Data Classes10<br />1.2 MATRICES AND VECTORS 1.2.1 Creation of Vectors12<br />1.2.2 Functions to Manipulate Vectors, Matrices, and Arrays15<br />1.2.3 Extract Elements via Subscripts and Colon Operators 16<br />1.2.4Arithmetic Operators 18<br />1.2.5 Relational Operators 21<br />1.2.6Logical Operators 23<br />1.3 FUNCTIONS <br />1.3.1 M Files 25<br />1.3.2 Anonymous Functions 26<br />1.3.3 Passing Functions as Arguments to other Functions27<br />1.4 FLOW CONTROL <br />1.4.1 if-end Expressions 28<br />1.4.2 for Loops29<br />1.4.3 while Loops29 <br />1.5 PLOTS<br />1.5.1 Structure of a MATLAB Plot 31<br />1.5.2 Interactive Plotting31<br />1.5.3 Creation of Simple Plots via Command Line35<br />1.5.4 Generation of Multiple Curves in a Single Plot Frame 35<br />1.5.5 Plots of Functions 36<br />1.5.6 How to Save a Figure 36<br />1.6 TIPS FOR BEGINNERS37<br />1.7 REFERENCES37<br />1 MATLAB BASICS <br />The term MATLAB is an acronym for the phrase MATrix LABoratory, a software product originally created by Cleve Moler in the late 1970s as a user friendly interface to numerical libraries for linear algebra. Unlike Mathematica and Maple, which emphasize the manipulation of symbolic expressions, the focus of MATLAB is computation. The central MATLAB variable is a real-number matrix, and, hence, all numerical results are potentially inexact due to rounding errors which exist at the core of computer arithmetic. However, MATLAB is more than a computer language -- it is an interactive problem solving environment for performing numerical computations. It primary strengths are rapid code prototyping and data manipulation due to its strengths in matrix computations and graphics. It is excellent environment investigating for small and medium scale problems (e.g., Kelley, 2003). Since it is an interpreted language, its primary weakness is its slow execution speed compared to the execution speed of compiled languages such as Fortran and C++. <br />The font convention in these handouts is that my text is typed in 10 pt Sans Serif, but MATLAB commands and responses are typed in bold 10pt Courier font. <br />
• How to Start & Terminate MATLAB Sessions: