Info
此问题已关闭。 请重新打开它进行编辑或回答。
Not enough input argumaents
1 次查看(过去 30 天)
显示 更早的评论
Hi, I am very new to matlab and I am getting that 'not enough input arguments when typing this.
function [sum]=add(x,y)
w=x+y;
disp(w);
end
0 个评论
回答(2 个)
madhan ravi
2019-7-9
编辑:madhan ravi
2019-7-9
https://in.mathworks.com/help/matlab/ref/function.html - I suggest you to read it for better understanding and further usage
x = 5; % example values
y = 2;
Result = Add(x,y)
% simply call it
function w = Add(x,y) % save the function in a separate file named as Add.m , note the name of the file should be same as the function name
w=x+y;
disp(w); %% redundant
end
Note: Don't name variables which are in-built functions of MATLAB.
6 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!