About 75,700 results
Open links in new tab
  1. Is it possible to define more than one function per file in MATLAB, …

    Aug 26, 2010 · Program files can contain multiple functions. If the file contains only function definitions, the first function is the main function, and is the function that MATLAB associates …

  2. math - Optional args in MATLAB functions - Stack Overflow

    Jul 20, 2011 · Mathworks:Function Argument Validation. There is a detailed description about how to user optional parameters in function. Also, you can learn how to use function like build-in …

  3. Define function in matlab without using new function

    Feb 28, 2013 · @HighPerformanceMark If the function needed is very big, and needs multiple lines, even if you use anonymous function you need the help of eval. As far as I know, there is …

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

  5. MATLAB: Defining a function in terms of another function

    Jan 9, 2018 · If I have a function f(x,y), I want to know how to define another function (say g) where g(x) = f(x,y), where y has been defined beforehand, either explicitly or as the input of …

  6. Matlab defining class functions in an elegant way for OOP

    Jun 6, 2014 · Create a folder called @Cat.. The within @Cat, put the following files:. Cat.m. classdef Cat < handle properties meowCount = 0; end methods function obj = Cat() end …

  7. Constants in MATLAB - Stack Overflow

    % Define constants params.PI = 3.1416; params.SQRT2 = 1.414; % Call a function which needs one or more of the constants myFunction( params ); It's not as clean as C header files, but it …

  8. 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, …

  9. In MATLAB, can I have a script and a function definition in the …

    Mar 19, 2011 · You can have many functions in a sample file. But only the first one can act as a main function, when you run the file. Others can be used merely in this file. For some situation …

  10. Matlab - Defining a math function - Stack Overflow

    Jul 3, 2020 · defines a symbolic function. This means that there is no loss of precision when using the function. The results are always exact: >> f(1) ans = 1 Also, you can apply symbolic …

Refresh