ceil function is wrong..??
x=-5:0.1:5;
y=ceil(x);
plot(x,y);
axis([-5 5 -5 5]);
title('y=ceil(x)');
1
vote

The ceil function is working properly. You may be experiencing an issue involving floating-pooint arithmetic.