When LabVIEW runs a Matlab script, it simply calls Matlab and runs the script there. It would then be up to Matlab to know where your user-defined function is. My guess would be that you could modify the Matlab settings to add the user-defined function's path to be part of Matlab's search path.
Robert Mortensen
Software Engineer
National Instruments