About 33,700 results
Open links in new tab
  1. solve - MathWorks

    S = solve(eqn,var) solves the symbolic equation eqn for the variable var. If you do not specify var, the symvar function determines the variable to solve for. For example, solve(x + 1 == 2, x) solves the equation x + 1 = 2 for x.

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

  3. eq - MathWorks

    Calling == or eq for nonsymbolic A and B invokes the MATLAB ® eq function. This function returns a logical array with elements set to logical 1 (true) where A and B are equal; otherwise, it returns logical 0 (false).

  4. How to Call a Function in MATLAB - 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. How to create a function in MATLAB - GeeksforGeeks

    May 6, 2021 · The function starts with the keyword function. Returning variables of the function are defined in output_params; function_name specifies the name of the function; input_params are input arguments to the function; Below are some examples that depict how to use functions in MATLAB: Example 1: Function with one output

  6. How do I set a function to a variable in MATLAB - Stack Overflow

    function [ Ts ] = BisectionRoot( fun,a,b,TolMax ) %This function finds the value of Ts by finding the root of a given function within a given range to a given %tolerance, using the Bisection Method.

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

  8. How to Input a function equation in matlab

    Oct 3, 2018 · In order to solve for F, F must be one of the input arguments to the function. the LHS of the = sign is not valid for assignment: the LHS should be one variable, which is the value of the function when it is evaluated.

  9. Matlab: how to create a function $f(x)$ and get the value of $f(x ...

    The typical way to do this is to create a MATLAB .m file to implement your function. Open the MATLAB Editor with a blank file (File>New>Script), and in the blank file, type the following: function y = myfun(x) y = 2*x+1;

  10. How To Write An Equation In Matlab (Resolved) - Lxadm.com

    Feb 16, 2023 · With MATLAB, you can create scripts and functions to solve equations and perform a variety of other calculations. This step-by-step guide provides an overview of some of the key concepts needed to write equations in MATLAB.

Refresh