0001 function varargout = pfs_read_xyz( fileName )
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 fid = fopen( fileName, 'rb' );
0016 if( fid == -1 )
0017 error( 'pfs_read_xyz: File "%s" does not exist', fileName );
0018 end
0019 fclose( fid );
0020
0021 fid = pfspopen( sprintf( '%spfsin ''%s''%s', pfs_shell(), fileName, pfs_shell( 1 ) ), 'r' );
0022 pin = pfsopen( fid );
0023 pin = pfsget( pin );
0024 pfsclose( pin );
0025 pfspclose( fid );
0026
0027 if( nargout == 3 )
0028 varargout{1} = pin.channels.X;
0029 varargout{2} = pin.channels.Y;
0030 varargout{3} = pin.channels.Z;
0031 elseif( nargout == 1 )
0032 varargout{1} = cat( 3, pin.channels.X, pin.channels.Y, pin.channels.Z );
0033 else
0034 error( 'Wrong number of output parameters' );
0035 end
0036
0037 end
0038