how to define a function in matlab so that we can call it?

1 次查看(过去 30 天)
e.g. function [e,w]=blocklms (mu,M,u,d);

采纳的回答

Stephen23
Stephen23 2015-1-20
编辑:Stephen23 2015-1-20
Basic function syntax is like this:
function [e,w] = blocklms(mu,M,u,d)
% Your code here:
e = mu*M;
W = u-d;
%
end
Save this in an M-file with the same name as the function itself, and then you can call your function from the command line, a script, or from any other function. For more information read the documentation, which also includes lots of nice examples:

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by