Commit 2f13b73569577e6baf7085cc4b9b9ac366408254
1 parent
45d0ff1fae
Exists in
master
add multiple column option
Showing 1 changed file with 16 additions and 5 deletions Side-by-side Diff
allanplot.m
... | ... | @@ -4,10 +4,21 @@ |
4 | 4 | col = eval(argv(){2}); |
5 | 5 | mult = eval(argv(){3}); |
6 | 6 | |
7 | -data.freq = load(filename)(:,col).*mult; | |
8 | -data.rate = 1; | |
9 | - | |
10 | -ad = allan(data, 2.^(0:nextpow2(length(data.freq))), strsplit(filename, '/'){end}, 1); | |
11 | -input("Press to continue..."); | |
7 | +if length(col) == length(mult) | |
8 | + figure | |
9 | + hold all | |
10 | + grid on | |
11 | + cc = 'bkcgmry'; | |
12 | + for i = [1:length(col)] | |
13 | + data.freq = load(filename)(:,col(i)).*mult(i); | |
14 | + data.rate = 1; | |
15 | + [ad, S, err, tau] = allan(data, 2.^[0:nextpow2(length(data.freq))-3]./data.rate, strcat(strsplit(filename, '/'){end}, num2str(i)), 0); | |
16 | + loglogerr(tau, ad, err, cc(mod(i, length(cc)))) | |
17 | + leg{i} = strcat(filename, ' col', num2str(col(i))); | |
18 | + hold on | |
19 | + end | |
20 | + legend(leg) | |
21 | + input("Press to continue..."); | |
22 | +end | |
12 | 23 | exit |