Help about function with if statement

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 helpfull
function [y]=task1(x)
if x>=9
y = 15*(4*x)^(1/2)+10;
end
if (0<=x<9)
y=10*x +10;
end
if (x<0) y=10;
end

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Preguntada:

el 18 de Nov. de 2015

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by