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

  Build a matlab birthday cake using the cylinder

Prepare for Project you should carefully read the Notes on Trajectory Formation that are available on Moddle.  As you read them, you should try out the concepts in MATLAB.

  Set up a quadratic optimization problem

Set up a quadratic optimization problem that will determine the best investment mix, Solve the problem using the MATLAB quadratic optimization routine quadprog. Interpret your results.

  Finds the largest integer in the list recursively

Write a program that, given a list of 20 integers, finds the largest integer in the list recursively

  What is the terminal velocity in mph

Find the numerical solution using two MATLAB ode solvers, ode45 and ode23. Use an anonymous function as the input function for your ode solvers.

  Perform a principal component analysis on the dataset

Perform a principal component analysis on the dataset you have generated - what is the total variability in the dataset and what is the percent of the total variability explained by the first three components?

  It is now cooled so the volume becomes half the initial

a piston cylinder loaded so it gives constant pressure has 0.75 kg saturated vapor water at 200 kpa. it is now cooled

  Develop matlab function for the fixed-point method

Develop your own Matlab function for the Fixed-point method. Use the estimated relative error as your stopping criterion. The first line of your function should be function

  Design a controller which regulates flow

Design a controller which regulates flow and compensate pressure to my desire value in simscape.

  Plot the open loop displacement response of the

a farm equipment manufacturer has a need to actively reduce the vibration of the operators seat using an electrodynamic

  Using matlab draw an open-loop bode diagram and find the

an armature-control dc motor is used in a position control system. the transfer functions of the controller and process

  Computing project - beam analysis

Computing Project - Beam Analysis- The computing project Beam Analysis deals with load placement at various points along a beam. The concept is to model the relationship between location of load placement and the reaction forces at the end of the ..

  Matlab program that ?nds one root of a polynomial equation

Write a MATLAB program that ?nds one root of a polynomial equation using the Bisection method. A script ?le in MATLAB is a ?le that contains a sequence of MATLAB statements.

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