Theceil (link) function rounds toward+Inf. In the assignment you posted, its function appears to be to avoid a zero index, since MATLAB indices must be integers greater than zero.
Floating point numbers are how decimal values are stored in your computer: they do not have infinite precision, and they can only approximate many values. Even if itlooks like the "actual" value is being shown to you this does not mean that the internal representation inside your computer is the same value.
Lets have a quick look at those values:
>> X=[4 (1-0.95)*80]
X =
4.0000 4.0000
>> fprintf('%.30f\n',X)
4.000000000000000000000000000000
4.000000000000003552713678800501
It is not a problem with MATLAB, this is simply how (binary) computers work.
Best Answer