Traditional observers are mostly state-estimation error-based observers, which are only applied to linear systems or to some particular classes of nonlinear systems. In this paper, Moving horizon observer will be introduced in accompany with the algorithm implemented in Matlab. This is an optimization-based observer, which could be applied to any observable system. The results show that this observer can provide desirable estimates even though the system is strongly nonlinear: and when the system is linear, the estimates are not less than, even better, in terms of observation time, than the results provided by traditional observers.