Mapúa Institute of Technology**We aren't endorsed by this school
Course
MATH 142
Subject
Mathematics
Date
Jan 12, 2025
Pages
8
Uploaded by DeanPartridgeMaster1248
LAB EXER 1 (Matlab as Calculator) 2T_2425 Name _John Matthew B. MoradosDate Posted 12/13/2024 Evaluate the following using MATLAB. Observe the correct syntax. A. Perform as indicated. (Define your own variable unless stated.) Syntax Results 1.2{–4 –[6 + 4 +2 (7 –(1 + 9)) + 12] –2} + 5 % John Matthew B. Morados% No. 1result = 2 * (-4 - (6 + 4 + 2 * (7 - (1 + 9)) + 12) - 2) + 5;disp(result);-39 2.−5−84−(−3)÷8−(−4)3−5− 2% John Matthew B. Morados% No. 2num1 = -5 - 8; den1 = 4 - (-3); frac1 = num1 / den1; num2 = 8 - (-4); den2 = 3 - 5; frac2 = num2 / den2; result = frac1 / frac2 - 2; disp(result);-1.6905 3.Suppose that x = 3 and y = 4 . Find the value of (𝑦 −2𝑥5)−1named three. % John Matthew B. Morados% No. 3x = 3; % Define xy = 4; % Define ythree = ( (y - 2) / x^5 )^(-1); disp(three);0.2505
4.Assuming that the variables a, b, c, d and f are scalars, write MATLAB statements to compute and display the following expressions. Test your statements for the values a = 1.12, b = 2.34, c = 0.72, d = 0.82, f = 19.81. Express your answer in two decimal places. 𝑟 =𝑓1?+1?+1?+1?% Given valuesa = 1.12;b = 2.34;c = 0.72;d = 0.82;f = 19.81;% Calculate the denominatordenominator = (1/a) + (1/b) + (1/c) + (1/d);% Calculate rr = f / denominator;% Display the resultdisp(['r = ', num2str(r)]);r = 5.0425 5.For the values x = 5 + 2i, y = –6 + 7i. Evaluate 3x/y2called complex. % John Matthew B. Morados% No. 5x = 5 + 2i;y = -6 + 7i;y_squared = y^2;complex = (3 * x) / y_squared;disp(['complex = ', num2str(complex)]);-0.096747+0.1636i 6.The area of a rhombus is 143 m2. If the longer diagonal is 26m find the shorter diagonal in inches named d1. % John Matthew B. Morados% No. 6% Given valuesarea = 143; % in square meterslonger_diagonal = 26; % in metersd1_m = (2 * area) / longer_diagonal;d1_in = d1_m * 39.3701;disp(['Shorter diagonal (d1) in inches = ', num2str(d1_in)]); Shorter diagonal (d1) in inches = 433.0711
7.Determine the measure of an edge of cube whose total surface area is 150in. % John Matthew B. Morados% No. 7% Given total surface areatotal_surface_area = 150; % in square inchess = sqrt(total_surface_area / 6);disp(['The edge length of the cube is ', num2str(s), ' inches']);5 inches 8.If the longest side of a right triangle is 5.5cm and the shortest side is 3.3cm, find third side named Second. % John Matthew B. Morados% No. 8% Given valueslongest_side = 5.5; % in cmshortest_side = 3.3; % in cm% Calculate the second sideSecond = sqrt(longest_side^2 - shortest_side^2);% Display the resultdisp(['The second side of the triangle is ', num2str(Second), ' cm']);4.4 cm 9.An employee borrows Php65,000 for seven months at an interest rate of 12% per year. Find the interest earned called Int and the total amount he has to pay named Value. % John Matthew B. Morados% No. 9% Given valuesP = 65000; % Principal amount in Php r = 0.12; % Annual interest ratet = 7 / 12; % Time in years% Calculate interestInt = P * r * t;% Calculate total amount to payValue = P + Int;% Display the resultsdisp(['Interest earned (Int) = Php ', num2str(Int)]);disp(['Total amount to pay (Value) = Php ', num2str(Value)]);Int = Php 4550 Value = Php 69550
B. In the command window, take a screenshot and paste here for validation. For each number always start with your full name as comment(%) statement.