Table Of Contents


    Last Modified: December 12, 2016

    Generates a logical array of ones.


    c = true(a)
    c = true(a, b)
    c = true(a, b, ...)
    c = true(v)



    Number of rows for the Boolean array. a is a non-negative integer. If a is zero, the function returns an empty array.


    Number of columns for the Boolean array. b is a non-negative integer. If b is zero, the function returns an empty array.


    Further parameters for specifying the number of elements in higher dimensions. You can replace one parameter for any dimension with an empty array, for example, reshapemx([1,2,3,4,5,6], 2, []). The array then is a placeholder for an unspecified size. MathScript uses the array size and the reshape size to calculate the unspecified size automatically.


    Vector with number of rows, columns, and further dimensions. The elements of v are non-negative integers.



    Array of Boolean ones of any dimensions. If you only specify a, c returns a square matrix of length a.

    Difference to the Ones Function

    The array created by the true function is different from the array of double-precision, floating-point numbers that the ones function generates, because a logical array can hold values of 0 or 1 only.

    C = true(3, 5)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: DAQExpress does not support FPGA devices

    Recently Viewed Topics