MATLAB: MZDDE tool box

dlmreadmzddereadcoldata

Hallo, I tried to get the PSF cross section data in the form of a text by zemax-matlab integration using zGettextfile function. But the problem is that I cannot read the text file which is obtained from this function. I used readcoldata function which gives the following error
"Assignment has more non-singleton rhs dimensions than non-singleton
subscripts
Error in readColData (line 95)
labels(n,1:length(next)) = next; % append to the labels matrix
Error in test2 (line 4)
[labels,x,y]=readColData('C:\Users\etesam\Documents\MATLAB\jjj.txt',3,15); % reads the data
ignoring the headers."
Then, I tried with dlmread function which gives this error
"Index exceeds matrix dimensions.
Error in dlmread (line 146)
result = result{1};
Error in test2 (line 6)
M = dlmread('C:\Users\etesam\Documents\MATLAB\jjj.txt','\t',16,1);
Please suggest!
Thank you.
P.S: As soon as I copy it and make a new text file it works!

Best Answer

Ok. The problem was zemax creates a unicode text file which cannot be accessed by the above functions. So, I converted it to ASCII format using unicode2ascii() function.Then using readColData() to extract the target content.Works Fine!