Search this blog!

Showing posts with label TRUE FALSE MATLAB. Show all posts
Showing posts with label TRUE FALSE MATLAB. Show all posts

Thursday, December 15, 2011

How to use binary variable/ TRUE FALSE in MATLAB?

You know in C++ you may write the following

bool binary_variable=TRUE; // Or FALSE

But How to do that in MATLAB?

>>true([m, n])
This will create an m-by-n matrix of binary (logical) ones // TRUE
>>false ([m, n])
For m-by-n matrix of binary (logical) zeros // FALSE