Solve a linear system of equations

Assignment Help MATLAB Programming
Reference no: EM13927308

Function [x] = gaussel(A,b)

% [x] = gaussel(A,b)
%
% This subroutine will perform Gaussian elimination
% and back substitution to solve the system Ax = b.
% INPUT : A - matrix for the left hand side.
% b - vector for the right hand side
%
% OUTPUT : x - the solution vector.
N = max(size(A));
% Perform Gaussian Elimination
for j=2:N,
fori=j:N,
m = A(i,j-1)/A(j-1,j-1);
A(i,:) = A(i,:) - A(j-1,:)*m;
b(i) = b(i) - m*b(j-1);
end
end
% Perform back substitution
x = zeros(N,1);
x(N) = b(N)/A(N,N);
for j=N-1:-1:1,
x(j) = (b(j)-A(j,j+1:N)*x(j+1:N))/A(j,j);
end

% End of function

a)The above programme solves a linear system of equations using naïve Gaussian elimination.

Modify this programme so that it outputs upper and lower triangular matrices of LU factorisation. The header line of the modified function should read [x, L, U] = gaussel(A, b)

Use this function, to solve the system Ax = b, where

2032_Linear system of equations.png

b) Use the LU factorisation of A obtained above to solve the system Ax = c, where

1674_Linear system of equations1.png

You can use the ‘backslash' Matlab operator for solving the systems of equations with L and U.

Reference no: EM13927308

Questions Cloud

Write essay on constructing and administrating questionaire : Write a 750-1000 word essay on constructing and administrating a questionaire and its practical application in descriptive research. Include your opinion, backed by scholarly articles, about the strengths and weaknesses of this kind of research. I..
Idea for non-violent civil protests : Where did the leaders of the civil rights movement get the idea for non-violent civil protests? Why did they embrace this tactic?
Rule of thumb to estimate the standard deviation : Use the range rule of thumb to estimate the standard deviation. Compare the estimate to the actual standard deviation. Source: Federation of Tax Administrators.
Main components of company business model : Consider a local business whose services you frequently use. What are the main components of this company's business model?
Solve a linear system of equations : Solves a linear system of equations using naïve Gaussian elimination - You can use the ‘backslash' Matlab operator for solving the systems of equations.
What is probability that jenkins will incur operating losses : What is the probability that Jenkins will incur operating losses? What is the probability that Jenkins will operate above its breakeven point?
Why doesnt the earth overheat : Every day, tremendous amounts of the sun's energy strikes the earth. Why doesn't the earth overheat?
Codes of ethics of various it professional groups : Many professionals adhere to a code of ethics specific to their profession. Examine the Codes of Ethics of various IT Professional groups, such as the ACM, SANS, ISSP, etc. Write a 2 - 3 page paper discussing whether an IT Professional would or sh..
Names and majors of students : Print the names and majors of students who are taking one of the College Geometry courses. (Hint: You'll need to use the "like" predicate and the string matching character in your query.)

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Function that will use the secant method to try to find

Create a function that will use the Secant method to try to find a root. (Hint modify the posted version of False Position.) Because this method may diverge

  The concentration of medication in the blood declines

After a dose, the concentration of medication in the blood declines due to metabolic processes. The half-life of a medication is the time required after an initial dosage for the concentration to be reduced by one-half.

  How spectrograms can be used in non-stationary signals

Use calculations and/or your conceptual understanding of spectra to predict what you'd expect the spectrum of this signal to look like. Confirm this hypothesis by again using fft() in MATLAB to plot the actual spectrum. If MATLAB differs from your..

  A volume 10 in long 5in wide and 05 in thick is to be

a volume 10 in. long 5in wide and 0.5 in. thick is to be removed by face milling cutter that is 3in. diameter and has 6

  What is the purpose of the diary command in matlab

Write the MATLAB code for adding the integers 6 and 3, and storing the sum in a variable x. Write the MATLAB code that takes the square root of 9

  An image histogram for a color image

goal is to build an image histogram for a color image based on its 6-bit color code.

  Write a driver script that runs the functions

Write a driver script that runs the functions above and using the least squares coefficients returned by the functions creates a single plot comparing the differences between the data and the two least squares fit.

  Create a project to detect the iris and pupil

Create a Project to do the following: Detect the Iris and pupil, Measure the location "Centroid" of iris/pupil and Measure the diameter of the iris and pupil.

  Compute the absolute relative errors

Check whether system has no solution, infinite number of solutions or ill-conditions. Perform this checking from the coefficient and constant matrices.

  Write a program that generates three random numbers

Write a program that generates three random numbers, each between 0 and 9. The three numbers are displayed and the message "You got Lucky Fours" will be displayed if at least two of the digits are 4.

  Write a script to solve the problems using vector operations

Write a script to solve the subsequent problems using only vector operations - Assume you have two vectors named A1 and B1 of equal length and create a vector C1 that combines A1 and B1 such that C1 = [A1(1) B1(1) A1(2) B1(2) . . . . A1(end) B1(end..

  Considering the integral

Using the code, generate the first 40 terms: show the result using the format long e. Comment about your results.

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