About 80,700 results
Open links in new tab
  1. function - Declare function name, inputs, and outputs - MATLAB

    This MATLAB function declares a function named myfun that accepts inputs x1,...,xM and returns outputs y1,...,yN.

  2. How to create a function in MATLAB - GeeksforGeeks

    May 6, 2021 · A function is a block of statements that intend to perform a specific task. Functions allow the users to reuse the code frequently. MATLAB has several predefined functions which are ready to use such as sin(), fact(), cos() etc. MATLAB also allows the users to define their own functions. Syntax: function output_params = function_name(iput_params)

  3. Function Creation - MATLAB & Simulink - MathWorks

    Functions contain one or more sequential commands and can accept inputs and return outputs. When you have multiple lines of code, use the function keyword to define a function within a file. For instance, this function adds tax to a price. tax = price.*taxrate; total = price + tax; end.

  4. How to Call a Function in MATLAB: Simple Walkthrough - wikiHow

    Mar 6, 2025 · How to Call a Function in MATLAB Start your script with function followed by the name you want to assign it. After writing your function in the script editor, call it using the format yourfunction(inputvalue1, inputvalue2, inputvalueN ).

  5. Functions in MATLAB - GeeksforGeeks

    Aug 16, 2021 · Methods are also popularly known as functions. The main aim of the methods is to reuse the code. A method is a block of code which is invoked and executed when it is called by the user. It contains local workspace and independent of base workspace which belongs to command prompt. Let’s take a glance of method syntax. Syntax:

  6. User defined function in MATLAB - GeeksforGeeks

    Aug 20, 2020 · Functions let you do a specific task. User defined functions are the functions created by the users according to their needs. This article explains how the user defined function in MATLAB is created. Function name is required, …

  7. 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.

  8. The How and Why of Writing Functions - MathWorks

    Increase code modularity and flexibility by writing custom functions. Debug functions, set the MATLAB path, and understand function precedence to resolve ambiguity in command and function names.

  9. MATLAB Functions - Online Tutorials Library

    MATLAB Functions - Explore the essential MATLAB functions to enhance your programming skills. Learn how to use built-in functions effectively for data analysis and visualization.

  10. 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.

  11. Some results have been removed
Refresh