% Produce the same result but without using a for-loop.
% Increment
dx = 35/300;
% Independent variable
x = -5:dx:30; % x = linspace(-5,30,300)
for n = 1:length(x)
if x(n) >= 9
y(n) = 15*sqrt(4*x(n)) + 10;
elseif (x(n) >= 0) && (x(n) <=>=>
y(n) = 10*x(n) + 10;
else
y(n) = 10;
end
plot(x,y), xlabel('x'), ylabel('y'), grid
on
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here