-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfinalizeResults.m
executable file
·42 lines (40 loc) · 1.9 KB
/
finalizeResults.m
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
function results = finalizeResults(maxIndex, state)
% finalizeResults Truncates trajectory arrays and creates acceleration results structure
% Inputs:
% maxIndex Last used index in results arrays
% (results will be truncated up to this index)
% time Time array
% distance Distance travelled over time
% velocity Velocity of pod over time
% acceleration Acceleration of pod over time
% phase Phase of the LIM field over time
% frequency Frequency of the LIM field over time
% fx Total force in x-direction over time
% power Power over time
% powerLoss Power loss over time
% powerInput Power input over time
% efficiency Efficiency over time
% slip Slips over time
%
% Output:
% [ results ] Result structure
% @author Rafael Anderka
% HypED, 03/11/2018
% Create results structure while truncating each array up to 'maxIndex'
results = struct;
results.time = state.time(1:maxIndex);
results.distance = state.distance(1:maxIndex);
results.velocity = state.velocity(1: maxIndex);
results.velocitySync = state.velocitySync(1: maxIndex);
results.acceleration = state.acceleration(1:maxIndex);
results.phase = state.phase(1:maxIndex);
results.frequency = state.frequency(1:maxIndex);
results.DSLIMForce = state.DSLIMForce(1:maxIndex);
results.brakesForce = state.brakesForce(1:maxIndex);
results.fx = state.fx(1:maxIndex);
results.power = state.power(1:maxIndex);
results.powerLoss = state.powerLoss(1:maxIndex);
results.powerInput = state.powerInput(1:maxIndex);
results.efficiency = state.efficiency(1:maxIndex);
results.slip = state.slip(1:maxIndex);
end