Question: Given a function below, which of the following function call and result combinations is correct? function [ y ] = compare ( x ) if

Given a function below, which of the following function call and result combinations is correct?
function [y]= compare(x)
if x <=-1
y =-x;
elseif (x <=20) && (x >0)
y =1.5x;else
y =2.5x;
end
Group of answer choices
[Y]= compare(-0.5);
Answer: Y =0.5;
[Y]= compare(200);
Answer: Y =300;
[Y]= compare(10);
Answer: Y =15;
[Y]= compare(-20);
Answer: Y =-20;

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 Programming Questions!