ONES All ones. ONES(N) is an N-by-N matrix of ones. ONES(M,N) or ONES([M,N]) is an M-by-N matrix of ones. ONES(SIZE(A)) is the same size as A and all ones.