正在加载图片...
User-Defined Function User-defined functions are stored as m-files. each must start with a function definition line that contains the word " function one or several variables that defines the function output a function name and one or several variables used for the input argument Save the function as M-file using the same name in your function · Some examples function output=my function(x) function [outputl, output2]=my function(x1, x2, 3) Hints: The function name and the names of the input and output variables are arbitrary and selected by the programmer, but the word function can not be changedUser-Defined Function • User-defined functions are stored as M-files. Each must start with a function definition line that contains ➢ the word “function”, ➢ one or several variables that defines the function output, ➢ a function name, and ➢ one or several variables used for the input argument. ➢ Save the function as M-file using the same name in your function • Some examples: • function output = my_function(x) • function [output1, output2] = my_function(x1,x2,x3) • Hints: The function name and the names of the input and output variables are arbitrary and selected by the programmer, but the word “function” can not be changed. 11
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有