Help about function with if statement

1 view (last 30 days)
Janez Novak
Janez Novak on 18 Nov 2015
I have problem with creating function. I don´t know how to use command function properly. Can you guys tell me where I was wrong it will be very helpful
function [y]=task1(x)
if x>=8
y = 14*(5*x)^(1/2)+9;
end
if (-1<=x<8)
y=9*x +9;
end
if (x<-1) y=9;
end

Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!