Undoing a Tony's Trick

조회 수: 5 (최근 30일)
Jacqueline Chrabot
Jacqueline Chrabot 2021년 3월 4일
댓글: Jacqueline Chrabot 2021년 3월 5일
Is there a specific format for undoing a Tony's trick? I used tony's trick in a for loop earlier on in my script but now I need to correlate depth values with specific times so I need to reverse the tony trick to get the original date and times back.
  댓글 수: 12
Image Analyst
Image Analyst 2021년 3월 5일
I agree with Adam - just save it so you'll have it when you need it again.
Otherwise, attach what you have in a .mat file and tell us what you want to obtain from that variable. It will make it so much easier for people to help you if you give us the variable you're starting with and tell us what you want as the result.
Jacqueline Chrabot
Jacqueline Chrabot 2021년 3월 5일
I'm trying to write a for loop that finds the max depth per hour and the time associated with it. The time is found in databin{}.Var1 and depth is databin{}.Var7. However, date is all the same since I used Tony's trick originally so I could clean the data. I want to eventually get a speed by finding the difference between each depth change and time change (distance traveled over time it took). I'm trying to find a species swimming speed in the water column by using the distance they travel up and down the water column and the time it takes them. The data in datafi, 16 tables, is the data from one cast and the species movement over a 24 hour time period.
for i=1:length(databin);
temp=databin{i};
temp=temp(:,Varnum1);
% time=databin{i};
% time=time(:,datafi.Var{1}); problem with time because its all the
% same
depth=databin{i};
depth=depth(:,Varnum2);
depthdif = diff(depth(1:end -1));
timedif(i)= diff(time(1:end-1));
ss = timedif(i)/depthdif(i); %%%theres no difference in time
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by