function write_table(fid, T, rowfmt)
                % Expects T as [Pole, PtNum, X, Y, Z]
                validateattributes(T, {'numeric'}, {'ncols',5});
                for i = 1:size(T,1)
                    fprintf(fid, rowfmt, T(i,1), T(i,2), T(i,3), T(i,4), T(i,5));
                end
            end