lecture16_slides

lecture16_slides - Overview of today Today: Review of...

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

View Full Document Right Arrow Icon
Overview of today Today: Review of concepts from last time Matlab environment Loading/viewing data Variables expressions Using matrices in Matlab More on handling matrices Functions for matrices Loops and conditional statements in 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
Matlab scripts expressions.m Example script: expressions.m Open/edit by going to File->Open Run by changing the current directory to the folder with this script and type expressions in the command window.
Background image of page 2
Matlab variables and expressions Variables Variable names must consist of a letter, followed by any number of letters, digits, or underscores, e.g. this_is_ok num28 $chad 1var Matlab doesn’t require variable declarations just initialize and begin using a variable Expressions: combinations of variables, numbers, strings, operators, and functions ; - suppresses output Perl requires $ before all variables, Matlab won’t allow $ in var. names. Perl requires that each line end with ; Matlab accepts with or without.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Matlab variables and expressions Numbers: Strings: Operators + , - , * , /, ^ (a^b = a b ) (more about logical operators later) Functions Perl allows increment operations like $x++; and $x+=1; but Matlab does not. Instead, use x = x+1; Matlab strings are always in single quotes as compared to Perl’s “. expressions.m
Background image of page 4
Matlab built-in functions >> help elfun Elementary math functions. Trigonometric. sin - Sine. sind - Sine of argument in degrees. sinh - Hyperbolic sine. asin - Inverse sine. asind - Inverse sine, result in degrees. asinh - Inverse hyperbolic sine. cos - Cosine. cosd - Cosine of argument in degrees. cosh - Hyperbolic cosine. acos - Inverse cosine. acosd - Inverse cosine, result in degrees. acosh - Inverse hyperbolic cosine. tan - Tangent. tand - Tangent of argument in degrees. tanh - Hyperbolic tangent. atan - Inverse tangent. atand - Inverse tangent, result in degrees. atan2 - Four quadrant inverse tangent. atanh - Inverse hyperbolic tangent. sec - Secant. secd - Secant of argument in degrees. sech - Hyperbolic secant. asec - Inverse secant. asecd - Inverse secant, result in degrees. asech - Inverse hyperbolic secant. csc - Cosecant. cscd - Cosecant of argument in degrees. csch - Hyperbolic cosecant. acsc - Inverse cosecant. acscd - Inverse cosecant, result in degrees. acsch - Inverse hyperbolic cosecant. cot - Cotangent. cotd - Cotangent of argument in degrees. coth - Hyperbolic cotangent. acot - Inverse cotangent. acotd - Inverse cotangent, result in degrees. acoth - Inverse hyperbolic cotangent. Exponential. exp - Exponential. expm1 - Compute exp(x)-1 accurately. log - Natural logarithm. log1p - Compute log(1+x) accurately. log10
Background image of page 5

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

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

This note was uploaded on 10/21/2011 for the course CSCI 3003 taught by Professor Staff during the Spring '08 term at Minnesota.

Page1 / 37

lecture16_slides - Overview of today Today: Review of...

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

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