(Solved): EET 1102 HW 9: Conditional Programming and Loops Department of Electrical and Telecommunications Te ...
EET 1102 HW 9: Conditional Programming and Loops Department of Electrical and Telecommunications Technology New York City College of Technology, CUNY Prof. Abdullah Hossain Instructions: Program and solve the following tasks in a script file; publish it as a PDF and submit it on Blackboard in the content section. Ensure that you put the proper header information (your name, course name, date, HW number, etc.) as shown in the class. Divide the script into sections for each task and denote each answer with the sub-task letter (2a,2b,2c, etc...) when applicable. Task 1: Use a for loop to determine the sum of the first 10 terms in the series 5k∧3,k=1,2,3,…,10. Task 2: Refer to matrix A below. A=⎣⎡3−8−175−16−433−9⎦⎤ Write a program that computes the array B by computing the natural logarithm of all the elements of A whose value is greater than or equal to 1 . Otherwise add 20 to each element that is less than 1. Use a for loop with conditional statements. HINT: You will need to use two for loops (NESTED) as discussed in class with an IF-ELSE statement inside the INNER most loop. Natural Logarithm in MATLAB simply means log(X).
Certainly! Here's an example of a MATLAB script that addresses Task 1 and Task 2:% Your Name% Course Name% Date% Homework Number%% Task 1: Sum of the seriessum_terms = 0;for k = 1:10 term = 5 * k^3; sum_terms = sum_terms + term;endplease follow the step 2 given below.