Table Of Contents

histogram

Version:
    Last Modified: March 15, 2017

    Counts the number of values that fall in specified intervals. If you do not request an output, MathScript returns a histogram plot.

    Syntax

    histogram(x)
    histogram(x, c)
    histogram(x, m)
    n = histogram(x)
    n = histogram(x, c)
    n = histogram(x, m)
    [n, ctr] = histogram(x)
    [n, ctr] = histogram(x, c)
    [n, ctr] = histogram(x, m)
    Legacy name: hist

    Inputs

    x

    Data values. x is a matrix or an array of n dimensions.

    c

    Centers of all intervals in which you want to divide the range of x. c is a matrix. The elements in c must be in ascending order.

    m

    Number of equally spaced intervals in which to divide the range of x. m is a positive integer.

    Default: 10

    Outputs

    n

    Number of elements that fall in each interval. n is an array of integers.

    ctr

    Centers of all intervals if you do not specify c. ctr is an array.

    [N, C] = histogram(rand(1, 100), 20)
    [N, C] = histogram(rand(1, 100))
    N = histogram(rand(1, 100), 0:0.1:1)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics