About 29,900,000 results
Open links in new tab
  1. function - Declare function name, inputs, and outputs - MATLAB

    function [y1,...,yN] = myfun(x1,...,xM) declares a function named myfun that accepts inputs x1,...,xM and returns outputs y1,...,yN. This declaration statement must be the first executable line of the function. Valid function names begin with an alphabetic character, and can contain letters, numbers, or underscores.

  2. and - Find logical AND - MATLAB - MathWorks

    This MATLAB function performs a logical AND of inputs A and B and returns an array or a table containing elements set to either logical 1 (true) or logical 0 (false).

  3. How To Use | and || Operator in MATLAB? - GeeksforGeeks

    Apr 24, 2025 · In MATLAB, | and || are both logical operators that are used to perform logical OR operations on Boolean variables, however, there is a subtle difference between the two: The element-wise logical OR operator “|” takes two arrays of the same size and returns an array of the same size where each element is the result of the logical OR ...

  4. and - Logical AND for symbolic expressions - MATLAB - MathWorks

    To convert symbolic symtrue and symfalse to logical values, use logical. This MATLAB function represents the logical AND.

  5. What is the @ operator (at sign) in MATLAB? - Stack Overflow

    Jan 20, 2010 · The @ operator creates a function handle, something that allows you to easily create and pass around a function call like a variable. It has many nice features, none of which are available to you unfortunately. This is because as you suspect, it was not introduced into matlab until version 7, the release immediately after yours.

  6. How to create a function in MATLAB - GeeksforGeeks

    May 6, 2021 · Below are some examples that depict how to use functions in MATLAB: Example 1: Function with one output. The function calculates the mean of the input vector. Output : Example 2: Function with multiple outputs. The function calculates both nCr and nPr of inputs n and r. Output : Example 3: Multiple functions in a file.

  7. MATLAB Logical Operators - Online Tutorials Library

    MATLAB offers two types of logical operators and functions − Element-wise − these operators operate on corresponding elements of logical arrays. Short-circuit − these operators operate on scalar, logical expressions.

  8. Chapter 8: Functions and Function Handles – A Guide to MATLAB

    How to Create a Function in MATLAB. A function can be created in a similar method to normal scripts. By having the first line of a function contain the function command, the script will be saved as a function file and not as a .m MATLAB script.

  9. How to Create a Function in MATLAB - Delft Stack

    Feb 2, 2024 · A function in Matlab consists of mainly three things output, input, and function name. To define a function, we use the variable function, and then we define the outputs, the function name, and the inputs of the function.

  10. matlab - What is a function handle and how is it useful ... - Stack ...

    May 16, 2017 · A function handle is a simple way to create a function in one line. For example, suppose I wished to numerically integrate the function sin(k*x), where k has some fixed, external value. I could use an inline function, but a function handle is much neater. Define a function. k = 2; fofx = @(x) sin(x*k);

Refresh