Question

Given the following system of equations: a1x1 + b1x2 + c1x3 = d1 a2x1 + b2x2...

Given the following system of equations:

a1x1 + b1x2 + c1x3 = d1

a2x1 + b2x2 + c2x3 = d2

a3x1 + b3x2 + c3x3 = d3

Write a MATLAB program to find solutions for : x1, x2 and x3. For any value of a1, a2, a3, b1, b2, b3, c1, c2, c3, d1, d2 and d3. Your program must ask the user to enter at run time the coefficients of your systems.

Homework Answers

Answer #1

MATLAB code is given below in bold letters.

clc;
close all;
clear all;


% prompt the user to enter the coefficients
a1 = input('Enter a1: ');
a2 = input('Enter a2: ');
a3 = input('Enter a3: ');

b1 = input('Enter b1: ');
b2 = input('Enter b2: ');
b3 = input('Enter b3: ');

c1 = input('Enter c1: ');
c2 = input('Enter c2: ');
c3 = input('Enter c3: ');

d1 = input('Enter d1: ');
d2 = input('Enter d2: ');
d3 = input('Enter d3: ');


% Now solve the equations using matrix form
% define matrix A abs B as follows
A = [a1 a2 a3;b1 b2 b3;c1 c2 c3];
B = [d1;d2;d3];
if(det(A)==0)
error('The determinant of A is zero!!!');
else
x = A^1*B
end

command window:

Enter a1: 1
Enter a2: 2
Enter a3: 3
Enter b1: 4
Enter b2: 5
Enter b3: 6
Enter c1: 7
Enter c2: 8
Enter c3: 9
Enter d1: 10
Enter d2: 11
Enter d3: 12

x =

68 (x1)
167 (x2)
266 (x3)

Know the answer?
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
Similar Questions
If the determinant of the 3x3 matrix [2c1 -2c2 2c3; a1+6c1 -a2-6c2 a3+6c3; -b1 b2 -b3]...
If the determinant of the 3x3 matrix [2c1 -2c2 2c3; a1+6c1 -a2-6c2 a3+6c3; -b1 b2 -b3] is -16, what is the determinant of the 3x3 matrix [a1 b1 c1; a2 b2 c2; a3 b3 c3]?
Find two linearly independent solutions of 2x2y′′−xy′+(−2x+1)y=0,x>0 of the form y1=xr1(1+a1x+a2x2+a3x3+⋯) y2=xr2(1+b1x+b2x2+b3x3+⋯) where r1>r2. Enter r1=...
Find two linearly independent solutions of 2x2y′′−xy′+(−2x+1)y=0,x>0 of the form y1=xr1(1+a1x+a2x2+a3x3+⋯) y2=xr2(1+b1x+b2x2+b3x3+⋯) where r1>r2. Enter r1= a1= a2= a3= r2= b1= b2= b3= Note: You can earn partial credit on this problem.
A student will randomly select 5 cards from a deck of 52 cards. Each card is...
A student will randomly select 5 cards from a deck of 52 cards. Each card is uniquely identified by a label which is a combination of a letter (one of the following: A, B, C, D) followed by a number (one of the following: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13). The labels on the cards are A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, B1, B2, B3, B4,...
A student will randomly select 5 cards from a deck of 52 cards. Each card is...
A student will randomly select 5 cards from a deck of 52 cards. Each card is uniquely identified by a label which is a combination of a letter (one of the following: A, B, C, D) followed by a number (one of the following: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13). The labels on the cards are A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, B1, B2, B3, B4,...
(1 point) Match the following nonhomogeneous linear equations with the form of the particular solution yp...
(1 point) Match the following nonhomogeneous linear equations with the form of the particular solution yp for the method of undetermined coefficients.   ?    A    B    C    D      1. y′′+y=t(1+sint)   ?    A    B    C    D      2. y′′+4y=t2sin(2t)+(5t−7)cos(2t)   ?    A    B    C    D      3. y′′+2y′+2y=3e−t+2e−tcost+4e−tt2sint   ?    A    B    C    D      4. y′′−4y′+4y=2t2+4te2t+tsin(2t) A. yp=t(A0t2+A1t+A2)sin(2t)+t(B0t2+B1t+B2)cos(2t) B. yp=A0t2+A1t+A2+t2(B0t+B1)e2t+(C0t+C1)sin(2t)+(D0t+D1)cos(2t) C. yp=Ae−t+t(B0t2+B1t+B2)e−tcost+t(C0t2+C1t+C2)e−tsint D. yp=A0t+A1+t(B0t+B1)sint+t(C0t+C1)cost
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT