Vinoo Ganesh
CSE 200 Exam 1 Practice
Vector Example Problem
5. (12 points, 2 each) Let x = [3 2 6 8] and y = [4 1 3 5] (the single quote after both
vectors indicates that they are column vectors). Write the Matlab code to obtain the
results below.
a) Add
CSE 200 (Spring 2013)
Lecture 3
Questions
n Math Review
n Vectors/Matrices
n Colon Notation
n Vector/Matrix Operations
n
Vinoo Ganesh
Class Updates
n Lab
0 Due Today at 11:59 pm.
n Update
n Get
in Participation Quiz Policy
Your CEC Account!
n Groups
#
Wha
function mandel (N,xnum,xmin,xmax,ymin,ymax)
%N = the number of iterations
%xnum = the number of points on the x axis
%xmin, xmax = the minimum and maximum x values
%ymin, ymax = the minimum and maximum y values
ynum = (ymax-ymin)*xnum/(xmax-xmin);
xpts =
function zoom_mandelbrot()
% ZOOM_MANDELBROT Zoom into a
Mandelbrot Set
% Uses the function mandel.m to
produce a Mandelbrot Set
% Allows user to select a region and
zoom into the image
xmin = -2.5;
xmax = 1.5;
ymin = -1.5;
ymax = 1.5;
xnum = 800;
perform
n
k
A
B
= 3;
=4;
= [1 : 1 : n*k];
= reshape (A, n , k);
zr1 = zeros (1,k );
zr2 = zeros (1,n+2);
C = [zr1 ; B ; zr1];
D = C';
E = [zr2 ; D ; zr2];
A = E'
%
function res(A)
[n, k] = size (A)
top = A (1,:);
bottom = A (n,:);
Z = [top ; A ; bottom];
Y = Z';
Application: Are Low Real Interest Rates
Good for the Economy ?
A misleading view of real interest rates is that high real interest
rates are bad because they choke off investment while low real
interest rate are good as they stimulate investment. This vi
> 2+2
ans =
4
> sin(0)
ans =
0
> sin(180)
ans =
-0.8012
> sin(3.1415926)
ans =
5.3590e-008
> sin(pi)
ans =
1.2246e-016
> sin(Pi)
? Undefined function or variable 'Pi'.
%Pop quiz
%MATLAB is case sensitive.
%MATLAB interprets argument to the "sin" function
y = A(1) * 1 + A(2) * x + A(3) * x.^2 + A(4) * x.^3
.
function polyCompute(A,x)
x = zeros
Lab 4:
In class we talked about solving a matrix equation to fit a line to a
collection of points. Today we are going to do the same thing in order
to fit a curve to
CSE 200 (Spring 2013)
Lecture 15
Class Updates
n Matlab Workspaces
n File I/O (Very Brief Introduction)
n Course Evaluation
n
Vinoo Ganesh
Class Updates
n Hope
everyone had a great break!
n Please
turn in your re-grades/re-submissions by
the end of class
CSE 200 (Spring 2013)
Lecture 12
Class Updates
n Examples
n
Vinoo Ganesh
Class Updates
n Your
exam date has been finalized for:
Monday, March 4th from 4:00 5:30 pm
Location:
Adamakos Liu inclusive: Wilson 214
Lockwood - Zishka inclusive: Whitaker 100
n Ex
CSE 200 (Spring 2013)
Lecture 14
Class Updates
n Presentation by Dr. Chamberlain
n Midterm 1
n
Vinoo Ganesh
Class Updates
n No
Lab on Friday
#
Presentation by Dr. Chamberlain
#
Midterm 1
#
Midterm Stats
n Average:
77.10%
n Median: 79.1%
n Standard Deviati
CSE 200 (Spring 2013)
Lecture 5
Questions
n Strings Review
n Syms and Booleans
n Trig
n Decision Making
n
Vinoo Ganesh
Class Updates
n EIT
Update
Matlab no longer available on remote desktop
n How
is Lab 1 going?
Make sure you refresh the page every tim
CSE 200 (Spring 2013)
Lecture 16
Class Updates
n Course Evals Summary Part 1
n Plotting (2D)
n
Vinoo Ganesh
Class Updates
n Re-Submission
Grades are on Blackboard
n If
you havent already, you may pick up your resubmission/re-grades after class today.
#
Co
CSE 200 (Spring 2013)
Lecture 6
Questions
n Lab 1 Questions
n Boolean Math
n Disp
n Cylindrical/Spherical Coordinates
n Decision Making
Vinoo Ganesh
n
Class Updates
n Lab
1 due tonight at 11:59 pm CST
Make sure all of your submission information is corre
CSE 200 (Spring 2013)
Lecture 4
Questions
n Math Review (Part 2)
n Colon Notation Review
n Matrices
n Strings
n
Vinoo Ganesh
Class Updates
n Participation
Fridays Lab
n Lab
Quiz will be graded and available on
1 is now assigned!
n Good
way to take notes:
CSE 200 (Spring 2013)
Lecture 2
Questions
n The Matlab Environment
n Variables
n Matlab as a Calculator
n Functions
n Example
Vinoo Ganesh
n
Orders of Business
n Lab
0 is up! You can find it on the Labs portion of
the website. It is due on Wednesday, Janu
CSE 200 (Spring 2013)
Lecture 7
Class Updates
n Cylindrical Coordinates/Spherical Coordinates
n For Loops
n While Loops
n Switch Statements
n Brief Functions
Vinoo Ganesh
n
Class Updates
n Lab
1 was due on Monday
TAs will start grading those and they wil
CSE 200 (Spring 2013)
Lecture 8
Class Updates
n Quiz 3
n For Loops
n While Loops
n
Vinoo Ganesh
Class Updates
n All
Lab 1s have been graded and uploaded to
blackboard
You should have gotten an email with your Lab 1 score from
one of the class TAs.
If fo
CSE 200 (Spring 2013)
Lecture 10
Class Updates
n Exam Info
n Demo
n is-functions
n Memory management in Matlab
n
Vinoo Ganesh
Class Updates
n Make
sure you finish and submit Lab 2 by 11:59 pm
on Wednesday.
Your SHOULD receive a confirmation email indicat
CSE 200 (Spring 2013)
Lecture 9
Class Updates
n Converting For/While Loops
n Switch
n Data Input
n Data Output
n
Vinoo Ganesh
Class Updates
n Get
started on Lab 2!
n Today,
will be one of the quicker days. I will be
moving through material relatively quic
CSE 200 (Spring 2013)
Lecture 11
Class Updates
n Functions (with multiple return types)
n Rounding
n Examples
n
Vinoo Ganesh
Class Updates
n Lab
2 is due today by 11:59 pm CST!
n Your
exam date has been finalized for:
Monday, March 4th from 4:00 5:30 pm
L
> 2+2
ans =
4
> sin(0)
ans =
0
> sin(180)
ans =
-0.8012
> sin(3.1415926)
ans =
5.3590e-008
> sin(pi)
ans =
1.2246e-016
> sin(Pi)
? Undefined function or variable 'Pi'.
%Pop quiz
%MATLAB is case sensitive.
%MATLAB interprets argument to the "sin" function