Sec # : _
Quiz 2
CS151 Fall 2015
Your Name: _
TAs Name: _
Grade: _ 2 pts (completed Friday afternoon) _ 1 pt (attended lab) _ 7 pts = _ Total
Directions: Circle all that apply
1. Using proper MATLAB syntax, how would you find the cosine of a 47 angle?
a.
CS 151L Fall 2015
Programming Assignment 2
Due: Tuesday, September 8, 2015 at 11:59 PM
For this assignment, you need to email two separate MATLAB scripts called cs151f15assn2a.m
and cs151f15assn2b.m. Be sure to include your name and section number as comm
CS 151L Fall 2015
Programming Assignment 1
Due: Thursday, August 27, 2015 at 11:59 PM
(Submit a MatLab script called cs151f15assn1.m. Please be sure to put your name and
section number in the file for the TAs.)
You have been hired to design a fiberglass s
CS 151L Fall 2015
Programming Assignment 3
Due: Friday, September 18, 2015 at 11:59 PM
For this assignment, you need to submit your MATLAB script called cs151f15assn3.m to learn.
Be sure to include your name and section number as comments in the mfile.
T
Quiz 3
CS151 Fall 2015
Your Name: _ Sec # : _ TAs Name: _
Grade: _ 2 pts (completed Friday afternoon) _ 1 pt (attended lab) _ 7 pts = _ Total
Directions: Circle all answers that apply using the following three matrices.
A = [12 17 3 6], B = [5 8 3; 1 2 3;
Quiz 4
CS151  Fall 2015
Your Name: _ Sec # : _ TAs Name: _
Grade: _ 2 pts (completed Friday afternoon) _ 1 pt (attended lab) _ 7 pts = _ Total
Directions: Circle all answers that are correct using the following matrices:
a=[15, 3, 22, 7; 0, 8, 5, 1; 14,
SECTION # _
Quiz 1
CS151  Fall 2015
Your Name: _
TAs Name: _
Grade: _/2 pts (Completed in class)_/ 1 pts (attended lab) _ /7 pts = _ /10 pts Total
1. When you are about to begin programming for an assignment, what is the first thing you should do?
a. Typ
CS151  Quick Reference #1
1. Environment
1.1. ESC Pod
1.1.1. Open Matlab: Start>All Programs>MATLAB then click on the Matlab icon
1.1.1.1.
Matlab is a serverbased program instead of being installed on each computer.
1.1.1.2.
Because Matlab runs on a s
CS151  Quick Reference #3 (Reference Chapters 2 & 3)
version 1.0.0
1. Special values in MATLAB
1.1. pi represents the number pi (3.1415793.) in MATLAB
CODE Example: area = pi * r^2
1.2. Inf represents infinity in MATLAB; MATLAB will give this as an answe
CS151  Quick Reference #2
1. Using Matlab
1.1. Matlab is casesensitive (ie uppercase and lowercase letters)
1.2. Two most common bugs to look for first:
1.2.1. misspellings
1.2.2. variable reuse (ie using the same variable like x over and over in the sa
CS151  Quick Reference #7 (Reference Chapter 6)
1. UserDefined Functions
1.1. Userdefined functions is the first of the 3 major computer programming concepts that
will be covered this semester: 1) Userdefined functions 2) If statements 3) Recursion
(a
CS151  Quick Reference #8 (Refer to Sections 6.3, 6.4, 7.1 & 7.2)
1. Function Handles
1.1. Function handles are a simple concept. A function handle is like an alias for the function,
instead of stating a big long mathematical function (i.e. equation) ove
CS151  Quick Reference #4 (Reference Chapter 4)
version 1.0.0
1. Operators and functions
1.1. Elementwise (elementbyelement) Revisited; see page 29 in textbook (2nd Edition)
1.1.1. The dot operator (.) is used on multiplication (.*), division (./), an
CS151  Quick Reference #6 (Reference Chapters 4 & 5)
1. Operators and functions
1.1. Using the meshgrid function; see page in textbook: 122 (2nd Edition)
1.1.1. The meshgrid function is used primarily for two reason: 1) help setup matrices to create
3D p
Exam 1 CS 151, Spring 2015
Name: _
TA Name: _ Section # _
No books, no notes, no computer, and no calculators (and, please, do not look at others exams)
I. Fill In (4 pts) 1 point each, write error or nothing is applicable
1. What is the exact value of a
CS ISIL  Summer 2013
Lu mains
Pmnmnung lg mm.yl.mIJtl.m
IunlmwmtmhmpugnlahTAum'pgmhpdu; mamatuft Elnallama!
hmmwmm hmwmmmummumnrmhnk
A ml] racklt is baahm dl In nah wild than mum1 m Ill: want! If
[m Emt MERE. bagma. the In! Ik'l'llbpi n Iiunllim
,_,_u_'_ _ ._._ _._ _._._ _ _ _._._...._....1...n1rW.hheun
Summer 2013  Grading Policy 4 true warmers
_._mgwm. ire\
tutu:
1. tt is the m: mitten3n haw they are aging me this 'checldistf' whether to;
I. Print. write In by hand.
Water is one of New Mexicos scarcest resources and, as a factor which places a rather
lower upperbound on the amount of people who can live here, it has a tremendous impact on
our total economic capacity. There are only three ways of getting it without i
CS 1153 #101
CNM
Summer 2013
Programming in MATLAB: Project 2 Area Approximation
Due Wednesday, July 3rd, 2013 at 11:59pm
The goal of this project is to write a MATLAB function that will take as input a function ( ),
], and a positive integer , and will o
CS 1153 #101
CNM
Summer 2013
Programming in MATLAB: Assignment 10, Part I (5 points)
Due Saturday, July 27th, 2013 at 11:59pm
1. After completing the course evaluations, reply to the email sent to you with the subject
CS 1153 Assignment 10, Part I and wri
%Alicia Montoya
%Date: June 26, 2013
%CS 1153/101
%Inputs: set of data points
%Outputs/displays: a single plot of the input points and the leastsquares
%line for those points
function W = montoyaproj1(D)
k = size(D,1);
%Create a matrix of ones and row 1 (
CS 1153 #101
CNM
Summer 2013
Programming in MATLAB: Assignment 8
Due Thursday, July 18th, 2013 at 5:45pm
1. Write a MATLAB function with the following specifications:
INPUT:
 a string (array of characters)
 a character with value either 'E' or 'D'
OUTPU
%Alicia Montoya
%Date: July 3, 2013
%CS 1153/101
%Inputs: A function f, a 1x2 matrix, and a positive integer n
%Outputs/displays: A plot of the function, and the sum of the area
function W = montoyacs1153p2(f,g,n)
a = g(1,1);
b = g(1,2);
%the sum of all t
CS 1153 #101
CNM
Summer 2013
Programming in MATLAB: Assignment 9
Due Wednesday, July 24th, 2013 at 5:45pm
1. A MATLAB variable called studentdata will be a
structure with the following
fields:
Field
Contents
studentdata.name
Student name as a string
stude
CS 1153 #101
CNM
Summer 2013
Programming in MATLAB: Assignment 4
Due Monday, June 17th, 2013 at 5:45pm
1. Create and a MATLAB function with the following specifications:
INPUTS (in the following order):
 a function
 an integer
 an integer
OUTPUT
( )

CS 1153 #101
CNM
Summer 2013
Programming in MATLAB: Assignment 11
Due Wednesday, July 31st, 2013 at 5:45pm
1. Write a MATLAB script that will do the following.
(a) Use the builtin function polyfit to find the coefficients of the second degree
), ( ), (
)
%Alicia Montoya
%Date: July 17, 2013
%CS 1153/101
%Inputs: A 1xn matrix representing a data set of real numbers
%Outputs/displays: Text displays in the command window
function [] = montoyacs1153p3(x)
sort(x);
fprintf('\n By Alicia Montoya:\n')
%using whil
CS 1153 #101
CNM
Summer 2013
Programming in MATLAB: Assignment 7
Due Wednesday, July 10th, 2013 at 5:45pm
1. Write a MATLAB script with the following specifications:
 Prompt the user to input a nonnegative real number
 If the user inputs a negative numb
%Alicia Montoya
%Date: August 5, 2013
%CS 1153/101
%Inputs: A function f, a 1x2 matrix, and a positive integer n
%Outputs/displays: A plot of the function, the sum of the lengths of the
%lines, and the sum of the areas of the cylindrical shells.
function