Matlab

# Matlab - min, sum, prod same rule as max 4. MORE ADVANCED...

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

Course Assistant: Hongsong Yuan Email: [email protected] Office Hours: Tuesdays 5:30-7pm room 540-108

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

View Full Document
Topics 1. HOW TO USE HELP 1. BASIC VARIABLE DEFINITION AND ARITHMETICS 1. 1. MORE ADVANCED MATRIX OPERATIONS
Topics 1. CONTROL STRUCTURES 1. WRITING .m FILES 1. GENERATING RANDOM NUMBERS 1. PLOTTING GRAPHS

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

View Full Document
2. BASIC VARIABLE DEFINITION AND ARITHMETICS + addition - subtraction * multiplication / division \ left division ^(caret) power exp() power of the natural basis log() natural logarithm abs() absolute value sqrt() square root sin(), cos(), tan(), cot() trigonometric functions min(,) max(,) minimum, maximum of two numbers
definition use [ ] ‘(apostrophe) transpose + - component-wise .* ./ component-wise * matrix multiplication / A/B=A*(B inverse) .^ component-wise power log, sqrt, sin component-wise max for vectors, the maximum of all components for matrices, maximum of each column

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

View Full Document

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: min, sum, prod same rule as max 4. MORE ADVANCED MATRIX OPERATIONS • rank rank of a matrix • ^ matrix power • inv inverse matrix • norm matrix norm • eig eigenvalues, eigenvectors • jordan Jordan form • svd singular value decomposition • chol Cholesky factorization 5. CONTROL STRUCTURES • if • for • while 6. WRITING .m FILES general forms: • function name (arguments) • function variable = name (arguments) • function [variable1, variable2] = name (arguments) 7. GENERATING RANDOM NUMBERS • rand uniform [0,1] • randn normal(0,1) • link to the pdf, cdf in HELP 8. PLOTTING GRAPHS • plot • fplot • ezplot • plot3 • ezplot3 • meshgrid, mesh Simulating a Markov chain • Flipping a biased coin • number of heads seen by time t = 4 . y probabilit with (Tails) 6 . y probabilit with (Heads) 1 t Z t t Z Z Z N + + + = 2 1 t N...
View Full Document

## This note was uploaded on 02/03/2011 for the course MS&E 221 taught by Professor Ramesh during the Winter '11 term at Stanford.

### Page1 / 11

Matlab - min, sum, prod same rule as max 4. MORE ADVANCED...

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

View Full Document
Ask a homework question - tutors are online