Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

Call Functions

These examples show how to call a MATLAB® function. To run the examples, you must first create numeric arrays A and B, such as:

A = [1 3 5];
B = [10 6 4];

Enclose inputs to functions in parentheses:

max(A)

Separate multiple inputs with commas:

max(A,B)

Store output from a function by assigning it to a variable:

maxA = max(A)

Enclose multiple outputs in square brackets:

[maxA, location] = max(A)

Call a function that does not require any inputs, and does not return any outputs, by typing only the function name:

clc

Enclose text inputs in single quotation marks:

disp('hello world')

Related Examples


Was this topic helpful?