-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplslist.m
executable file
·52 lines (42 loc) · 1.47 KB
/
plslist.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
43
44
45
46
47
48
49
50
51
52
function rinds = plslist(rng, name)
% inds = plslist(rng, name)
% rng: pulse indices to be shown. Default all if not given or empty.
% single number means last n pulses.
% name: show only pulses with this name.
% inds: indices of pulses displayed
% (c) 2010 Hendrik Bluhm. Please see LICENSE and COPYRIGHT information in plssetup.m.
global plsdata
if nargin < 1 || isempty(rng)
rng = 1:length(plsdata.pulses);
end
if rng(1) <= -1;
rng = length(plsdata.pulses)+rng:length(plsdata.pulses);
end
pulses = plsdata.pulses(rng);
if nargin >= 2
inds = strmatch(name, {pulses.name});
rng = rng(inds);
pulses = pulses(inds);
end;
if nargout >= 1
rinds = rng;
else
fprintf('%-6s %-10s %-10s %-10s %-10s\n', 'pulse', 'name', 'xdata', 'length', 'format')
fprintf('--------------------------------------------------\n');
for i = 1:length(rng);
if(~isempty(pulses(i).format))
switch pulses(i).format
case 'wf'
len = size(pulses(i).data.wf, 2)/(plsdata.tbase);
case 'tab'
len = max(pulses(i).data.pulsetab(1,:));
otherwise
len = nan; % not implemented
end
if isempty(pulses(i).xval)
pulses(i).xval = nan;
end
fprintf('%6d %-10s %10g %10g %-10s\n', rng(i), pulses(i).name, pulses(i).xval(1), len, pulses(i).format);
end
end
end