i keep getting Array indices must be positive integers or logical values.
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!