We call this as Script or function
显示 更早的评论
Function has input and output. If it is only has input or only has output, we called this script or still function?
采纳的回答
更多回答(1 个)
per isakson
2016-1-19
A script operates in the workspace of the caller, e.g. the base workspace. It may use existing variables and may create new variables - in the workspace of the caller.
A function operates in its own workspace. A declaration statement, ... function(...), must be the first executable line of the function. It may have input and/or output arguments, or no arguments, e.g
function HelloWorld()
disp('Hello world')
end
类别
在 帮助中心 和 File Exchange 中查找有关 Variables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!