You are on page 1of 4

Symbol

Math

Units

Matlab Rads

Sine
Cosine
Tangent
Secant
Arcsine
Arcosine

Sin(x)
Cos(x)
tan(x)
Sec(x)
Asin(x)
Acos(x)

Rad/degrees
Rad/degrees
Rad/degrees
Rad/degrees
Rad/degrees
Rad/degrees

Sin(x)
Cos(x)
Tan(X)
Sec(x)
Asin(x)
Acos(x)

Symbol
Absolute value
Square root
Cubed root
Factorials
Exponents
Logs
Natural log
Log of base

Math
l-2l
5!
E^5
Log(5)
Ln(5)
Logn(5)

MatLab
Degrees
Sind(x)
Cosd(x)
Tand(x)
Secd(x)
Asind(x)
Acosd(x)

MatLab
Abs(-2)
Sqrt(2)
Nthroot(2,3)
Factorial(5)
Exp(5)
Log10(5)
Log(5)
Logn(5)

Expressions
o Data types (in,float,char) of size (scalar,array)
o Previously created variables
o Operators
o Functions
Operator Precednece (interim)
o BEDMAS
Brackets
Exponents
Unary operators
Division/multiplication
Addition/subtractions
o ALWAYS LEFT TO RIGHT
o And BADMAS
+3/2^2*5-1
+*5-1
*5-1
15/4-1
11/4

Jan 12. 2016

Operator Procedure
o Ex)
-5*3^4*(1-5)+(3/2)
= -5*.75*-4+1.5
Matlab Definitions
o A program is sequence of instructions contained within a file with the
extension .m
o Naming conventions
Use an original name
Something meaningful
o Executing a program
Find the location of the program
Enter the name of the program
o Programs
Elements of a program)
Header
Variables
Initialization
Main
o Section of the actual code
Post-processing
o Section of the code to display to the user
OVER COMMENT
On the exam just do the code otherwise you have no time
EX1
o Create a program which converts the number centimeters in to feet
noting 1in-2.54cm and 12in=1ft
Given the above information:
1. Draw the flowchart to solve this conversion program
2. Write the program
EX2
o Given r and theta, the moment of intertia for a circular sector is
o Ix=(1/4)r4(theta-(1/2)sine(2theta)
o Iy=(1/4)r4(theta+(1/2)sine(2theta)
1. Write the pseudocode
Input r and theta
Calculate Ix and Iy
Output r and theta
2. Write the MATLAB program

EX3

EX4
o

EX5
o

You are asked to order in some sprockets. Each sprocket costs A CAD
each. You are given BC AD to spend how many sprockets can you
buys?
1. Determine the formula
2. Write the MATLAB program
Write a program which solves for a side length of a triangle using the
sine law
Draw a flow chrart
Write the MAtLAB program
A face plate is rotating at w radians/s. a a hole in the plate is initially
located theta degrees above the x-axis at t=0. Determine the final
angle of the hole at tf
W = derivative of theta in respect to t
1. Write the pseudocode
o Input
2. Write the MATLAB program

You might also like