CS 221 Fall 2016
Lab 3 Weather Balloon Altitude
Learning Objectives:
- Solving a problem in Excel using an algorithmic solution
- Use of VLOOKUP() and conditional formatting
- Use of a Chart to displa
CS 221 Fall 2016
Project 2
Due in CSPORTAL on Nov. 18
General Description:
A set of 20 windmills on a wind farm generates power for a particular location. The amount produced by
each mill is measured
CS 221 Fall 2016
Supplemental Notes for Sept. 13
VLOOKUP() Excel Function:
Purpose: to lookup a value from a table.
General Syntax: VLOOKUP(LookupValue, inTable, resultColumnNumber, approximateMatch?
Designing, Writing and Testing a Matlab Function
Definition: a function is a set of instructions which is not an entire program, but is only part of a
program. A function has:
- A name (which should d
%John Martin Section 10
clear
amount = input('Enter the amount won/lost for the race');
i = 1
while amount ~=0
data(i,1)= amount;
bet = input('amount bet');
data(i,2) = bet;
data(i,3) = (data(i,
function [ value ] = L_10(matrix_1,matrix_2)
[row1, column1]= size(matrix_1);
[row2, column2]= size(matrix_2);
if row1 = column1
fprintf('matrix_1 is a square matrix, can calculate determinant a
%Function Name: A4_Function
%Description: This function returns the output of the getoption, or in my case, A4_Function.
%Output Variable: option
function [ option ] = A4_Function( )
%UNTITLED Summary
CS 221 Fall 2016
Notes: First Matlab statements
Oct 11
Assignment Statement:
Purpose:
to assign (set or change) the current value of a variable, and to allocate (create) the variable if it
doesnt alre
CS 221 Fall 2016
Project 1: Excel Pipe Expansion
Version 3: ALT-ENTER not CTRL-ENTER 9/22 2:00pm
Due October 6, 100 points
General Description:
The length of pipes increases and decreases with tempera
CS 221 Fall 2016
Practice: Lab Test 1
Rules for Lab Tests:
- You should complete the test without help from anyone, and without communication with
anyone, except your TA/proctor.
- No use of cell phon
Sierra Shepherd - Section 006
2-Day Weather Balloon Altitude
MaximumAltitude (m):
17752.48
Time of Max Altitude:
6:00 PM
Hours
Altitude (m) Velocity (m/s) Max Alt. Time
0
220.00
1.14
12:00 AM
1
3951.8
CS 221 Fall 2015
Lab 7: Summation
Given: Nov 3
Due: Nov 10
Learning Objectives:
- Writing and testing a function
- Use of a FOR loop to solve a problem
- Use of a Sentinel-Controlled WHILE loop to con
Matlab For Loops
Counter-Controlled Loops:
Often in programming, some code needs to be executed a known number of times (ex: repeat 8 times,
repeat 12 times). We also often need a variable with a valu
CS 221 Fall 2015
Lab 6: Radioactive Decay
Given: Oct 27
Due: Nov 3
General Description:
The half life of a radioactive isotope is defined as the time needed for the mass of a quantity of the
isotope t
Matrices (aka Arrays)
Creating matrices: specifying each element of the matrix
Weve already seen how to easily construct matrices by specifying every element of the matrix:
A = [28, 37, -2, 15];
B = [
CS 221 Fall 2016
Matlab: Cannon Ball in Discrete Steps
General Description:
In chapter 1 of your book, there is a discussion of using MATLAB to calculate the height and distance at a
particular time o
Machine Representation of Floating Point Numbers
Step by Step
Problem Statement 1:
Show how -57.25 might be represented in a computer, using an 8-bit signed Mantissa and a 6-bit
Exponent (Exponents ar
CS 221 Fall 2016
Lab 4 Matlab: Concrete Cores
General Description:
Write a Matlab script that prompts the user to enter the diameter and length of a concrete core (a
cylinder), calculates the volume a
%John Martin
%11/21/14
% Function name: deflection
% Description: This function gives the output of the deflection of the beam.
% Input variables: x is passed into the function
% Output variables: the