I don't understand why or how y(:,i) = x creates a function

f(:,i) = x makes a function f, which takes two arguments, and returns x. It doesn’t actually use either of the arguments, and it doesn’t matter that the function argument name : has special meaning in indexing (but is also the range operator) or that the other argument name i is the same as that of a local variable in the enclosing function. That’s all irrelevant.

1 Like