1function C = ones (varargin) 2%ONES a matrix with all ones. 3% 4% C = ones (n) ; n-by-n GrB double matrix of all ones. 5% C = ones (m,n) ; m-by-n GrB double matrix of all ones. 6% C = ones ([m,n]) ; m-by-n GrB double matrix of all ones. 7% C = ones (..., type) ; matrix of all ones of given type. 8% C = ones (..., 'like', G) ; matrix of all ones, same type as G. 9% 10% Since function overloads the MATLAB built-in ones(...), at least one 11% input must be a GraphBLAS matrix to use this version; for example, 12% C = ones (GrB (n), 'int8'). 13% 14% See also GrB/zeros, GrB/false, GrB/true. 15 16% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. 17% SPDX-License-Identifier: GPL-3.0-or-later 18 19[m, n, type] = gb_parse_args ('ones', varargin {:}) ; 20C = GrB (gb_scalar_to_full (m, n, type, gbformat, 1)) ; 21 22