cmpe_Exp5.pdf - EXPERIMENT 5[GAUSS ELLIMINATION Submitted...

This preview shows page 1 - 3 out of 3 pages.

EXPERIMENT 5[GAUSS ELLIMINATION] Submitted by: Reg. No. 18BCM0135 NAME- [ATMADEEP DUTTA] Date: 2.9.2020 Faculty: Dr. Monash purushothaman MATLAB CODE function [x,err]=gauss_jordan_elim(~,~) disp( 'Reg.no: 18BCM0135' ); disp( 'Name: ATMADEEP DUTTA' ); A = [75 -25 0 0; 0 45 -45 0; 75 0 -105 30; 0 20 -30 0 ]; % input for augmented matrix A b = [350; 0; 0; -150]; % intput for matrix B [n,m]=size(A); % finding the size of matrix A err =0; % calculation of error x=zeros(n,1); % calling fuction zero if n ~= m disp( 'error: n~=m' ); % displaying error if found err = 1; end % end of the scope of if if length(b) ~= n % finding the legth of matrix B disp( 'error: wrong size of b' ); % displaying error, if found err = 2; else if size(b,2) ~= 1 b=b'; end % end of the scope of if-else if size(b,2) ~= 1 disp( 'error: b is a matrix' ); % displaying erron in matrix B err = 3; end end if err == 0 Aa=[A,b]; for

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture