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

조회 수: 2 (최근 30일)
Monali
Monali 2015년 1월 20일
편집: Stephen23 2015년 1월 20일
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에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by