Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

. Gilat Chapter 3 problem 14 Use a single M-file for this problem and use mnemon

ID: 3748677 • Letter: #

Question

.

Gilat Chapter 3 problem 14 Use a single M-file for this problem and use mnemonic variable names of 3 characters or more in the M-fiUse a single M-file for this problem and use mnemonic variable names of 3 charatrs or more for electrical kit for parts a), b), c) and d). Do not use variables A, B, C pter 1-homen calculations. Use the lastname and/ or firstname as part of the filename as directed (use the following filename system: lastname 3electrical firstinitial.m) Students should use their first name as the variable name for the matrix A Students should use their middle name as the variable name for the matrix B. Students should use their last name as the variable name for the matrix C If students do not have a middle name, students should use the variable "middle name Abbreviations for "too" long last names or hyphenated names are acceptable Show calculations in Matlab. Let Matlab do the work (use the following filename system: lastname 3matrix_ firstinitial.m) 14. Create the following three matrices: 1 Function Digital Multimeter With Aundible Continuity 11 5 7 14 1 B 0-12 4 C 10 3 A.11 7-3 6-10 0 8 -5 9 ) Define the following variables: a) Calculate A+B and B+A to show that addition of matrices is commuta b) Calculate A+(B+C) and (A+B)+C to show that addition of matrices is c) Calculate S(A C) and 5A+5C to show that, when matrices are multi- d) Calculate A (B+C) and A*B+A*C to show that matrix multiplication is multimeter lastname $ 25.87 wires _components $ 13.74 ivC. surge protector $ 12.95 protoboard lastname- 14.36 Next change the display format to bank A) Evaluate the cost of: 2 wire components, 1 surge protector, 3 protoboards and 1 multimeter Use a variable name "kit lastname"; B) Now evaluate the cost of part A) with a 7.5 % sale tax. For this evaluation use a variable name "kittax firstname" C) Finally evaluate the cost of part B) but round the cost to the nearest dollar For this evaluation use a variable name "kitround lastname" associative. plied by a scalar, the multiplication is distributive. 3, Gilat-Chapter 1 problem-(see #11 below) and Chapter 2,-see problem #8) students are required to use mnemonic variables of 3 characters or more instead of simply using "ans" by default. For #11 Use "left-lastname" as the variable name for the left hand side ofthe equation and use "right lastname" as the variable name for the right hand side of the equation. (use the following filename system: lastname _3beta firstinitial.m) 11. Define two variables: alpha 5n/9, beta -/7. Using these variables, show that the following trigonometric identity is correct by calculating the value of the left and right sides of the equation. cosa-cosß-2sin (+ )sin (B-u) For #8, Rennember that Matlab is doing the work. Areas of #8 stress the col on operator Create a vector, name it Afirst, that has 13 elements in which the first is 3, the increment is 4 and the last element is 51. Then, using the colon symbol, create a new vector, call it Asecond, that has seven elements. The first four elements are the first four elements of the vector Afirst, and the last three are the last three elements of the vector Afirst. 8.

Explanation / Answer

ScreenShot

-----------------------------------------------------

Question 14

%Declare variables
first_name=[5 2 4;1 7 -3;6 -10 0];
middle_name=[11 5 -3;0 -12 4;2 6 1];
last_name=[7 14 1;10 3 -2;8 -5 9];
%commutative check'
if (plus(first_name,middle_name)==plus(middle_name,first_name))
disp('first_name+middle_name=middle_name+first_name is Commutative')
else
disp('first_name+middle_name=middle_name+first_name is Not Commutative')
end
%Assocative check
if (plus(first_name,plus(middle_name,last_name))==plus(plus(first_name,middle_name),last_name))
disp('first_name+(middle_name+last_name)=(first_name+middle_name)+last_name is Associative')
else
disp('first_name+(middle_name+last_name)=(first_name+middle_name)+last_name is Not Associative')
end
%Scalar Multiplication is distributive
if(5*plus(first_name,last_name)==(5*first_name)+(5*last_name))
disp('5*(first_name+last_name)=5*first_name+5*last_name is distributive')
else
disp('5*(first_name+last_name)=5*first_name+5*last_name is not distributive')
end
% Matrix Multiplication is distributive
if(first_name*plus(middle_name,last_name)==(first_name*middle_name)+(first_name*last_name))
disp('first_name*(middle_name+last_name)=first*middle_name+first_name*last_name is distributive')
else
disp('first_name*(middle_name+last_name)=first*middle_name+first_name*last_name is not distributive')
end

-----------------------------------------

Gilat Chapter 1

%Variable declaration
multimeter_lastname=25.87;
wires_components=13.74;
surge_protector=12.95;
protoboard_lastname=14.36;
%bank format
format bank
%Evaluation Cost
Idt_lastname=(2*wires_components)+(protoboard_lastname)+(1*surge_protector)+(1*multimeter_lastname)
%Sale tax calculation
Idttax_firstname=Idt_lastname*(7.5/100)
%Final calculation
idtround_lastname=round((Idt_lastname+Idttax_firstname))

-----------------------------------------------------------

Gilat Chapter 1

11)

%Variable declaration
alpha=(5*pi)/9;
beta=pi/7;
%calculation
left_lastname=cos(alpha)-cos(beta)
right_lastname=2*sin((alpha+beta)/2)*sin((beta-alpha)/2)

-----------------------------------

8)

%First vector creation
Afirst=3:4:51
%Second vector creation
Asecond=[Afirst([1 2 3 4]) Afirst([length(Afirst)-2 length(Afirst)-1 length(Afirst)])]