-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.m
More file actions
82 lines (56 loc) · 1.77 KB
/
Copy pathmain.m
File metadata and controls
82 lines (56 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Motion Studio
% MAE5070 - FLIGHT Dynamics
% Data check and plot
% Beatriz Asfora
% Mar 2024
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add this command so MATLAB can find the necessary functions
addpath classes/
% handy commands
clear, clc, close all
set(0,'defaulttextinterpreter','latex')
warning('off','all')
% ------------------------------------------
% save files inside mydata
sessionfolder = "mydata";
% close figures after saving them; 1 to close, 0 to leave them open
closeplot = 0;
% ------------------------------------------
% create obj to use class methods
session = MyBatch;
session = session.newBatch("data/", sessionfolder);
% trackingData/myfolder/"
fpath = session.folderpath;
for k = 1:session.nFiles
% name of the file within session folder
fname = session.getfname(k);
% new take obj
take = MyTake;
% collect data and runs checks
take = take.new(fname, fpath);
% ----------------
% get data for analysis
[time, positionG, rotationG] = take.getData;
plotfoldername = strcat("plots", "_", sessionfolder);
% -----------------
% new glider obj
glider = MyGlider;
glider = glider.new(time, positionG, rotationG);
% input glidername and takename for easy access
glider = glider.source(take.commoname, take.name);
% plot
% glider.plotOriginal(plotfoldername, closeplot) % comment when not debugging
glider.plotStudio(plotfoldername, closeplot)
%% Glider data
% position wrt SO
positionB_SO = glider.posB_O;
% rotation body wrt SO
rotationB_SO = glider.rotB_O;
% height
height = glider.height;
% time
time = glider.time;
% save
save(glider.takename, "time", "height", "rotationB_SO", "positionB_SO")
end