#! /bin/bash
#
matlab -nodisplay -nosplash -nodesktop -batch \
  "run('lbm.m');exit;" > lbm.txt
if [ $? -ne 0 ]; then
  echo "Run error."
  exit
fi
#
convert -delay 100 -loop 0 ./lbm_output/*.png lbm.gif
if [ $? -ne 0 ]; then
  echo "Animation error."
  exit 1
fi
rm -r lbm_output
#
echo "Normal end of execution."
