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

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

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