Math Assignment 477/577: Solving Systems of Equations and Matrix Operations using Matlab, Assignments of Linear Algebra

A computer assignment for math 477/577 students, which involves setting up a 4x4 matrix, finding sums of rows and columns, solving a system of equations using matlab, writing scripts for matrix operations, and generating graphs of functions. Students are required to use for-loops and the sum function to find column sums of a random square matrix.

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-z51
koofers-user-z51 🇺🇸

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 477/577 Computer Assignment 1
1. Set up a 4 ×4 matrix, and use the function sum to find the sums of the first row and second
column of the matrix.
2. Solve the following system of equations using Matlab:
2x+y+ 5z= 5
2x+ 2y+ 3z= 7
x+ 3y+ 3z= 6 .
Verify your solution by matrix multiplication.
3. Write a simple script to input two square matrices Aand B. Then add, subtract and multiply
them. Comment the script and use disp to output suitable titles.
4. Write a Matlab script to produce graphs of the functions y= cos xand y= cos(x3) in the range
x=4 : 0.02 : 4 using the same axes. Use the Matlab functions xlabel,ylabel and title to
annotate your graphs clearly.
5. Write a function col sum that generates a random square matrix Aof specified size n, and then
finds the sums of each of the columns using
(a) for-loops,
(b) the function sum.
Include a timing comparison. Test the function with n= 10,100,1000.

Partial preview of the text

Download Math Assignment 477/577: Solving Systems of Equations and Matrix Operations using Matlab and more Assignments Linear Algebra in PDF only on Docsity!

Math 477/577 — Computer Assignment 1

  1. Set up a 4 × 4 matrix, and use the function sum to find the sums of the first row and second column of the matrix.
  2. Solve the following system of equations using Matlab:

2 x + y + 5z = 5 2 x + 2y + 3z = 7 x + 3y + 3z = 6.

Verify your solution by matrix multiplication.

  1. Write a simple script to input two square matrices A and B. Then add, subtract and multiply them. Comment the script and use disp to output suitable titles.
  2. Write a Matlab script to produce graphs of the functions y = cos x and y = cos(x^3 ) in the range x = −4 : 0.02 : 4 using the same axes. Use the Matlab functions xlabel, ylabel and title to annotate your graphs clearly.
  3. Write a function col sum that generates a random square matrix A of specified size n, and then finds the sums of each of the columns using (a) for-loops, (b) the function sum. Include a timing comparison. Test the function with n = 10, 100 , 1000.