It seems like you have overridden a built-in function ( rot90
or sum
) with variable name.
Type
>> dbstop if error
And run your code.
When the error occurs type
K>> which rot90
K>> which sum
See if you get a built-in function or a variable name.