# Lab 6 - ECOR 2606 - Lab #6 Part 1: Examine and execute the...

This preview shows pages 1–2. Sign up to view the full content.

ECOR 2606 - Lab #6 Part 1: Examine and execute the supplied script file (part0.m). The first part of this script is shown below: maxN = 5; fullA = rand(maxN, maxN) fullB = rand(maxN ,1) A = fullA (1 : 2, 1: 2) b = fullB (1 : 2) tic; x = A\b; t = toc; fprintf ( 'The time required for two equations was %f\n' , t); The script begins by creating a random 5 by 5 matrix of co-efficient values and a random 5 by 1 column vector of right hand side values. It then creates a 2 by 2 system by selecting the upper left corner of the matrix and the top part of the column vector, solves this system, and outputs the amount of time (in seconds) that it took to solve the system. Function tic starts a timer and function toc stops this timer and returns the elapsed time in seconds. The script then goes on to do the same thing for a 3 by 3 system. It could have continued with 4 by 4 and 5 by 5 systems, but this would have been tedious. You should get the idea. You are to produce a script file (part1.m) that implements the same basic idea on a much larger

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This document was uploaded on 04/14/2010.

### Page1 / 2

Lab 6 - ECOR 2606 - Lab #6 Part 1: Examine and execute the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online