When I try to open a serial connection, MATLAB gives me an error message.

This is likely because you already have a serial connection open. You can delete all the open connections using
which should let you reopen the connection.

I'm trying to send commands using Python (/other language), but it's not working.

Make sure you have a newline character at the end of the line - MATLAB includes this automatically.

How do I install pyserial (/other python module) on DICE?
Check the School guidelines at http://computing.help.inf.ed.ac.uk/python.