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

  Directional antennas in a stationary environment

Consider a point-to-point radio link between two highly directional antennas in a stationary environment. The antennas have antenna gains of 30 dB, distance attenuation is 150 dB, and the receiver has a noise figure of 7 dB.

  Progrmaing i uploaded the

i uploaded the instruction. ltbrgt

  Dimensional plot of the free surface charge

Include a qualitative dispersion curve sketch thatdemonstrates the operating point at which your Matlab plot applies.

  Write the matlab code to set up the vector

Write the MATLAB code to set up the vector y = [2 4 3 6 2] and plot y in a pie chart. Add a legend and title to the pie chart. The legend should contain the following strings: ‘value1', value2', ‘value3', ‘value4', and ‘value5'. The title should b..

  Consider the predator-prey models

Consider the predator-prey models developed early part of the 20 th  century in which the number of predators and preys may be predicted using the pair of ODEs

  Create matlab functions to plot both your system-dynamics

say a ball of mass m and diameter d is in free-fall from a very high velocity altitude. the governing differential

  Write a program to calculate the characteristic impedance

Write a program to calculate the characteristic impedance of all the transmission line topologies

  Prepare a program to enter a scalar value of temperature

Create a program that prompts the user to enter a scalar value of temperature. If the temperature is greater than 98.6°F, send a message to the command window telling the user that he or she has a fever.

  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.

  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.

  Derive and solve a model of an insulated water tank

Determine the steady state conditions at t

  Write a function that takes as input a vector and string

Using MATLAB, write a function that takes as input a vector and string. Switch on the string to select between the arithmetic, harmonic and geometric means of the vector.

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