About 2,800 results
Open links in new tab
  1. Logical (Boolean) Operations - MathWorks

    MATLAB ® represents Boolean data using the logical data type. This data type represents true and false states using the numbers 1 and 0, respectively. Certain MATLAB functions and operators return logical values to indicate fulfillment of a condition.

  2. logical - MathWorks

    Pick out the odd-numbered elements of a numeric matrix. Create a numeric matrix. Find the modulus, mod(A,2), and convert it to a logical array for indexing. 1 1 0. 1 0 1. 0 1 1. The array has logical 1 (true) values where A is odd. Use L as a logical index to pick out the odd elements of A. -3.

  3. How to convert string variable into boolean in Matlab?

    Oct 6, 2016 · my goal is to convert such variable into a boolean variable: is there a matlab function that allows me to convert the string into a boolean value? If there are no functions that allow to do that what could be another possible solution? In Matlab it is called logical. Is it always 'true' or 'false'? Why not just strcmpi(a,'true')?

  4. create boolean in matlab - gistlib

    In MATLAB, you can create boolean (logical) variables using the values true and false. Here are a few ways to create boolean variables in MATLAB: b = 10; myBool = (a < b); % Result: true % Logical operators andBool = (a < 10) && (b > 5); % Result: …

  5. Matlab boolean | Learn how to use Boolean operators in MATLAB

    Mar 6, 2023 · Guide to Matlab boolean. Here we discuss how to use logical or Boolean operators in MATLAB along with the Examples and outputs.

  6. Boolean Variables in MATLAB - Ian's Guides

    Boolean variables, or bools, are logical values. For example, this could be true and false, 1 and 0, etc. Boolean variables allow us to use conditional logic in order to more precisely execute the code or paths we would like.

  7. Mastering Matlab Boolean: A Quick Guide

    In MATLAB, boolean values represent logical true or false states, often used for conditional statements and indexing within arrays. Here's a simple code snippet demonstrating boolean operations in MATLAB: disp (['OR Result: ', num2str(result_or)]); Boolean logic operates on two distinct values: true and false.

  8. true - MathWorks

    true is shorthand for the logical value 1. T = true(n) is an n -by- n matrix of logical ones. T = true(sz) is an array of logical ones where the size vector, sz, defines size(T). For example, …

  9. Logical (Boolean) Operations - MathWorks

    MATLAB ® represents Boolean data using the logical data type. This data type represents true and false states using the numbers 1 and 0, respectively. Certain MATLAB functions and operators return logical values to indicate fulfillment of a condition.

  10. How to use a boolean? - MATLAB Answers - MATLAB Central

    Feb 28, 2019 · For the following code, I'm trying to say that if the rocket is turned on, the thrust is 1950 lb and if the rocket is turned off, the thrust is 0 lb. I have raw-coded it but I would prefer it as a function with boolean operators. Is there any simple …

  11. Some results have been removed
Refresh