Answered step by step
Verified Expert Solution
Question
1 Approved Answer
no use of if, for, or any kind of loop! 4. Write a MATLAB function called myfun.m that has two inputs, x (vec- tor) and
no use of if, for, or any kind of loop!
4. Write a MATLAB function called myfun.m that has two inputs, x (vec- tor) and a (scalar), and one output, y (vector). The output y should be the same size as x and defined as r(n) >a y(n) 0, r(n) = a -1, r(n)> >> myfun ( [0.2 0.9 0.6 -0.1 1.2], 0.6) ans = -1 1 0 -1 1 Your program should not use any for or while loops and it should not use any if statements. Your program need not do any error checking. For full credit, write the correct syntax for a MATLAB function (the full contents of the .m file)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