powerpoint

advertisement
CIS 101: Computer Programming
and Problem Solving
Usman Roshan
Department of Computer Science
NJIT
Syllabus
• Office hours:
• Course website:
– http://www.cs.njit.edu/usman/courses/cis101_spring06
– Course powerpoint presentations and announcements will be
posted on website
• Course description: Learn MATLAB and use it to solve
engineering and scientific problems
• Exams: Short in-class quizzes and one final
• Homeworks: Problems assigned every week
• Cheating policy: No cheating will be tolerated
• Makeup exams: Only health related documented
excuses will be accepted
About this course
• Mainly focused around MATLAB
• We will take engineering and scientific
problems and solve them using MATLAB
• Our focus is not to derive formulas but to
learn how to program and solve problems
using programming
• We may learn some C++ if time permits
but MATLAB itself offers a lot to explore
Starting Matlab
MATLAB startup window
Description of windows
Help Window
Help Window: Very Useful!
Working in Command Window
Using MATLAB as a calculator
Using MATLAB as a calculator II
Displaying formats
Basic Math Functions
Elementary functions
Trigonometric functions
Basic Math Functions II
Example: using sqrt function
Rounding functions
Defining variables in MATLAB
Variable_name = A numerical value, or a computable expression
Example 1
Example 2
Defining variables in MATLAB II
Example 1
Example 2
Example 3
Example 4
Defining variables in MATLAB II
Example 1
Example 2
Problem Solving I
Verify that the indentity shown
is correct by calculating
each side of the equation using

x
5
x tan x sin x
cos

2
2 tan x
2
Problem Solving II
R1=16mm, R2=6.5mm,
R3=12mm, R4=9.5mm
Find distance between
C2 and C4
Problem Solving II
(C2 C3 ) 2  (C1C2 ) 2  (C1C3 ) 2  2(C1C2 )(C1C3 ) cos 1
Problem Solving III
To=Initial temperature of object at time t=0
Ts=temperature of chamber object is placed into
T=temperature of object at time t
k=constant
Temperature of object rises according to function shown
below
 kt
T  TS  (T0  TS )e
If a soda can (from inside a hot car) at 120F is placed into a
refrigerator with 38F hat is the temperature after 3 hours
(k=0.45)?
Problem Solving III
Now we go to the lab!!
Download