-
Notifications
You must be signed in to change notification settings - Fork 0
/
read_k.m
32 lines (27 loc) · 693 Bytes
/
read_k.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
function [k, gradobj] = read_k(idTraj, pathTrajData);
% Loads previously created trajectory from file and returns it alongside
% gradient object
%
% [k, gradobj] = read_k(idTraj, pathTrajData);
%
% IN
%
% OUT
%
% EXAMPLE
% read_k
%
% See also
%
% Lars Kasper (c) 2020-03-12
fileGradient = 'gradientsFull.txt';
fileGradient = fullfile(pathTrajData, num2str(idTraj), fileGradient);
if ~isfile(fileGradient)
fileGradient = 'gradients.txt';
fileGradient = fullfile(pathTrajData, num2str(idTraj), fileGradient);
end
gs = GradientSystem();
gs.MAX_GRADIENT = 0.031;
gradobj = GradientWriter(gs,GradientWriterInput());
gradobj.loadFromTxt(fileGradient);
k = squeeze(gradobj.GetK());