The Matlab script node has got an input and output error connector.
So by using this you will be able to generate an error code and debug your Matlab script.
But as an advice, it is always better to work first in Matlab and then import the script in LabVIEW
Yann Leray
Scientist
Unilever Research