{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

03_CM0268_More_Matlab

# 03_CM0268_More_Matlab - More MATLAB Last lecture focussed...

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

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

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

View Full Document
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.
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 .

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

View Full Document
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
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.

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

View Full Document
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 Workspace window lists them and their type and value. Clicking on a Matrix/Array structure brings up an Array Editor which can be useful.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}