unwrap() does not unfold straight lines
Reported by Luis Lima
BUG DESCRIPTION:
----------------
Using the 'unfold' option in unwrap() does not work as expected for straight lines.
HOW TO REPRODUCE THE BUG:
-------------------------
--> x = linspace(0,10,1000);
--> y = acos(cos(x));
--> r = unwrap(y,'unfold');
--> plot2d(x',[x;y;r]');
--> legend('Original','Folded','Unfolded');
OTHER INFORMATION:
------------------
It doesn't matter what the slope is, but if it is close to a straight line but not that straight, it works. Try
--> y = acos(cos(x.^(1.0001)));
and it works.