Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below is the code and the answer for problem 1. Please post screenshots of the code for number 2 in MATLAB. 1. Write a code

Below is the code and the answer for problem 1. Please post screenshots of the code for number 2 in MATLAB.

image text in transcribedimage text in transcribed

1. Write a code in Matlab to solve a linear system of equations of any size using the simple Gauss Elimination algorithm 2. Using your code in (2) to find x, y, and z for the system of equations: 3x 4y + 2z = 1 2x+3y-3z = -1 5x 5y + 4z = 7 3 4 5 6 7 8 9 10 11 12 13 14 15 %#1 function x = linear_ngaussel (A,b) A = n x n matrix b = column vector, n x 1 n=length (b); 5x=zeros (n,1); % Perform the forward elimination for k=1:n-1 for i=k+1:n m=A (i, k)/A (k, k); for j=k+1:n Ali,j) =A (i, j)-m*A(k, j); end b(i)=b (i)-m*b (k); end end % Perform the back substitution x (n)=b (n)/A (n,n); for i=n-1:-1:1 S=b (i); for j=i+1:n S=S-A(i, j) *x(j); end x(i)=S/A(i, i); end 16 17 18 19 20 21 22 23 24 25 26 27

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

Please look at ROC and determine which is best model to use.

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago