Está en la página 1de 6

Friday, December 6, 2019

BMEN.1200 BME Applications Matrix Multiplication Workshop 2 Section: 10am


Page 1 of 1
First Name Nina Last Name:____Vrankic____________Student ID:____01842520_________

1. Multiply the following matrixes using any method

A=[4 -1 0 B = [4 10 11 12
2 1 3 13 14 -1 0
-2 5 6 -2 1 2 6 ]
7 8 9]

3 26 45 48
15 37 27 42
45 56 -15 12
114 191 87 138

2. For the following systems of equations


a. Rewrite the equations in matrix form A 𝑋⃗ = 𝐵.
b. Give the MATLAB commands to solve the system of equations by finding the inverse A-1 and
then X = A-1B.

I. -2x + y = -3
x+y=3
[-2 1;1 1] [x;y] = [-3;3]

II. -2x + y = -3
-2x + y = -1
[-2 1;-2 1] [x;y] = [-3;-1]

III. x+y+z+t=4
2x – y + t = 2
3x + y – z – t = 2
x – 2y – 3z + t = -3
[1 1 1 1;2 -1 0 1;3 1 -1 -1;1 -2 -3 1] [x;y;z;t]=[4;2;2;-3]
IV. 2x + 3y + z + t = 1
x–y–z+t=1
3x + y + z + 2t = 0
–x+z–t=–2
{2 3 1 1;1 -1 -1 1;3 1 1 2;-1 0 1 -1] [x;y;z;t]=[1;1;0;-2]
V. x – 2y + z + t = 3
x+z=t
2y – z = t
Friday, December 6, 2019
BMEN.1200 BME Applications Matrix Multiplication Workshop 2 Section: 10am
Page 2 of 2
First Name Nina Last Name:____Vrankic____________Student ID:____01842520_________

x + 4y + 2z – t = 1
[1 -2 1 1;1 0 1 -1;0 2 -1 -1;1 4 2 -1] [x;y;z;t]= [3;0;0;1]

VI. x + 2y – w = 0
3x + y + 4z + 2w = 3
2x – 3y – z + 5w = 1
x + 2z + 2w = –1

[1 2 0 -1;3 1 4 2;2 -3 -1 5; 1 0 2 2] [x;y;z;w]=[0;3;1;1]

VII. 2x + 2y + z = 2
y + 2z = 1
x + y + 3z = 3
[2 2 1;0 1 2;1 1 3] [x;y;z]=[2;1;3]
VIII. 4x – y + 3t = 10
-2x + 3y + z – 5t = -3
x + y –z + 2t = 2
3x + 2y - 4z = 4
[4 -1 3 0;-2 2 1 -5;1 1 -1 2;3 2 -4 0] [x;y;z;t]=[10;-3;2;4]

3. MATLAB can also solve sets of equations using the solve function. In this example, the solutions for
x, y and z are returned as a structure consisting of fields for x, y and z. The individual solutions are
symbolic expressions stored in the fields of the structure
>> syms x y z
>>answer = solve(4*x – 2*y + z == 7, x + y + 5*z == 10, -2*x + 3*y –z ==2)
>> x = answer.x x=124/41
>> y = answer.y y=121/41
>> z = answer.z z=33/41

Use the solve function to solve the systems of equations in 2. For each question, paste your MATLAB
commands and the space below
I. >>syms x y
>>answer = solve(-2*x+y==3, x+y==3)
>>x=answer.x
X=2
>>y=answer.y
y=1
II. >>syms x y
>>answer = solve(-2*x+y==-3, -2*x+y==-1)
>>x=answer.x
X=empty sym:0-by-1
>>y=answer.y
Friday, December 6, 2019
BMEN.1200 BME Applications Matrix Multiplication Workshop 2 Section: 10am
Page 3 of 3
First Name Nina Last Name:____Vrankic____________Student ID:____01842520_________
y=empty sym: 0-by1
III. >>syms x y z t
>>answer = solve(-x+y+z+t==4,2*x-y+t==2,3*x+y-z-t==2,x-2*y-3*z+t==-3)
>>x=answer.x
X=1
>>y=answer.y
y=1
>>z=answer.z
Z=1
>>t=answer.t
T=1
IV. >>syms x y z t
>>answer = solve(2*x+3*y+z+t==1,x-y-z+t==13*x+y+z+2*t==0,-x+z-t==-2)
>>x=answer.x
X=-2
>>y=answer.y
y=1
>>z=answer.z
Z=-1
>>t=answer.t
T=3
V. >>syms x y z t
>>answer = solve(x-2*y+z+t==3,x+y==t,2*y-z==t,x+4*y+2*z-t==1)
>>x=answer.x
X=3
>>y=answer.y
y=7/5
>>z=answer.z
Z=-8/5
>>t=answer.t
t=22/5
VI. >>syms x y z w
>>answer = solve(x+2*y-w==0,3*x+y+4*z+2*w==3,2*x-3*y-z+5*w==1,x+2*z+2*w==-1)
>>x=answer.x
X=33/11
>>y=answer.y
y=-86/33
>>z=answer.z
Z=16/33
>>w=answer.w
W=-79/33
VII. >>syms x y z
>>answer = solve(2*x+2*y+z==2,y+2*z==1,x+y+3*z==3)
Friday, December 6, 2019
BMEN.1200 BME Applications Matrix Multiplication Workshop 2 Section: 10am
Page 4 of 4
First Name Nina Last Name:____Vrankic____________Student ID:____01842520_________
>>x=answer.x
X= 6/5
>>y=answer.y
y=-3/5
>>z=answer.z
Z=4/5
VIII. >>syms x y z t
>>answer = solve(4*x-y+3*t==10,-2*x+3*y+z-5*t==-3,x+-z+2*t==2,3*x+2*y-4*z==4)
>>x=answer.x
X=110/43
>>y=answer.y
y=19/43
>>z=answer.z
Z=49/43
>>t=answer.t
t=3/43

The function fplot will draw a two-dimensional plot in the default x-range from -5 to 5. The
following code produces the figure shown below. The DisplayName property of the plot is used
for the title of the plot.
>> syms x
>> expr = x^3 + 3*x^2 - 2;
>> figure, fpe = fplot(expr)
>> title(fpe.DisplayName)
>> xlabel('x')
>> ylabel('y = x^3 + 3*x^2 - 2')
Friday, December 6, 2019
BMEN.1200 BME Applications Matrix Multiplication Workshop 2 Section: 10am
Page 5 of 5
First Name Nina Last Name:____Vrankic____________Student ID:____01842520_________

4. Solve the simultaneous equations x – y = 2 and x2 + y = 0 using solve. Plot the corresponding
functions, y = x -2 and y = -x2 on the same graph with the x-range from -5 to 5. Paste your MATLAB
commands and graph in the space below
Friday, December 6, 2019
BMEN.1200 BME Applications Matrix Multiplication Workshop 2 Section: 10am
Page 6 of 6
First Name Nina Last Name:____Vrankic____________Student ID:____01842520_________

5. Analyzing electric circuits can be accomplished by solving sets of equations. For a particular circuit,
the voltages V1, V2 and V3 are found through the system
V1 = 5
-6V1 + 10V2 – 3V3 = 0
-V2 + 51V3 = 0

Put these equations in MATLAB and use any method to solve for V1, V2 and V3. Paste your MATLAB
commands in the space below
Syms v1 v2 v3
Answer=solve(v1 == 5, -6*v1 + 10*v2 + -3*v3 ==0, _1*v2+51*v3 ==0)
V1= answer.v1
V2=answer.v2
V3=answer.v3

V1=5
V2=510/169
V3=10/169

También podría gustarte