i keep getting Array indices must be positive integers or logical values.
Mostrar comentarios más antiguos
i keep getting Array indices must be positive integers or logical values and i have no idea how to slove this. i even trying looping it
x = linspace(-3,5,100)'
plot(x,mywierdfcn(x))
function f = mywierdfcn (x)
if x > 2
f(x) =x.^2;
else x <= 2
f(x) = 2*x;
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!