Question: In MatLab Write a function batch file called plotSinusoidalFunction.m with the input arguments A,a,b. Where A=3, a=5, b=.2 The function should return f and t

In MatLab

Write a function batch file called plotSinusoidalFunction.m with the input arguments A,a,b. Where A=3, a=5, b=.2 The function should return f and t vectors. Then run the function call as:

[f1, t1] = plotSinusoidalFunction(1,2,.3);

[f2, t2] = plotSinusoidalFunction(4,5,.6);

You can also manually plot the function on the command line:

plot(t1,f1,t2,f2)

What I've done so far:

clc; clear;

A = 3; a = 5; b = .2; t = linspace(0,10,100); f = A.*cos(a.*t).*exp(-b.*t); plot(t,f); title('Title'); xlabel('time'); ylabel('f'); grid; function [ sin_function ] = plotSinusoidalFunction( A, a, b )

t = linspace(0,10,100);

sin_function = A.*cos(a.*t).*exp(-b.*t);

end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!