create a logical array of zeros of length 12 in matlab

To create a logical array of zeros of length 12 in Matlab, use the logical function together with the zeros function as follows:

main.m
myLogicalArray = logical(zeros(1,12));
39 chars
2 lines

This creates a row vector of length 12 containing only zeros, and then converts it to a logical array using the logical function. The resulting logical array myLogicalArray will have dimensions 1x12.

related categories

gistlibby LogSnag