| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
true
true(n)
true(m, n)
true(m, n, p, ...)
true(size(A))
true is shorthand for logical 1.
true(n) is an n-by-n matrix of logical ones.
true(m, n) or true([m, n]) is an m-by-n matrix of logical ones.
true(m, n, p, ...) or true([m n p ...]) is an m-by-n-by-p-by-... array of logical ones.
Note The size inputs m, n, p, ... should be nonnegative integers. Negative integers are treated as 0. |
true(size(A)) is an array of logical ones that is the same size as array A.
true(n) is much faster and more memory efficient than logical(ones(n)).
![]() | triu | try | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |