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

  What is the purpose of the matlas command window

What is the purpose of the MATLAS Command Window. The Edit Window? The Figure Window. List the different ways that you get help in MATLAB. What is a workspace. How can you determine what is stored in a MATLAB workspace

  Construct a matlab simulation of pulse sampling

Construct a Matlab simulation of pulse sampling and sample & hold for m(t) = cos(2t) andfs = 10.

  Write a matlab function dtmfdecode

The sole assignment is to write a Matlab function dtmfdecode that decodes DTMF tones and produces a transcript of the number that it encodes.

  Determine the volume of the pyramid

Determine the volume of the pyramid. When the user enters every value, they will then be prompted also for either 'i' for inches, or 'c' for centimeters.

  Write a matlab program segment

Plot the given function in MATLAB for x ranging from -1 to 1. Put a proper title of the plot, also label the axes appropriately.

  Program that prompts the user to enter grades in a loop

Write a main program that prompts the user to enter grades in a loop, ending on a negative number, stores the grades in a vector, and asks the user for a passing grade. Ten pass the grade vector and passing cutoff to the function and print the per..

  Compute and plot 4 mean temperature profiles

Generate by measdata.m an array A withsize (365,24), containing temperature measurements for an entire year [1 January,..., 31 December], 24 hours a day [00.00h,...,23.00h].

  If the model tests are to be performed in a wind tunnel

the fluid dynamic characteristics of an airplane flying 240 mph at 10000 ft are to be investigated with the aid of a

  Matlab – discrete time simulation

MATLAB – Discrete time simulation, solve  Discrete time syetm problem,  DT kalman filter problem,  Steady state DT kalman filter problem

  Vb and matlab to calculate the cumulative days

Create a function TotalDaysMonth(intYear, intMonth, strIndOrCum) in both VB and Matlab to calculate the cumulative days or number of days in a given month, depending on inputs, by employing array vector in VB or a vector matrix in Matlab.

  Develop mathematical models for marine systems

Brushless dc motor based propulsion system for a container vessel model - Mathematical equations (models) for the BLDC Motor

  Construct a correlation receiver to detect the noisy signals

Write a program to plot a graph of the theoretical probability of error versus 10log10(Eb/N0) ranging from 0 to 12 dB in increments of 1 for the signals. This will be used to evaluate your simulations.

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