Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this matlab program part a and b ASAP with detail thank you ! MATLAB allows the user to create his own functions.

image text in transcribedimage text in transcribed

Need help with this matlab program part a and b ASAP with detail thank you !

MATLAB allows the user to create his own functions. To create a function newfun a text file must be created with the same filename as the function and the extension m, ie newfun.m. The first line of this file has the form: function [out1,out2]-newfun (inl, in2) output variable list input variable list function name We note that any number of input and output variables can be used. As an example, the following file oddeven.m defines the function oddeven that returns the odd-numbered and even-numbered elements of an arbitrary length vector. function [oddels, evenels]-oddeven(v,) oddels-v(1:2:1ength(v)); evenels-v(2:2:length(v)); a) Sinusoidal waveform generator. Let sinegen be a function whose output is a sine wave y(t)-sin(2ft). The inputs to the function should be the frequency f and the time vector t. Create the sinegen function i.e. the sinegen.m file). (b) Use sinegen to generate a sine wave with t ranging from 0 to 0.2 in 0.001 increments, and a frequency of 20 Hz. Plot the sine wave obtained in the output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago