Commit 9a89127b6634c580711b11e1db8264ccc69d971c
1 parent
7ec25ad9fc
Exists in
master
fix nargin
Showing 1 changed file with 10 additions and 12 deletions Side-by-side Diff
allanplot.m
... | ... | @@ -33,18 +33,16 @@ |
33 | 33 | cc = 'bkcgmry'; |
34 | 34 | for i = [1:length(col)] |
35 | 35 | data.freq = load(filename)(:,col(i)).*mult(i); |
36 | - if nargin == 5 | |
37 | - if ad_opt(i) == 1 | |
38 | - printf(strcat(filename, ' col', num2str(col(i)), ' drift removed\n\n')) | |
39 | - data.freq = detrend(data.freq); | |
40 | - elseif ad_opt(i) == 2 | |
41 | - printf(strcat(filename, ' col', num2str(col(i)), ' relative ad : mean=', num2str(mean(data.freq)), '\n\n')) | |
42 | - data.freq = data.freq./mean(data.freq); | |
43 | - elseif ad_opt(i) == 3 | |
44 | - printf(strcat(filename, ' col', num2str(col(i)), ' drift removed relative ad\n\n')) | |
45 | - data.freq = detrend(data.freq./mean(data.freq)); | |
46 | - end | |
47 | - endif | |
36 | + if ad_opt(i) == 1 | |
37 | + printf(strcat(filename, ' col', num2str(col(i)), ' drift removed\n\n')) | |
38 | + data.freq = detrend(data.freq); | |
39 | + elseif ad_opt(i) == 2 | |
40 | + printf(strcat(filename, ' col', num2str(col(i)), ' relative ad : mean=', num2str(mean(data.freq)), '\n\n')) | |
41 | + data.freq = data.freq./mean(data.freq); | |
42 | + elseif ad_opt(i) == 3 | |
43 | + printf(strcat(filename, ' col', num2str(col(i)), ' drift removed relative ad\n\n')) | |
44 | + data.freq = detrend(data.freq./mean(data.freq)); | |
45 | + end | |
48 | 46 | data.rate = fs(i); |
49 | 47 | [ad, S, err, tau] = allan(data, horzcat(reshape([1:0.1:9]'.*10.^[0:round(log10(length(data.freq)))-1],1,[]), 10^(round(log10(length(data.freq)))-1))./data.rate, strcat(strsplit(filename, '/'){end}, num2str(i)), 0); |
50 | 48 | loglogerr(tau, ad, err, strcat(cc(mod(i, length(cc))), '-s')) |