Jakub - try adding a semi-colon after
title(['t = ', num2str(t)]);
so that it is distinct from the
Or write each command on separate lines (like you do later in the code). Note that you will see other errors as your code tries to reference the variable red which is not defined and would be cleared by the clear all.