create 3 x 5 empty logical variable in matlab

To create a 3 x 5 empty logical variable in MATLAB, you can use the false function and define the size of the matrix as follows:

main.m
A = false(3, 5);
17 chars
2 lines

This will create a 3 x 5 matrix filled with logical false values. You can also use the true function to create a logical matrix filled with true values.

main.m
B = true(3, 5);
16 chars
2 lines

Or, you can create an empty logical variable of a specific size using the logical function and define the size of the matrix as follows:

main.m
C = logical(zeros(3, 5));
26 chars
2 lines

This will create a 3 x 5 matrix of logical zeros. You can use zeros, ones, or any other numerical function instead of false and true to create an empty logical variable of a specific size.

gistlibby LogSnag