changing warning messages to use MATLAB's warning function