Zampano <email@example.com> wrote in message <firstname.lastname@example.org>... > Matlab allows me to call the size function without parentheses. When > I do, I get unexpected results. See the example below. What's going > on? I'm using Matlab R2010a on a Mac. > > Rick > > >> r = [1 2 3] > > r = > > 1 2 3 > > >> size r > > ans = > > 1 1 > > >> size(r) > > ans = > > 1 3 > > >> r2 = size r > ??? r2 = size r > | > Error: Unexpected MATLAB expression.
That's called "command syntax", as opposed to "function syntax". It's like a Unix commands - the arguments are space-delimited strings, instead of comma-delimited expressions. No result is returned, so trying to assign the nonexistent output to a variable gives an error.