Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data = load('Test 2, Trial 4')
- tInterval = 3.2 * 10^-8;
- %Bounds
- a = 70000;
- b = 77000;
- %Index Values
- firstIndex = 0;
- secondIndex = 0;
- %Variables used to store indexes
- tempVal = 0;
- currVal = 0;
- for i = a:b %Finds the first value
- tempVal = data.A(i)
- if tempVal < currVal
- currVal = tempVal;
- firstIndex = i;
- break
- end
- end
- newAmpVal = currVal * 1/exp(1); %Finds the value that is 1/e of the initla amplitude
- for i = firstIndex:100000
- tempVal = data.A(i)
- if tempVal >= newAmpVal %Only triggers when at the correct index
- secondIndex = i;
- break
- end
- end
- cTimeConst = secondIndex * 3.199999909497819e-08 - firstIndex * 3.199999909497819e-08
Advertisement
Add Comment
Please, Sign In to add comment