How to Suppress a Function?
3 ビュー (過去 30 日間)
When I run the code below, MATLAB runs it and I get the error “Not enough input arguments”. Isn’t there any way to tell MATLAB to wait to call the function until I execute, for example, average(5)?
function y = average(x)
y = sum(x)/length(x);
Jan 2017 年 2 月 26 日
The question is not clear. Calling the shown code does not cause an error:
runs fine. It would only fail, if it is called without inputs. Please post the complete error message to reveal the actual problem. Explain, which action causes the error.