i keep getting Array indices must be positive integers or logical values.
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!