Академический Документы
Профессиональный Документы
Культура Документы
Laboratory Exercise
Matrices
Objectives:
At the end of the exercise, the students should be able to:
Materials:
Procedures:
Using Matrices
1. Write a program that will read an n x n matrix into a two-dimensional array A and then,
determine which, if any, of the following special cases the matrix falls into:
Symmetric:
A[i][j] = A[j][i]
Diagonal:
A[i][j] = 0
Upper Triangular:
A[i][j] = 0
whenever i < j
Lower Triangular:
A[i][j] = 0
whenever i > j
Symmetric sample
1
2
3
2
6
7
3
7
8
4
9
11
5
10
12
4
9
11
13
14
5
10
12
14
15
Diagonal sample
2
5
7
5
4
7
9
7
0
4
0
2
0
8
2
6
0
2
3
1
0
5
1
4
9
0
0
0
0
2
10 Laboratory Exercise 1
*Property of STI
Page 1 of 2
J0007
1
4
8
4
4
2. Make sure that all files are saved in your flash drive.
10 Laboratory Exercise 1
*Property of STI
Page 2 of 2