The given article is devoted to the solution of the discrete optimal control problem for the system with two state variables, single input and single output. To solve this problem the method of dynamic programming was used. The algorithm proposed in  was modified so that it can be applied to problems with fixed final state. Then the script for numerical computing environment MATLAB was developed in accordance with the modified algorithm. Also the adequate model was constructed in MATLAB/Simulink, which confirmed the correctness of script’s output.
optimal control, dynamic programming, digital system