Problem solved; external diff function caused bad behavior; deleting this external function solved the problem.
Strange behavior of diff()
6 views (last 30 days)
I'm using 2012b and I'm trying to find the difference between successive elements of a vector of uint64 numbers. Here's some of them, but I get very puzzling results form diff(). For instance:
a = [4648759972
Then diff(a) gives the wrong result:
However diff(a(1:2)) gives the correct result: 0. Also diff(a(2:3)) gives the correct result: 2861750
I've been searching for an explanation but I did not find a similar problem ever reported, and I don't understand what is happening. Can anybody explain to me what is going on here?
Thanks a lot!