Use backslash matlab operator for solving the systems

Assignment Help MATLAB Programming
Reference no: EM131013088

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

1661_Matrix.jpg

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

927_Matrix1.jpg

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

Reference no: EM131013088

Questions Cloud

Determine the stretched length of cd : A 125lb bowling ball is suspended from point C with rope CE. A second rope (ABC) is tied to point C and wraps around pulley B toward point A. Spring CD is used to hold the position shown. Determine the stretched length of CD if the spring coeffici..
What is the velocity in the pipeline : An 18-inch storm drain (n=0.013 | s=0.025) is designed to discharge 9.75 CFS. The design guidelines state that the velocity can not exceed 10 ft/s in the pipeline. What is the velocity in the pipeline?
Find inverse function in given problem : Suppose that f(x) = 6x + 2 cosx is differentiable and has an inverse and f(π/2) = 3π. Find (f-1)'(3π)
Company accounts receivable turnover : A+ Airplanes normally sells $125,000 of its product on credit each day, and it takes an average of 40 days to collect the credit sales. (a) What is the average accounts receivable that is reported on A+'s balance sheet? (b) What is the company's ..
Use backslash matlab operator for solving the systems : The 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.
Partial derivatives at maturity : Derive a relation between partialCt(St, K)/partialK and partialPt(St, K)/partialK for t = 0 and t = T. (b) Find the values of these partial derivatives at maturity t = T.
Calculate magnitude and direction of the horizontal force : A 90 degree bend occurs in a 0.3 m horizontal pipe in which the pressure is 276 kPa. Calculate the magnitude and direction of the horizontal force on the bend when 0.28 m^3/s of water flow therein.
Inflation and interest rates : What would you expect the nominal rate of interest to be if the real rate is 3.8 percent and the expected inflation rate is 7.3 percent? The nominal rate of interest would be []%. (Round to Iwo decimal places.)
Calculate magnitude and direction of the total force on bend : A 6-in. horizontal pipe line bends through 90 dgree and while bending changes its diameter to 3 in. The pressure in the 6-in. pipe is 30 psi , and the direction of flow is from larger to smaller. Calculate the magnitude and direction of the total ..

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Design a three band stop filters

Design a three band stop filters for echo/reverberation cancellation for a specific room. Provide measurements of the room impulse response and frequency response with the coefficients.

  Write program that implements lu factorisation algorithm

Write a program that implements the LU factorisation algorithm 2.3, with partial pivoting, given in the Text and in the supplementary section with MATLAB versions of the algorithms.

  Matlab program to compute how much money will accumulate

Write a MATLAB program to compute how much money will accumulate in 5 years in the account and in any CDs you buy. Run the program for two different savings interest rates: 4 percent and 5 percent.

  Matlab inline functions

Consider g(t)=e^(-2t) cos?(πt)(u(t)-u(t-2.5)), use Matlab inline functions for the following questions

  Write a matlab script that performs dot product

Let a and b be three-dimensional vectors. Write a MATLAB script that performs: 1. the dot product between the two vectors and 2. the cross product a × b.

  Ilab overview

you will develop a policy statement and the processes and procedures that can be used to drive the design, implementation, and maintenance of a wireless network in a SOHO (small office, home office) setting.

  Demonstrate the effect of zero-padding

Write a programs in Matlab to demonstrate the effect of zero-padding and filtering the DC-component in the frequency domain.

  Natural frequencies of vibration of a uniform beam

Natural frequencies of vibration of a uniform beam clamped at one end and free at the other are solutions of the equation - output explain how you know your program has actually found the correct "physically meaningful" roots within the expected err..

  Program the rank order cluster algorithm with a matrix

Program the rank order cluster algorithm with a matrix with x rows and x columns in any plataform (that the person inputs). I prefer visual studio or visual basic

  Write mass balance equations for the remaining reactors

Write mass balance equations for the remaining 4 reactors. Put the known values in the 5 equations and convert each equation into a form where left hand side contains all the variables and the right hand side the constant term.

  Write the command and assign it to variable

Write the command and assign it to variable , Write a function named function_test

  Create a script file for conversion of temperature

Create a script file for conversion of temperatures. Use the input function or menu function to allow the user to enter temperature scale of Fahrenheit, Celsius, Kelvin, or Rankine. If you are using the input function, tell the user to enter F for Fa..

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