Statics Notes Day 3

Statics Notes Day 3 - Introduction to MATLAB Learning...

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

View Full Document Right Arrow Icon
Introduction to MATLAB
Background image of page 1

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

View Full DocumentRight Arrow Icon
Learning Objectives familiarity with: MATLAB operations Simple Plotting MATLAB functions, scripts Vectors, Matrices Symbolic Calculations
Background image of page 2
Here is what the MATLAB screen looks like when you start up.
Background image of page 3

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

View Full DocumentRight Arrow Icon
If we generate a vector in the command window it shows up in the workspace window and command history WORKSPACE COMMAND HISTORY
Background image of page 4
we can see the files in the current directory
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 Editor for generating functions, scripts we can bring up an editor window for making new functions or scripts
Background image of page 6
example of generating a plot
Background image of page 7

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

View Full DocumentRight Arrow Icon
MATLAB Built in constants and variables ans most recent answer eps small constant ~ 10 -16 i or j imaginary unit inf infinity pi 3.14159 . .. Standard mathematical operations ± addition, subtraction * multiplication / division ^ exponentiation e.g. y n = y^n Some common functions sin(x) sine cos(x) cosine exp(x) exponential sqrt(x) square root log(x) natural log log10(x) log to base 10 abs(x) absolute value, magnitude of complex quantity angle(x) phase angle real(x) real part of imag(x) imaginary part of
Background image of page 8
Generation of (row) vectors >> x = 0:0.1:0.5 x = 0 0.1000 0.2000 0.3000 0.4000 0.5000 >> y =linspace(0, 0.5, 4) y = 0 0.1667 0.3333 0.5000 >> z = [ 1 2 3 4 5] z = 1 2 3 4 5 Suppression of echoing of output (put semi-colon at end of line) >> z = [ 1 2 3 4 5] ; >> >> z z = 1 2 3 4 5 Comment line >> % This is a comment >>
Background image of page 9

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

View Full DocumentRight Arrow Icon
Vectors in Statics are often 3-D vectors >> Force1 =[ 100 200 300]; >> position = [2, 3, 4]; >> Force2 = [50 100 100]; >> Force1 + Force2 ans = 150 300 400 >> dot(Force1, Force2) ans = 55000 >> cross(position, Force1) ans = 100 -200 100 sum of forces dot product of two force vectors cross product of a position vector with a force vector (requires vectors to be 3-D) 2-D vectors can still be represented as 3-D vectors by adding in a zero in the third dimension >> Force2D = [20 30 0]; >> position2D = [2 4 0]; >> cross(position2D, Force2D) ans = 0 0 -20
Background image of page 10
Functions can have vector (matrix) arguments >> x = [ 1 2 3 4 5]; >> y = exp(x) y = 2.7183 7.3891 20.0855 54.5982 148.4132 Element by element operations on vector-valued functions
Background image of page 11

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

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/01/2011 for the course E M 274 taught by Professor Donaldsturges during the Fall '07 term at Iowa State.

Page1 / 27

Statics Notes Day 3 - Introduction to MATLAB Learning...

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

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