MATLAB: Do I get incorrect output when I run a command like “number*su​m(x{1}(1:e​nd).^integ​er)” in MATLAB 7.12 (R2011a)

MATLAB

I get incorrect output (ans = 0) when I run the following code:
x{1} = [1 2 3 4 5];
mySum = sum( (x{1}(1:end)).^2 )
1 * sum( (x{1}(1:end)).^2 )
The result must match (ans = 55):
sum( (x{1}(1:end)).^2 )
The only difference is the 1 which is pre multiplied.
This appears to be an error in the parsing mechanism.

Best Answer

This bug has been fixed in Release 2012a (R2012a). For previous product releases, read below for possible workarounds:
There is a bug in the way MATLAB 7.10 (R2010a) parses the commands.
Possible workarounds are as follows:
1) Use the undocumented FEATURE function
feature accel off
2) Use POWER instead of the operator.
1 * sum(power( (x{1}(1:end)),2) )
instead of
1 * sum( (x{1}(1:end)).^2 )
NOTE: This bug seems to be present only if
1) The power is integer.
2) END is used instead of the length of the vector.