Sir i think there are some problem to calculate the value of x matrix when you will try to calculate x(3 or more) it will not give correct answer. i found a correct answer applying this.......... for i = n:-1:1 t = b(i,:); for j = n:-1:i t = t-(A(i,j)*x(j,:)) end x(i,:) = t/A(i,i); end x
"for i=n-1:-1:1" sir couldn't understand this line. why did you use -1? by the way this was the most simplified code i have ever seen for gauss elimination. Thank you
in gauss elimination we find the variables from bottom to top...& in hat also we found the last variable (suppose z) at early...and then we found the remaining variables... so for x, y, z z is at 3rd position y is at 2nd & x is at 1st position so n = 3 and as z is find earliest after z, y(n-1) & then x(n-2) therefor we use n-1:-1:1( backward substitution)
Dipak Chavan, substitute the values from the table and create four simulations equations and solve a1, a2, a3 and a4, using Gaussian elimination to solve the four unknown quantities. The data relationship is u=a1t+a2t^2+a3t^3+a4t^4 Data T/s. U/ms^-1 0.125 0.75 0.250 1.50 0.375 0.75 0.500 0.00 Could you solve this using Gaussian eleimination and show me step by stem how you got your answer, thank you
hello thank you for the video but when i implemented this program it gaves me for the two first cordinates of x zero only the last coordinate is calcualted
close all clc A=[12 -2 3; 1 10 -2; 3 1 15]; b=[18;16;52]; %solve linear system Ax=b % A is n by n matrix % x is an n by 1 matrix [n,~]= size(A); x= zeros(n,1); %initialize x %code for forward elimination to correct the matrix A to upper triangular %form for i =1: n-1 m=A(i+1:n,i)/A(i,i); A(i+1:n,:)=A(i+1:n,:)-m*A(i,:); b(i+1:n,:) = b(i+1:n,:)-m*b(i,:); end %code for back substitution to find unknowns x(n,:)= b(n,:)/A(n,n); for i= n-1:1:1 x(i,:) =(b(i,:)- A(i,i+1:n)*x(i+1:n,:))/A(i,i); end x %display all values