MATLAB: ~ in function definition function definition statement Looking at some previous code I found a function that is defined as function(x,y,z]=fun(~,~,~) what are the ~ doing in the input list? Best Answer The function input will be ignored. It is described here:http://blogs.mathworks.com/loren/2009/09/11/matlab-release-2009b-best-new-feature-or/ Related SolutionsMATLAB: About function definition That happens automatically with a normal function definition. MATLAB: How to create a function without getting this Error: Function definitions are not permitted in this context Only anonymous functions may be defined in the command window: >> fun = @(x,y,z)-9*x - 10*y+ z*(-log(100-x-y)-log(x)-log(y)-log(50-x+y)); >> fun(1,2,3) ans = -56.599051375363Other function types (those defined using the keyword function) must be defined in an Mfile. Related QuestionQuestion re symbol ~Function definitions are not permitted in this contextElementwise multiplication, function definitionSyntax and code in function parameter for ~
Best Answer