As far as I know, there is no better way to achieve this in Matlab, here it is also offered here . Just keep in mind that Matlab will not detect multiple ratings of the same term. If you do things like:
foo = @() 1+1
bar=@()foo()*foo()
He will evaluate foo twice. Instead, the "traditional" way will evaluate it once:
foo=1+1
bar=foo+foo
source
share