03_CM0268_More_Matlab

03_CM0268_More_Matlab - More MATLAB Last lecture focussed...

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

View Full Document Right Arrow Icon
CM0268 MATLAB DSP GRAPHICS 1 68 JJ II J I Back Close More MATLAB Last lecture focussed on MATLAB Matrices (Arrays) and vectors which are fundamental to how MATLAB operates in its key application areas — including Multimedia data processing We continue our brief overview of MATLAB by looking at some other areas: Basic programming and essential MATLAB MATLAB data and system management
Background image of page 1

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

View Full DocumentRight Arrow Icon
CM0268 MATLAB DSP GRAPHICS 1 69 JJ II J I Back Close MATLAB Statements and expressions We have already met some simple expressions with MATLAB matrices but let’s formalise things: MATLAB is an expression language; the expressions you type are interpreted and evaluated. MATLAB statements are usually of the form: variable = expression , or simply: expression Expressions are usually composed from operators, functions, and variable names. Evaluation of the expression produces a matrix, which is assigned to the variable for future use and/or is then displayed on the screen . If the variable name and = sign are omitted, a variable ans (for answer) is automatically created to which the result is assigned.
Background image of page 2
CM0268 MATLAB DSP GRAPHICS 1 70 JJ II J I Back Close Important Note: MATLAB is case-sensitive MATLAB is case-sensitive in the names of commands, functions, and variables. For example, IM is not the same as im .
Background image of page 3

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

View Full DocumentRight Arrow Icon
CM0268 MATLAB DSP GRAPHICS 1 71 JJ II J I Back Close Statement Termination A statement is normally terminated with the carriage return . A statement can be continued to the next line with three or more periods followed by a carriage return. >> A = 3 + . .. 4 A = 7 On the other hand, several statements can be placed on a single line if separated by commas or semicolons. >> A= 3 + 4; B = 2 * A; C = B + A C = 21
Background image of page 4
CM0268 MATLAB DSP GRAPHICS 1 72 JJ II J I Back Close Statement Termination (cont.) If the last character of a statement is a semicolon , the printing is suppressed, but the assignment is carried out. Recall: This is essential in suppressing unwanted printing of intermediate results. Unwanted printing to the command window significantly slows down MATLAB processing: Useful for debugging Avoid in intensive loops/recursion etc. when not debugging.
Background image of page 5

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

View Full DocumentRight Arrow Icon
CM0268 MATLAB DSP GRAPHICS 1 73 JJ II J I Back Close MATLAB Variable Spaces You can find out what variables exist in you program in two ways: The command who (or whos ) will list the variables currently in the workspace. The MATLAB IDE
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/24/2012 for the course CM 0268 taught by Professor Davidmarshall during the Winter '11 term at Cardiff University.

Page1 / 25

03_CM0268_More_Matlab - More MATLAB Last lecture focussed...

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

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