Question

Write a program that would solve an arbitral system of linear equations, and in the case...

Write a program that would solve an arbitral system of linear equations, and in the case of n by n system find the inverse of the matrix representing the RHS (right hand side) of the system.

The language is not important.

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

I AM USING MATLAB HERE.PLEASE REFER BELOW CODE

close all
clear all
clc


%solve system of linear equation using matrix inverse method

%3x1+4x2-2x3+2x4=2
%4x1+9x2-3x3+5x4=8
%-2x1-3x2+7x3+6x4=10
%x1+4x2+6x3+7x4=2

%matrix representation will be
% Ax = B;
%x = inverse(A) * B
A = [3 4 -2 2
4 9 -3 5
-2 -3 7 6
1 4 6 7];

% x = [x1
% x2
% x3
% x4]

B = [2 8 10 2];

%B will be column matrix
B = B';

x = inv(A) * B;

%final values of x1 x2 x3 and x4 is
x1 = x(1)
x2 = x(2)
x3 = x(3)
x4 = x(4)

PLEASE REFER OUTPUT BELOW


x1 =

-2.1538


x2 =

-1.1538


x3 =

-2.8462


x4 =

3.6923

>>

IF YOU HAVE ANY DOUBT PLEASE MENTION IN COMMENT BELOW

Add a comment
Know the answer?
Add Answer to:
Write a program that would solve an arbitral system of linear equations, and in the case...
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
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