Does your script work fine in MATLAB? Do you run a VI or an .exe?
MATLAB must be running, otherwise LabVIEW will be unable to access the MATLAB server. This will cause the 1047 error. Manually start MATLAB, and your program should run without the error.
The following KnowledgeBase may also be useful in troubleshooting this issue
LabVIEW 6.x and Earlier Does Not Interface Properly with MATLAB 6.1 or MATLAB 6.5Zvezdana S.
National Instruments