About 6,150,000 results
Open links in new tab
  1. function - MathWorks

    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. Create Functions in Files - MathWorks

    Create Functions in Files. Both scripts and functions allow you to reuse sequences of commands by storing them in program files. Scripts are the simplest type of program, since they store commands exactly as you would type them at the command line.

  3. Function Creation - MathWorks

    Create Functions in Files. Store multiple commands in a program file that can accept inputs and return output. Types of Functions. There are several types of functions available with MATLAB ®, including local functions, nested functions, private functions, and anonymous functions. Anonymous Functions; Local Functions

  4. How to Create a MATLAB Function - MATLAB - MathWorks

    Sep 18, 2020 · Learn how to create MATLAB function and why functions same time and effort when writing code. Functions are tasks or a set of tasks that are performed on a given set of input that transforms the input into a desired output.

  5. Local Functions - MATLAB & Simulink - MathWorks

    This topic explains the term local function, and shows how to create and use local functions. MATLAB ® program files can contain code for more than one function. In a function file, the first function in the file is called the main function.

  6. Add Functions to Scripts - MathWorks

    Add Functions to Scripts. MATLAB ® scripts, including live scripts, can contain code to define functions. These functions are called local functions. Local functions are useful if you want to reuse code within a script. By adding local functions, you can avoid creating and managing separate function files.

  7. at symbol - MathWorks

    The at symbol (@) creates handles to anonymous and named functions, and is also used to call superclass methods from within a subclass. For instance, f = @(x,y) x+y creates an anonymous function that accepts two inputs and adds them together.

  8. Nested Functions - MathWorks

    For example, create a function in a file named makeParabola.m. This function accepts several polynomial coefficients, and returns a handle to a nested function that calculates the value of that polynomial.

  9. function - MathWorks

    For example, in a file named myFun.m in your current folder, create the myFun function. function y = myFun(x) y = x; end In a file named timingTest.m in your current folder, create a function that calls myFun .

  10. Create Symbolic Functions - MathWorks

    Create Symbolic Functions. Symbolic functions represent math functions. Use symbolic functions for differentiation, integration, solving ODEs, and other math operations. Create symbolic functions by using syms.

Refresh