MATLAB:
Do the following with the provided .m file
(b) Now on the MATLAB prompt, let us create any two 3 × 3 matrices and you can do the following:
X=magic(3);
Y=magic(3);
X*Y
matrixMultiplication3by3(X,Y)
(c) Now write a new function in MATLAB called matrixMultiplication that can multiply any two n × n matrix. You can safely assume that we will not test your program with matrices that do not have their inner dimensions matched up
CODE:
function [C] = matrixMultiplicationFor3by3(A,B)
b1=B(:,1);
b2=B(:,2);
b3=B(:,3);
a1=A(:,1);
a2=A(:,2);
a3=A(:,3);
c1=a1*b1(1)+a2*b1(2)+a3*b1(3);
c2=a1*b2(1)+a2*b2(2)+a3*b2(3);
c3=a1*b3(1)+a2*b3(2)+a3*b3(3);
C=[c1 c2 c3];
CODE:
b)
function SQUARE(n)
x=magic(n);
y=magic(n);
z=x*y;
disp('x value is:')
disp(x)
disp('y value is:')
disp(y)
disp('z value is:')
disp(z)
end
OUTPUT:
>> SQUARE(3)
x value is:
8
1 6
3
5 7
4
9 2
y value is:
8
1 6
3
5 7
4
9 2
z value is:
91 67
67
67 91
67
67 67 91
>>
c)
CODE:
function matrixmultipilcation(n)
x=magic(n)
y=magic(n)
[Rx, Cx] = size(x);
[Ry, Cy] = size(y);
MatrixProduct = zeros(Rx, Cy);
for row = 1 : Rx
for col = 1 : Cy
S= 0;
for k = 1 : Cx
S= S+ x(row, k) * y(k, col);
end
MatrixProduct(row, col) = S;
end
end
disp('matrix product')
disp(MatrixProduct)
OUTPUT:
>> matrixmultiplication(4)
x =
16
2 3 13
5 11
10 8
9
7 6 12
4 14
15 1
y =
16
2 3 13
5 11
10 8
9
7 6 12
4 14
15 1
matrix product
345 257 281
273
257 313 305
281
281 305 313
257
273 281 257
345
>>
MATLAB: Do the following with the provided .m file (b) Now on the MATLAB prompt, let...
9. For a fuzzy system with double inputs and single output, x and y are the inputs, z is the output. Assume that the elements of the inputs and output in fuzzy domains are X-fa1,a2,a3), Y={b1,b2,b3}, Z-(c1,c2,c3}, respectively. The relation between inputs and output can be described by the following fuzzy rules: Ifx is A1 and y is B1, then z is C1, where A1 and C1 B2 0.7 0.5 0.2 + a3 0.3 0.4 0.9 0.6 0.8 0.1 b1...
Assume that in A1, A2, A3, and A4 you have the values of 1, 2, 3, and 4, respectively. In B1, C1, and D1, have the letters a, b, and c, respectively. In B2, C2, and D2 you have the letters of d, e, and f, respectively. In B3, C3, and D3 you have the letters of g, h, and i, respectively. What will the command of =VLOOKUP(3,A1:D4,3) return? Group of answer choices h c a g i
Consider the following expressions: A1: f = Fw A2: f = Fw sinθ B1: N = W 2 B2: N = W C1: ℓFw sinθ = 2Fw cosθ C2: ℓFw sinθ = ℓ W cosθ C3: ℓFw sinθ = 1 2 ℓ W cosθ, where f: force of friction between the ladder and the ground, Fw: normal force on the ladder due to the wall, θ: anglebetween theladder and theground, N: normal force on the ladder due to the ground,...
The data on the table follow an exponential model y-aebx, Fill in the blanks 0.4 800 [a1] [b1] [c1] [d1] 0.8 975 [a2] [b2] [c2] [d2] 1.2 1500 [a3] b3] [c3] [d3] 1.6 1950 [a4] b4] [c4] [d4] 2 2900 [a5 [b5] [c5] [d5 2.3 3600 [a6] [b6] [c6] [d6] Sum [a b c7] [d7] The average value of w is [e1] The average value of z is [e2] a1- [e3] a0- [e4] а» [e5] b- [e6]
can you multiply the yellow number by 9 then solve 1) ALU Design: Carry-Select Adder UCE Given: A 4-bit adder is implemented in a carry ripple style as shown in the figure below. B3 A3 B2 A2 B1 A1 BOAD -- FA c3 FA c1 FA FA CO='1' $1 SO Sought: Please calculate the output carries for each full adder (FA) using A=0x01 and B=0x04. It is required to show ALL incremental steps of the solution, then record each the...
1. Verify the operation of the Adder 7483, to do this implement a circuit that performs the sum of two numbers A and B each of two bits according to the pin connection in the annex. View outputs with a 7-segment display. B4 14 C4 CO GND B1 A1 C1 16 15 14 13 12 11 10 9 24 C4 CO B1 A 1 B4 Σ1 A4 A2 13 A3 83 12 B2 ND 3 5 6 7 8 A4...
Given: A 4-bit adder is implemented in a carry ripple style as shown in the figure below. B3 A3 B2 A2 B1 A1 во АО FA c1 FA FA FA CO='1' SO Sought: Please calculate the output carries for each full adder (FA) using A= 0x04and B=0x04. It is required to show ALL incremental steps of the solution, then record each the final results in the table below. C4 C3 C2 ci
The (M) signifies a manufactured part. The (P) signifies a purchased part. The cost of level 9 parts are assembled to make level 8 cost. The level 8 costs are combined to make level 7. Levels 7 and 8 are manufactured parts. This is referred to as rolling the cost. You always start at the bottom and develop your cost to level 0. Once you reach level 0 costing for this product is complete. Widget-Product Structure Level Source Quantity Part...
Assume that the transition matrix from basis B = {b1, b2, b3} to basis C = {c1, c2, c3} is PC,B = 1/2*[ 0 -1 1 ; -1 1 1 ; 1 0 0 ]. (a) If u = b1 + b2 + 2b3, find [u]C. (b) Calculate PB,C. (c) Suppose that c1 = (1, 2, 3), c2 = (1, 2, 0), c3 = (1, 0, 0) and let S be the standard basis for R 3 . (i) Find...
Mark True/False for functional dependencies of the following table R(A, B, C, D, E), where we assume that it is the intent of the designer that exactly this set of rows should list in the table. A B C D E a1 b1 c1 d1 e1 a2 b2 c2 d2 e2 a1 b1 c1 d1 e2 a2 b2 c3 d4 e2 (a) A --> B (b) B --> A (c) C--> A (d) D --> A (e) CD --> B