A colleague was removing the offset of her capured data time vector (subtracting the first element from all elements such that the new time vector starts at time t = 0) when she encountered a problem. For a column vector a, the command a = a – a(1,:) only subtracts a(1,:) from some of the first elements.
Code to recreate the problem:
a = 0.01*transpose(1:2048) + 0.7;t = transpose(1:2048) - 1;b = a - a(1,:);a = a - a(1,:);plot(t,a,t,b);legend('a','b');
Best Answer