1
Lab 3: Files and while loops
September 23rd & 24th, 2010
Objectives:
To become familiar with writing to and reading from files
To become familiar with using simple while loops
Part 1: Reading from a
Lab 12: We Heart Matlab!
Thurs., Fri., Dec. 1, 2
In this lab, we are going to practice accessing matrices and performing matrix operations.
We will also practice comparing vectors, printing informatio
Lab 11: We Heart Matlab!
Mon., Tues., Wed., Fri. Nov. 30, Dec. 1, 2, 4
In this lab, we are going to practice accessing matrices and performing matrix operations.
We will also practice comparing vector
Lab 13: More Matlab
Engineering 101; Dec 9, 10
Task 1: C+ to Matlab
Convert the following C+ code into Matlab in a script file called task1.m:
int labNumber = 0;
bool lastLab = false;
while(!lastLab)
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
int main() cfw_
ofstream outfile("graph.txt");
int i, j;
for (i = 10; i >= 0; i = i - 1) cfw_
for (j = 0; j <= 20; j+
#include <iostream>
#include <fstream>
#include cmath
using namespace std;
int main() cfw_
ofstream outfile("graph.txt");
int i;
for (i = 10; i >= 0; i = i - 1) cfw_
for (j = 0; j <= 20; j+) cfw
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "sort.h"
using namespace std;
/* REQUIRED FUNCTIONS */
/* This procedure will sort the values of the three input vec
%This function takes an image and runs a moving average filter of with a
%window size of windowLength*windowLength, where windowLength is an odd
%integer >= 1. The function will average all the elemen
% This function flips the image along the vertical axis, essentially giving
% the effect of it being a 'mirror image'.
function filteredImage = mirrorFilter(inputImage)
imageSize = size(inputImage
% This function is a simple edge detection filter where the filter
% traverses the image matrix and compares the each value to the value to
% the right and the value below it. if the absolute value of
%This function is a threshold filter for the image by taking in an input
%image as well as a threshold. If the value of an element of an image is
%less than the threshold, the new image's value become
%This function effectively takes the negative of a black and white image.
%Effectively, black becomes white and white becomes back. The grayscale
%image contains values from 0 to 255; So a value of 0
Lab 11: Matlab Basics
After this lab, you should be able to:
Use the Matlab text editor to create m-files (scripts and functions)
Understand the key components of a Matlab function, including the fu
ENGR 101
Lab 10 Introduction to Matlab:
Launching Matlab
Open up a terminal window.
To launch Matlab simply type into the Terminal:
% matlab &
Youll see a small Matlab splash screen and within a minut
Lab 4
(Mon Sep 27-Wed Sep 29 Lectures)
Task 1: Displaying a Students Letter Grade
In this task you will use selection to allow a student to enter their numerical exam grade
and receive the correspondi
Engineering 101
Fall 2010, Sections 100-200
Lab 5 (October 7-8, 2010)
Part A: Understanding how random numbers work in C+
Exercise (i):
Compile the following program, and execute it three times separa
L ab 6: Binary Numbers and Character Manipulation
T ask 1a:
One method in which to find the number of digits in a decimal (base 10) number
is to divide the number by ten and keep dividing the resultin
Lab 7 (Thursday Oct 21 and Friday Oct 22)
Debugging Syntactical and Semantic Errors
Congratulations on your stellar performance in this class so far! Your instructor
ha