Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please answer this question in less than 30 minutes. use matlab or octave to code. DO NOT USE for or while loops, reshape commands. ONLY
please answer this question in less than 30 minutes. use matlab or octave to code. DO NOT USE for or while loops, reshape commands. ONLY USE vectors, matrices, functions, or if statements
(Computing Things) In this problem, you'll compute a complicated function. The value computed will depend on an integer parameter simply called a below. The other inputs are a function f and another scalar value I. Specifically, the function value depends on the following cases: (a) If a is an odd number between 14 and 352, then you should return the value f(5x). (b) If a is less than 14 or greater than 352, then you should return 1 if f() is non- negative, and return -1 if f(x) is negative. (c) For all other values of a, you should return f(x2) if I is positive, return 0 if x is 0, and return f(-r) is x is negative. compute_things Function: Input parameters: a scalar integer representing a an anonymous function representing f a scalar value representing 2 Output parameters: a scalar representing the desired value described above Possible sample cases are: >> y = compute_things (11, Q(x) x, 1.5) y = 1 >> y = compute_things (17, Q(x) x, 1.5) y = 7.5000 >> y = compute_things (16, (x) x, 1.5) y = 2.2500 >> y = compute_things (500, @(x) sin(x), 0) y = 1Step 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