Matlab assignment, MATLAB in Engineering

Assignment Help:
1. Write a MATLAB function (upperTriangle) using the functions you previously created to convert a matrix to upper triangular form. Start with row 1, column1. Find the row that has the largest absolute value in the current column (you have a function that will do that). If the row is not your working row, swap rows (you have a function that will do that). Calculate a factor that you can use to form a linear combination with your working row to zero the value in the column below your working row. Use that factor and the linear combination of rows to zero the first column below your working row (you have a function that will do that). Continue down that column until you reach the last row. All the values in your working column below your working row should be zero. Move to the next diagonal position (down 1 row over 1 column) and repeat the process. Continue the process moving down the diagonal until you reach the last row. You matrix should be in upper triangular form.

Your function should be written to handle matrices of any size. Test your function with matrices of different sizes for which you know the solution to ensure that your function works correctly.

Use variable names that relate to their function and include comments that explain your program logic.

Do not use any built-in MATLAB functions except size(), input(), and zeros().


2. Modify the function in problem 1 (call the new function determ) to calculate the determinant of a square matrix. Recall that the determinant of an upper triangular matrix is the product of the diagonal elements. However, when creating an upper triangular matrix, each time a row is swapped, the determinant changes sign.

Related Discussions:- Matlab assignment

Matrix multiplication, Matrix Multiplication: The Matrix multiplicatio...

Matrix Multiplication: The Matrix multiplication does not mean multiplying term by term; and it is not an array operation. The Matrix multiplication has a very particular mean

Changing case, Changing Case: The MATLAB has two functions which conve...

Changing Case: The MATLAB has two functions which convert strings to all uppercase letters, or all lowercase, known as the upper and lower. >> mystring = 'AbCDEfgh';

Illustration of sorting strings, Illustration of Sorting strings: To s...

Illustration of Sorting strings: To sort on the rows rather than second dimension should be specified. >> sort(words,2) ans = Hello Hdowy Hi Gbdeo

Storing strings in cell arrays, Storing Strings in Cell Arrays: The on...

Storing Strings in Cell Arrays: The one good application of a cell array is to store strings of various lengths. As cell arrays can store various types of values in the elemen

True color matrice - image processing, True color matrice: The true co...

True color matrice: The true color matrices are the other way to represent images. The true color matrices are 3-dimensional matrices. The first two coordinates are the coordi

Finding a sting - function strfind, Finding a sting - function strfind: ...

Finding a sting - function strfind: The function strfind does necessarily similar thing, except that the order of the arguments does make dissimilarity. The common form is str

Technique is to create one element - vector, Technique is to create one ele...

Technique is to create one element - vector: Technique is to create one element with the values from one structure, and use repmat to replicate it to the preferred size. Then,

Initializing the data structure - function, Initializing the data structure...

Initializing the data structure - Function: Function is shown as:   >> printcylvols(cyls) Cylinder x has a volume of 169.6 Cylinder a has a volume of 100.5

Creating a cell array - assign values to array, Creating a cell array: ...

Creating a cell array: The other method of creating a cell array is easy to assign values to particular array elements and build it up element by element. Though, as explained

Built-in colormaps - image processing, Built-in colormaps: The MATLAB ...

Built-in colormaps: The MATLAB has numerous built-in colormaps which are named; the reference page on colormap shows them. Calling the function colormap without passing any ar

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd