Skip to contents

Generates a square or rectangular matrix of zeros or ones

Usage

zeros_or_ones(n, x)

Arguments

n

scalar or 2D vector

x

value to fill matrix with

Value

n-by-n matrix filled with x

Details

This is a wrapper function to replicate the behavior of the zeros() and the ones() functions on Matlab

Note

Actually works for any x, but there's no need to bother imposing validation controls here.