chap02 - Chapter 2 MATLAB Fundamentals MATLAB Matrix...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 2 Chapter 2 MATLAB MATLAB Fundamentals Fundamentals
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MATLAB MATLAB Matrix Laboratory Matrix Laboratory
Background image of page 2
Problem-Solving Methodology Problem-Solving Methodology State the problem clearly Describe the Input/Output (I/O) Work the problem by hand Algorithm - Numerical Method Develop a MATLAB Solution Debugging and Testing Documentation
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Why MATLAB? Why MATLAB? Industry standard software application Wealth of built-in functions and libraries Toolboxes (add-on software modules) – image and signal processing, control systems design, fuzzy logic, etc. Has own structured programming language Ease of application and testing (pre- and post- processing without lots of programming and formatting) Platform independent
Background image of page 4
What is MATLAB? What is MATLAB? Both a computer programming language and a software Began as a set of tools to solve linear algebraic equations. Has grown to a complete scientific programming suite Interpretive programming language: Read script files and perform operations; generally not compiled Enhanced calculator / spreadsheet – much more flexible Complete visualization package and post-processing analysis suite
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MATLAB MATLAB MATLAB is a numerical analysis system Can write “programs”, but they are not formally compiled Should still use structured programming Should still use comments Comments are indicated by % ” at the beginning of the line
Background image of page 6
Comments!!! Comments!!! Program Documentation Program Documentation You must include comments in the computer programs you turn in – otherwise we will have great difficulty knowing what you are doing
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
For example, here is some cryptic code without comment for j=0:2 k=(2-j)*(1+3*j)/2 end What does it do? What does it do? Put a comment in Put a comment in % turns (0,1,2) into (1,2,0)
Background image of page 8
MATLAB Windows MATLAB Windows Command Window -- enter commands and data -- print results Graphics Window -- display plots and graphs Edit Window -- create and modify m-files
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Managing MATLAB Environment Managing MATLAB Environment who or whos -- See the current runtime environment clear -- remove all variables from memory clc -- clear the command window clf -- clear the graphics window save -- save the workspace environment load -- restore workspace from a disk file abort -- CTRL-C help -- help “command” Really good “ help ” command
Background image of page 10
MATLAB Syntax MATLAB Syntax No complicated rules Perhaps the most important thing to remember is semicolons (;) at the end of a line to suppress output Type “ more on ” to keep text from leaving screen too fast diary “filename” saves a text record of session diary off turns it off
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MATLAB MATLAB MATLAB’s basic component is a Vector or Matrix Even single value variables (Scalars) All operations are optimized for vector use Loops run slower in MATLAB than in Fortran (not a vector operation) size command gives size of the matrix
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/07/2009 for the course CVEN 302 taught by Professor Edge during the Spring '08 term at Texas A&M.

Page1 / 48

chap02 - Chapter 2 MATLAB Fundamentals MATLAB Matrix...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online