Matlab_Basics_FINAL(1)

Matlab_Basics_FINAL(1) - Relational operators <...

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

View Full Document Right Arrow Icon
Matlab Basics Screen Layout Command Window (entering commands) Workspace (tracking variables) Command History (tracking commands) Basic Entering #’s NOTE: when you do not specify a name for a variable, Matlab assumes a name called ‘ans’ Entering #’s w/ ‘;’ Displaying values and text Preferences
Background image of page 1

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

View Full DocumentRight Arrow Icon
Preferences Command Window Short is the default format Commenting >>c=a*(b/12); %Units - inches Ranges >> T=0:0.1:1 >> T=0:1:10 Manually creating an array Note how ‘,’s and ‘;’ are used Specifically identifying array elements Note how the ‘origin’ starts at 1,1 versus 0,0 in Mathcad Clearing screen sections See the ‘Edit’ tab commands to clear any individual section Workspace Command history - Copy & paste - Repeat (double click) Arithmetic operators + - / *
Background image of page 2
^ NOTE: there is an ‘order’ to how programs evaluate… - Anything inside parentheses goes first - Exponentiation is second - Multiplication and division is third…from left to right - Addition and subtraction is fourth…again, from left to right
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Relational operators < <= ++ ~= >= > Logical operators And - & Or - | Not - ~ Functions` Sin(x) sin of x in radians Tan(x) tangent of x in radians Log10(x) common log of x Log(x) natural log of x Exp(x) e^x for x Sqrt(x) square root of x Abs(x) absolute value of x Round(x) round off x to nearest integer Arguments F(arg1,arg2) Known constants pi %pi = 3.1415 Plot Plot(x,y) Commands Clc clears the command window Clear - removes all variables from memory Clear var1 var2 - just clears these specific variables Exist (name) - determines if there is a variable with the name name Quit stops Matlab Who lists all current variables Whos lists all current variables and their size : - used to generate an array , - suppresses elements of an array ; - suppresses screen printing...
View Full Document

This note was uploaded on 12/30/2011 for the course ENG 160 taught by Professor J.alleman during the Fall '11 term at Iowa State.

Page1 / 3

Matlab_Basics_FINAL(1) - Relational operators <...

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

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