The LABINDEX function returns the index of the worker. You should be able to use this number to create an unique filename:
filename = ['mytext' num2str(labindex) '.txt'];
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!