MATLAB: Convert from textread() to textscan()

text;textreadtextscan

I'm trying to update my code and was wondering if anyone can help with this simple question:
How would these two lines transfer over from textread() to textscan() in matlab?
[x,y,z]=textread(filename,'%f %f %f %*f %*f %*f','headerlines',3);
[X(:,k),Y(:,k),Z(:,k)]=textread(filenames,'%*f %*f %*f %f %f %f','headerlines',3);

Best Answer

Assuming the same file is being referenced for both:
fid = fopen(filename);
xyzcell = textscan(fid, '%f %f %f %f %f %f', 'HeaderLines', 3);
fclose(fid);
x = xyzcell{1};
y = xyzcell{2};
z = xyzcell{3};
X(:,k) = xyzcell{4};
Y(:,k) = xyzcell{5};
Z(:,k) = xyzcell{6};