Question

I need a working MATLAB CODE for GAUSS SEIDEL ITERATIVE SCHEME the matlab code must compare...

I need a working MATLAB CODE for GAUSS SEIDEL ITERATIVE SCHEME
the matlab code must compare with actual value and break

if this condition is not met i will dislike

think before answering

a correct working matlab code must be given

or else i will dislike badly

0 0
Add a comment Improve this question Transcribed image text
Answer #1

clc;clear all
a=[9 -2 3 2;2 8 -2 3;-3 2 11 -4;-2 3 2 10]; %%Sample matrix A
b=[54.5;-14;12.5;-21]; %%RHS vector
ans1=GaussSeidelm(a,b) %%Function call
function X=GaussSeidelm(A,B) %%Function implementing GS method
[r c]=size(A); %%Finds dimension
X(1:r,1)=0; %%Initialises to 0
k=1;
act=A\B; %%Actual solution
while(true) %%GS method starts till the time loop is true
for(i=1:r)
sum=0;
for(j=1:c)
if(i==j)
continue
end
sum=sum+A(i,j)*X(j,1); %%Sums all elements
end
X(i,1)=(B(i)-sum)/A(i,i);
end
if(act-X<=0.0001)
break %breaks if error is less
end
end
end

- - 5 6 - 7- 00 9- 10 - 11 12 13 - clc;clear all a=[9 -2 3 2;2 8 -2 3; -3 2 11 -4;-2 32 10]; %% Sample matrix A b=[54.5; -14;ans1 5.0001 -2.0000 2.5000 -1.0000 fx >>

Add a comment
Know the answer?
Add Answer to:
I need a working MATLAB CODE for GAUSS SEIDEL ITERATIVE SCHEME the matlab code must compare...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Take any system of 3x3 matrix equation which is linear Solve the system using generic algorithm...

    Take any system of 3x3 matrix equation which is linear Solve the system using generic algorithm for the Gauss Seidel method The code must take the matrix input by the user It should be solvable for any nxn system Give only a working proper MATLAB code if you dont know do not answer or i will dislike badly compare with original solution and then break.

  • i need to do Gauss seidel method in python code please. i need the code copy...

    i need to do Gauss seidel method in python code please. i need the code copy paste . thanks in advance.

  • 1. [12 marks] In the following parts of this question, write a MATLAB code to solve a linear syst...

    1. [12 marks] In the following parts of this question, write a MATLAB code to solve a linear system A b (A is a square nonsingular matrix) using Jacobi and Gauss-Seidel algorithms. Do not use the built-in Matlab functions for solving linear systems (a) Write a Matlab function called Jacobi that consumes a square n x n matrix A, and an n x 1 vector b, and uses the Jacobi technique to solve the system Ax-b, starting with the zero...

  • I need help creating a Mean Filter for Matlab 3 by 3. ( I need the...

    I need help creating a Mean Filter for Matlab 3 by 3. ( I need the Actual Matlab WORking code) It's dude tomorrow, final project worth 40% of my grade. It can not use Matlab Function, must be user define fuction. So far what I have is, I am not sure how to start this, I was told it requires 2 for loops A= imread('lena_256.tif'); % Reads the image in matrix M = ones(3,3)/9; % Creates a matrix of 3...

  • Note: I need matlab code and it must be on first entry, output what the question...

    Note: I need matlab code and it must be on first entry, output what the question needs and i need it without any false in the matlab pls program logic: • Find the index of minimum element with min() function. Make sure to take two outputs while using min(), the second output is the location of the minimum element. • replace the element at minimum index with mean(v) • find sum(v) and assign it to output program: function x =...

  • I need a matlab code to answer the questions below ICE09B Make an Array Develop a...

    I need a matlab code to answer the questions below ICE09B Make an Array Develop a MATLAB code which will produce an array that looks like the following: 4 10 1. You must start with a blank array and build the array with a DNFL. You can NOT just load the array with an assignment statement. Hint: Use "addition" for your variables Square all values in the array 2. Blackboard will ask you for a screenshot of your properly working...

  • I need a matlab code for given question. Please send matlab code sctript. a:2 b:3: c:4...

    I need a matlab code for given question. Please send matlab code sctript. a:2 b:3: c:4 d:2.1 e:3.1 Question 1) (60 p) Consider following equation: axt-bx'+ex=dx-e Find the value of x via; a) Fixed Point iteration method with an accuracy of 0.0004 and a starting value of 1. b) Newton's Method with an accuracy of 0.0004 and a starting value of 1. Write the codes and the results to your paper.

  • PLEASE HELP! I need to write a MATLAB code for this Euler approximation for finding the...

    PLEASE HELP! I need to write a MATLAB code for this Euler approximation for finding the velocity of a parachutist at given time iterations. The answers are provided so you can check to see if the code works. I need to see it done in actual MATLAB program so I can understand the coding methodology better. 1.) Euler Method (estimated time 11min) For the second-order drag model (see Eq. (1)), compute the velocity of a free-falling parachutist using Euler's method...

  • Here is my skeleton code to this C# assignement I need to add a few things,...

    Here is my skeleton code to this C# assignement I need to add a few things, Change the the switch to If and Else-If statements (and test it is still working here) Add a third "Submit" button called SubmitButton In your If and Else-If add a condition if city is Honolulu and SubmitButton is checked. Display "Honolulu is the best place to be this time of year! I wish I was there!". Add comments, including header. HELP PLEASE ASAP public...

  • I have the current code that is working. I need to edit it so that I...

    I have the current code that is working. I need to edit it so that I am only counting strings that are after the word 'From' in a text file. Right now it's counting all words, but I just need the From email addresses in a text file. I think the issue if in the if/else loop but nothing I have tried works. Please help! 1 import string 2 fhand open('C: \Users \Brooke\Canopy scripts mbox-short.txt') 3 counts dict( 4 for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT