Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question Function ( use matlab ) ( 1 ) . Create a function plotSinFunc to recognize the number of input arguments automatically. ( 2 )
Question Function use matlab
Create a function plotSinFunc to recognize the number of input arguments automatically.
If the number of input argument is we can call it like plotSinFuncf create a time series
xlinspace pi f and plot the sinx You should use squares as markers and a dashed
red line of thickness for the line. Set the marker face color to be black properties are
LineWidth, MarkerFaceColor
If there are inputs, ie function usage like plotSinFuncf f create two time series
xlinspace pi f and xlinspace pi f and, open a new figure with axes,
plot sinx on top and plot sinx on the bottom.
If the number of input arguments is other, display 'Only one or two inputs are allowed'.
Think about the possibility of a negative number as the input. How to recognize it in your
function, and try to write a robust function.
In a script m file to call the plotSinFunc with the input arguments:
a Only one arguments:
b Two arguments:
c Two arguments:
Hint: the number of input arguments are in the builtin variable nargin.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started