using Matlab , show step using if, elseif , else statements. Problem A2: The rel
ID: 2084300 • Letter: U
Question
using Matlab , show step using if, elseif , else statements.
Explanation / Answer
x1='enter lower limit of x ';
x2='enter upper limit of x';
input(x1,'s');
input(x2,'s');
x=linspace(x1,x2);
a='enter value of a';
input(a)
if(a<0)
warning('Plesae enter positive values only');
abs(a);
end
if(x<=a)
y=0;
elseif(x>a)
y=x-a;
elseif(x<-a)
y=x+a;
end
display(y);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.