I have two columns with TrialNumber and Minutes in the table tt (please see attached).
I'm trying to get the Minutes to start from 0 for each of the trials. To do this, I am trying to subtract every element from the first element in a trial and that will restart time for each trial and have each trial start from 0.
I've attempted this with a for loop but it doesn't seem to be working:
allTrials = unique(tt.TrialNumber);
for ii = 1:length(allTrials)
bb = find(tt.TrialNumber == allTrials(ii));
for jj = 2:length(bb)
nn(jj) = tt.Minutes(bb(jj)) - tt.Minutes(bb(1));