Hi Ian,
It would be much easier to give you advice if you provided us with more information about why you are doing what you are doing, what part doesn't work and what errors you are getting.
However, looking at your code my first suggestion is to use 'path' as the data type for the "filename" input instead of 'string'. Also try to specify the absolute path to the .mat file. To do this the easiest, replace the string constant with a 'Path Constant' and then choose 'Change to Control'. You can now browse to the file from the front panel control using the Browse Button.
- Philip Courtois, Thinkbot Solutions