Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
6.1
Which of the following is an example of a price celling or price cap? A regulation requires
cable service to be provided for no more than $30 a month. Price cap is a government
regulation that places an upper limit on the price at which a particular g
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 5
Matrix Operations
Most regular arithmetics operations work for
matrices and vector same way
You can add two matrices (or vectors)
You can multiply them, too
As long as they can be added
Matrix and vector multiplicati
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 6.
Input Output
All programs need some form of input output
We have seen some rudimentary kinds of both
Need to input data
From the keyboard (mainly for testing/debugging)
From files
Spreasheet files
Other programs
Mat
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 7.
Plotting
Matlab has many plotting commands
The vanila version (plot) accepts 2 arguments: the X
coordinate and the Y coordinate
Accepts a string of specifiers:
rgb for red, green, blue
cmyk for cyan, magenda, yellow
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 9.
Conditional execution
We often want our program to decide whether to
execute one command or another (or none)
The absolute value of a real number x is x if positive
and x if negative
Matlab (like any other language
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 2
Using Variables
The simplest use for Matlab is to play with
formulas
We can use it as a very advanced calculator
No input, no output, just a simple program
Mainly need variables, assignments, builtin
function calls,
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 7.
The save and load Commands
Matlab allows one to save matrices and retrieve
them
Typically used to load data collected and save
the result of a computation to publish, or use
elsewhere
Can be saved in either machine
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Electrical Engineering and Computer Science
CSE 1560
Sample Midterm
Mon. Feb 8, 2016
Answer all questions in the space provided
Make sure that you have 4 pages
Student Last Name: _
Student Given Name: _
Student Id. No: _
Question
A
B
Value
40
60
1
Score
Q
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
York University
EECS 1560
Week of March 13, 2017
Lab #6
1
Basic 2dimensional array manipulations
100 students are taking a course. Each student is graded on six pieces of work during the course.
The instructor stores the grades in a 1007 array called gra
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
York University
EECS 1560
Week of February 13, 2017
Lab #4
1
Working with Vectors
Many functions defined on numbers are applied elementwise if they are given an array of numbers
as an argument. For example, if x = [1 4 9 16], then sqrt(x) returns the arr
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
York University
EECS 1560
January 30, 2017
Lab #3
1
If Statements: Finding the Maximum
Recall that in class we found the maximum value of the cosine function on the interval [a, b]
as follows.
if floor(a/(2*pi) < floor(b/(2*pi)
fprintf(The maximum value i
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
York University
EECS 1560
Week of March 20, 2017
Lab #7
1
More TwoDimensional Arrays
(a) Suppose we have an n 1 vector that lists the grades of n students on one test. We are
interested in finding how students performed relative to the class average.
For
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
York University
EECS 1560
January 16, 2017
Lab #2
1
Defining Your Own Function
Recall the quadratic
formula: the two values of x that satisfy the equation ax2 + bx + c = 0 are
2
b 4ac
given by b 2a
. We shall use it to solve some quadratic equations.
(a)
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
York University
EECS 1560
January 9, 2017
Lab #1
1
Getting Started
Find a free computer.
If the screen is dark, press a key. If the screen remains dark, press the power button
on the computer to turn it on.
There should be a message on the screen to pr
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
York University
EECS 1560
Week of February 27, 2017
Lab #5
1
Using Vectors
(a) If A is a vector of numbers, what does A = A + 5*(mod(A,2) = 1) do? How does it work?
(b) Use the zeros function to create a row vector of 100 0s.
(c) Use the rand function to
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
MECHANICS OF DEFORMABLE BODIES
Summary of Notes
CHAPTER 10: ENERGY METHODS
EXTERNAL WORK AND STRAIN ENERGY
External Work and Strain Energy
Deflection of joints on a truss or points on a beam
Energy methods.
Work is caused by an external force and c
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
MECHANICS OF DEFORMABLE
BODIES
Summary of Notes
MECHANICS OF DEFORMABLE
BODIES
CHAPTER 1: STRESS, STRAIN AND
MECHANICAL PROP. OF MATERIALS
MECHANICS OF DEFORMABLE BODIES
MECHANICS OF DEFORMABLE BODIES
MECHANICS OF DEFORMABLE BODIES
1.
2.
3.
4.
5.
6.
7
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 4
Creating Matrices
Matrices can be created like arrays.
We can specify all the elements explicitly arranged
in rows
A = [1 2 3; 4 5 6; 7 8 9]
We can specify them implicitly
A = [1:3; 4:6; 7:9]
(colons can be replaced
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 3
Working directory
Matlab, like most other software has a current
working directory, aka current folder
Most operations on files (read, write) assume
that the file is in the working directory
Can be changed easily usi
CS 310 Spring 2016
2016 Beck Hasti
Sample Questions for Exam 1
The following are meant to give you some examples of questions that might be asked on the first
exam. The sample exam questions do not represent the length or difficulty of the actual exam. T
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2015
Name: _
Student #: _ Section: _
York University
Faculty of Science and Engineering
Department of Computer Science and Engineering
CSE1520.03  Computer Use: Fundamentals
Fall 2005 Final Examination
Tuesday, December 20, 2005
Instructions:
1.
York Universi
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2015
Summer 2009 CSE 1520A
Test #2
SOLUTIONS
Part A: True/False  WRITE the entire word for full marks. [10 Marks]
Blue = TRUE and Black = FALSE
1. _ A cell in a spreadsheet can contain only raw data.
2. _ The sum of two binary digits (ignoring the carry) is e
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 10.
Other forms of ifelseend
Ifelseif.elseifelseend
Switchcase
Not necessary but convenient
The for loop
One of the most common loops
Especially for numerical computations
There similar thing in practically eve
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Final exam 5/11/2011
Name: _
Sample: CDS130 Final exam (PART I)
The final exam consists of two sections. The first section is a closedbook paper exam
(60 minutes); and the second section involves use of Matlab on the computer (75
minutes). The following
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 18
3D Surfaces
To plot a surface we have to
Create the 2D structure
Map the 2D structure to 3D
We can plot with
Mesh
Surf
Meshz (create a curtain around the plot)
Surfc, meshc (with contours under it)
Surfl (with l
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 13.
Remember, Remember
th
the 5 of November
Matlab also has anonymous functions
Nothing to do with the Anonymous group
These are simple functions defined on the fly
Usually for one time use or for passing as
arguments
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2016
Computing for Math and Stats
Lecture 12.
Computing with Loops
Loops are used to do repetitive things
Some of them involve doing the same thing on
many different elements of an array
Often these can be done with Matlab's array
operations
Some of them invol
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
MECHANICS OF DEFORMABLE BODIES
Summary of Notes
CHAPTER 4: BENDING
BENDING
The deck of this bridge has been designed on the basis of its ability to
resist bending stress.
SHEAR AND MOMENT DIAGRAMS (Reminder)
Beams develop an internal shear force and
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
MECHANICS OF DEFORMABLE BODIES
Summary of Notes
CHAPTER 2: AXIAL LOAD
SAINTVENANTS PRINCIPLE
SaintVenants Principle:
Notice how the localized deformation that occurs at each end tends to
even out and become uniform throughout the midsection of the
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
MECHANICS OF DEFORMABLE BODIES
Summary of Notes
CHAPTER 8: DEFLECTION OF BEAMS
AND SHAFTS
DEFLECTION OF BEAMS AND SHAFTS
DEFLECTION OF BEAMS AND SHAFTS
Deflection of Beams and Shafts
The amount of deflection a beam may undergo when it is subjected t
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
MECHANICS OF DEFORMABLE BODIES
Summary of Notes
CHAPTER 9: BUCKLING OF COLUMNS
BUCKLING OF COLUMNS
Behavior of columns and indicate some of the
methods used for their design.
General discussion of buckling,
Determination of the axial load needed to
Introduction to Computing for Mathematics and Statistics
EECS 1560

Winter 2014
MECHANICS OF DEFORMABLE BODIES
Summary of Notes
CHAPTER 5: SHEAR
SHEAR IN STRAIGHT MEMBERS
SHEAR IN STRAIGHT MEMBERS
Shear in Straight Members:
A beam will support both shear and moment.
The shear V is the result of a transverse shearstress distri