Void Function in MATLAB Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report When defining void* output in the library definition file, MATLAB specifies that the argument MLTYPE must be one of these: a typedef from the library. Use only to produce scalar data. If the library has a typedef defined for void* that uses that name, MATLAB specifies MLTYPE as the new type name in the typedef statement. The two defined arrays will be the function's output, and its input parameters will be void. When used as a function return type, the void keyword indicates that a function does not return a value. When the word void appears in the parameter list, it means that a function accepts no arguments. void functions are created and used just like value-returning functions, with the exception that they do not return a value after the function has been completed. void functions substitute the keyword "void" for a data type. A void function does something and then gives control back to the caller, but it doesn't return a value. Syntax: input parameters = function name; output parameters % Declarations end Output parameters define the function's returning variablesfunction name specifies the function's name.The function's input arguments are called input parameters.Here are a few MATLAB examples showing how to use functions: Example 1: Matlab % MATLAB code for Void function function[]=drives(driver,drive) % DRIVES Adds drives between the name of drive and driver % Detailed explanation goes here string1= [driver,'drives',drive]; disp(string1) end Output: Example 2: Matlab % MATLAB code for Void function function[]=plays(cricketer,game) % PLAYS Adds PLAYS between the name of game and cricketer % Detailed explanation goes here string1= [game,'plays',play]; disp(string1) end Output: Comment More infoAdvertise with us Next Article Map Function in MATLAB S sudarshandixit29 Follow Improve Article Tags : Software Engineering Technical Scripter 2022 Similar Reads Functions in MATLAB 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 5 min read Nested Functions in MATLAB Functions in any programming language are some blocks of code, which could be reused whenever required, by just calling the name. It reduces so much of human effort and also rewriting of the same code, and makes the entire code big. Declaring a Function: To declare a function in MATLAB we use given 2 min read Private Functions in MATLAB Private functions are useful when you want to limit the scope of a function. Here we will learn how to create private functions and also use them. Private functions are primary functions that are visible only to a limited group of other functions. Generally, we make private functions, if we want to 2 min read Map Function in MATLAB A map function basically takes the elements of the array and applies a function to each element.  The resultant output is of the same shape as the array, but the values are the result of the function. In MATLAB, there is a similar function called arrayfun(), which we can be used to achieve the same 2 min read Find() function in MATLAB The find() function in MATLAB is used to find the indices and values of non-zero elements or the elements which satisfy a given condition. The relational expression can be used in conjunction with find to find the indices of elements that meet the given condition. It returns a vector that contains t 3 min read Trigonometric Functions in MATLAB In this article, we are going to discuss trigonometric functions and their types in MATLAB. Trigonometric functions are the mathematical functions that can result in the output with the given input. There are six trigonometric functions - Sine (sin)Cosine(cos)Tangent(tan)CoTangent(cot)Secant(sec)Co 5 min read Like