Midterm Notes

# Midterm Notes - l inspace(x1 x2 g ives 100 evenly spaced...

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

linspace(x1, x2) gives 100 evenly spaced values between x1 and x2 x = linspace(x1, x2) linspace(a, b, n) generate n equally spaced points between a and b x = linspace(a, b, n) logspace(a, b, n) generates a logarithmically equally spaced row vector o x = logspace(a,b,n) logspace(a, b) generates 50 logarithmically equally spaced points o x = logspace(a,b) fzero(function, [a,b]): find real root of an equation. It is a combination of reliable bisection with secant method and inverse quadratic interpolation. fzero(function,xo) xo=initial guess. Does incremental change until it finds a sign change. roots(function)= finds roots of higher order polynomial. Use period to perform element-by-element operations. Transpose matrix A with A’ Trace(A)= sum of diagonal matrix elements. Inv(A)= inverse of matrix A. Aug=[A I] combines matrix A and matrix I to make augmented matrix. To get a new figure, use “figure” A \B is equivalent to inv(A)*B Cond[A]=abs(A)*abs(inv(A)) 1 Logarithmic plots available using semilogx, semilogy and loglog plot (x, y, ‘color symbol line style ’) [L U]=lu(A) Modular Design o Subdivides a system into smaller parts (modules) that can be independently created and then used in different. o Subroutines (function M-files) called by a main program

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

View Full Document
% 100 x x x error Relative new old new × - = Top-Down Design o Or "stepwise refinement". The software design technique which aims to describe functionality at a very high level, then partition it repeatedly into more detailed levels one level at a time until the detail is sufficient to allow coding. (Originated at IBM; grew out of structured programming practices) Structured Programming o Design and coding of programs by top-down methodology that successively breaks problems into smaller, nested subunits. o Deals with how the actual code is developed so that it is easy to understand, correct, and modify Use “feval” for function evaluation subplot ( m, n, p ) breaks the figure window into m by n small figures, select the p-th figure for the current plot Taylor Series Expansion: f(x)= Machine Epsilon: 2.220446049250313e-016. The smallest difference between two numbers that MATLAB can detect. The smallest number that when added to 1 gives a number greater than 1. realmin = 2.225073858507201e-308
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 7

Midterm Notes - l inspace(x1 x2 g ives 100 evenly spaced...

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

View Full Document
Ask a homework question - tutors are online