eng6notes - Sec 1 Engineering Problem Solving Horizontal...

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

View Full Document Right Arrow Icon
Sec 1 Engineering Problem Solving Horizontal position: x(t) = vtcos(theta) Vertical position: y(t) = vtsin(theta) – (gt^2)/2 Time: t = 2vsin(theta)/g Sec 2 Technical Computing Environment Area of trapezoid: A = (b1+b2)h/2 Temperature: Tc = 5/9(Tf-32) Special Variables Ans: default variable name Pi: ratio of circle circumference to its diameter Esp: smallest amount by which two numbers can differ Inf: infinity Nan: not a number Date: current date in a character string format Flops: count of floating-point operations Commands Who: lists the names of defined variables Whos: lists the names and sizes of defined variables Clear: clears all variables, resets default values of special variables Clear var: clears variable var Clc: clears the command window, homes the cursor (moves the prompt to the top line), but does no affect variables Clf: clears the current figure and thus clears the graph window More on: enables paging of the output in the command window More off: disables paging of the output in the command window Punctuation Semicolon: suppresses the display of the result Comma: place multiple commands on one line Percent sign: comment Ellipses: indicates the command continues on the next line Functions Abs(x): Absolute value Sign(x): sign, returns -1 if x<0, 0 if x=0, 1 if x>0 Exp(x): Exponential Log(x): natural logarithm Log10(x): logarithm(base 10) Sqrt(x): square root Rem(x,y): remainder of x/y Binary (base 2) form 53 = 00110101 Format Format short: 4 decimal digits Format long: 14 decimal digits Format short/long e: scientific notation Format short/long g; good Format bank: 2 decimal digits Format +: positive, negative, zero Format loose: line space Format compact: no line space Display Disp(variable) Disp(‘string’) Fprintf(‘\nThe temperature is %w.df degrees F\n’, temp) Sec 3 Files and File Management Diary file: saves all text from the matlab session as text in file Save data: stores all workspace values in the file data.mat Disp(ans): display results without identifying variable names Input(‘prompt’): prompt user with text in quotes, accept input until “enter” is typed Keyboard: give control to keyboard temporarily Sec 4 Trigonometry and Complex Numbers Trigonometry Sin(alpha), cos(alpha), tan(alpha) Asin(z), acos(z), atan(z) Complex Numbers J = sqrt(-1), j^2 = -1 Z = x + jy
Background image of page 1

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

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

This note was uploaded on 08/22/2010 for the course ENG 32277 taught by Professor Larrylagerstrom during the Winter '09 term at UC Davis.

Page1 / 3

eng6notes - Sec 1 Engineering Problem Solving Horizontal...

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

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