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

Xmin=0; Xmax=1; interval=0.001; x=Xmin:interval:Xmax; f=exp(-4.*x).*sin(20.*x);

ID: 3737788 • Letter: X

Question

Xmin=0;

Xmax=1;

interval=0.001;

x=Xmin:interval:Xmax;

f=exp(-4.*x).*sin(20.*x);

plot(x,f);

grid on;

What is the zero function? How I can get the number of zeros on the plot?

EE 221 Computing for Engineers Homework #14 Problem #1 (30 points): Let the mathematical function f(x) be defined as: f(x) = exp(-4x) sin (20x) Write a script in Matlab that finds the brackets (subintervals) where all the zero crossings are occurring nterval from [0,1] where the subinterval size is o Submit the script as a m file. (Note: Script is a list of commands which is different from functions) Hint: Initialize the following variables within your script then follow a similar code as the one presented in the lecture. Xmin 0; Xmax 1; Interval 0.001; n 0; You may plot the function to provide you with a visualization of the zero locations.

Explanation / Answer

SAVE THE FOLLOWING CODE IN MATLAB AND GET THE RESULTS. The output is also attached below-

clc
clear
close all;
xmin=0;
xmax=1;
interval=0.001;
x=xmin:interval:xmax;
f=exp(-4.*x).*(sin(20.*x));
plot(x,f,'r*--')
grid on
numberOfZeros=numel(f)-nnz(f);
disp('Number of zeros = ')
disp(numberOfZeros)