Question: Some one help me with this Matlab program ASAP thank you !! both part a and b with detail Lists of MATLAB functions and commands

 Some one help me with this Matlab program ASAP thank you!! both part a and b with detail Lists of MATLAB functionsand commands can be stored in a single file with the exten-

Some one help me with this Matlab program ASAP thank you !! both part a and b with detail

Lists of MATLAB functions and commands can be stored in a single file with the exten- sion .m. These files are called M-Files. The commands stored in an M-File can be executed by typing the filename (without the .m extension) at the command prompt. As an example, the M-File expon.m: t--2:0.01:2; y-exp(-abs (t)) plot (t,y) plots the function y(twith t ranging from -2 to 2 in 0.01 increments, when the user types expon at the command prompt. Note, that a file that defines a new function is a special case of an M-File. (a) Create an M-File named Exercise5 that generates and plots two sine waves with frequencies f = 16 Hz and f = 28 Hz. For both sine waves t ranges from 0 to 0.2 in 0.001 increments. Use sinegen to generate the sine waves. Each sine wave should be plotted in a different subplot with appropriate titles and axis labels As in all high level languages MATLAB includes an if - then - else structure that allows a group of commands to be executed when a certain condition is satisfied. For example, the following statements in an M-File will increase the variable x by 1 if it is positive and decrease it if it is negative: if x0 Pp+1; end if p>length(x) p-o; end (b) Create a function sumcomp that compares the sum of all the odd-indexed elements with the sum of all the even-indexed elements and returns: 0, if they are equal 1, if the sum of the odd-indexed elements is greater (b) Create a function sumcomp that compares the sum of all the odd-indexed elements with the sum of all the even-indexed elements and returns: 0, if they are equal, 1, if the sum of the odd-indexed elements is greater, 2, if the sum of the even-i indexed elements is greater

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!