photo

Tanishq


Followers: 0   Following: 1

%Write a MATLAB program to get solution of SLAE clc; clear; num_vars= input('Enter the number of variable') symVars= sym('x', [1,num_vars]); disp('The symbolic variables created are'); disp(symVars); num_eqns= input('Enter the number of eqations'); equations=[]; for i = 1:num_eqns eqStr= input(sprintf('Enter equation %d (e.g., x1+2*x2+x3==5):',i ),'s'); equations = [equations; str2sym(eqStr)]; end % Convert the equations to matrix form[A|B] [A,B]= equationsToMatrix(equations, symVars); disp('Coefficient Matix A'); disp(A); disp('Constant Vector B'); disp(B); rank_A=rank(A) rank_A_B=rank([A B])

Please login to endorse this person in a skill

No Endorsements received
MATLAB Graphic