Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed 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

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_2

Step: 3

blur-text-image_3

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions