Question: USE MATLAB! USE MATLAB! QUESTION 2a: Write a function averagemateven that will receive an m x n matrix (consists of all integers) as an input
USE MATLAB!



USE MATLAB!
QUESTION 2a: Write a function averagemateven that will receive an m x n matrix (consists of all integers) as an input argument, and will return the average of all the even integers in the matrix. Use only loops and if statements. You are ONLY allowed to use the "size", "length and rem built-in functions. (NOTE: Other MATLAB built-in functions are not allowed.) Start with the function definition shown below. function y = averagemateven (A) X Y = AVERAGEMATEVEN (A) returns the average of all the even numbers in the % matrix A end QUESTION 2b: In a separate script file, test the function by evaluating A given below using the "averagemateven function 1 2 A=4 3 16 -2 3 -8 1 where og is the angular resonant frequency: 0, [rad/sec) VLC R a is given as: a = 2L and the damping factor (1) is given by: 5 = 2 0. The undamped natural angular frequency od is given by: Od oz-a [rad/sec] Write a function "iresp" that returns the plot of the current it) using if-else statement. The plot should display the proper graph for i(t) based on the calculated value of . Your function should have 5 scalar input parameters: resistance (R), inductance (L), capacitance (C), Aand A2, and 1 vector input t. (Submit only the m-file for this question) QUESTION 3b: Suppose L = 0.2mH, C = 100uF, A= 1, A2 = 1.5, t = 0:0.00001:0.003. Call the function "iresp to plot the current it) for the following two different values of R. Display the two graphs on the same plot. Label the axes, add a title, legend and gridlines to your plot. (Submit the pdf file of the html report for this question) a) R=1.022 b) R = 3.202
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
