求大神讲解一下这个matlab的语句,急求!!!!

if (nargin < 2), verbose = 2; end
if (isfield(imu, 'fb_tau') )
fields = {'fb_tau','fb_allan','fb_error','wb_tau','wb_allan','wb_error'};
imu = rmfield(imu, fields);
end
imu.arw = zeros(1,3);
imu.vrw = zeros(1,3);
imu.ab_drift = zeros(1,3);
imu.gb_drift = zeros(1,3);
imu.ab_corr = zeros(1,3);
imu.gb_corr = zeros(1,3);
imu.ab_fix = zeros(1,3);
imu.gb_fix = zeros(1,3);
imu.ab_std = zeros(1,3);
imu.ab_max = zeros(1,3);
imu.ab_min = zeros(1,3);
imu.ab_mean = zeros(1,3);
imu.ab_median = zeros(1,3);
imu.gb_std = zeros(1,3);
imu.gb_max = zeros(1,3);
imu.gb_min = zeros(1,3);
imu.gb_mean = zeros(1,3);
imu.gb_median = zeros(1,3);
dt = mean(diff(imu.t));
data.rate = round(1/dt);
T = (imu.t(end) - imu.t(1)) ;
exp_min = floor( log10( dt ) );
exp_max = floor( log10( T /2 ) );
TAU = 10.^(exp_min:exp_max);
tau_v = [];
for i = 1:length(TAU)-1
tau_v = [tau_v TAU(i):TAU(i):TAU(i+1) ];
end
dd = diff (tau_v);
idl = dd ~= 0;
idl = [idl true];
tau_v = tau_v(idl);
plot_line = [ '-ob'; '-og'; '-or' ];
fprintf('allan_imu: length of time is %02.3d hours or %.2f minutes or %.2f seconds. \n\n', (T/60/60), (T/60), T)
for i=1:3
fprintf('\nallan_imu: Allan variance for FB %d \n', i)
data.freq = imu.fb(:,i);
[allan_o, s, error, tau] = allan_overlap(data, tau_v ,'allan_overlap', verbose);
imu.fb_tau (:,i) = tau';
imu.fb_allan(:,i) = allan_o';
imu.fb_error(:,i) = error';
vrw = allan_get_rw (tau, allan_o, dt);
imu.vrw(i) = vrw;
[b_drift, t_corr] = allan_get_bdrift (tau, allan_o);
imu.ab_drift(i) = b_drift;
imu.ab_corr(i) = t_corr;
imu.ab_std(i) = s.std;
imu.ab_fix(i) = s.mean;
imu.ab_mean(i) = s.mean;
imu.ab_max(i) = s.max;
imu.ab_min(i) = s.min;
imu.ab_median(i) = s.median;
end
figure;
for i=1:3
loglog(imu.fb_tau(:,i), imu.fb_allan(:,i), plot_line(i,:));
hold on
end
hold off
grid on
title('ACCRS ALLAN VARIANCES')
legend('ACC X','ACC Y', 'ACC Z' )
for i=1:3
fprintf('\nallan_imu: Allan variance for WB %d \n', i)
data.freq = imu.wb(:,i);
[allan_o, s, error, tau] = allan_overlap(data, tau_v ,'allan_overlap', verbose);
imu.wb_tau (:,i) = tau;
imu.wb_allan(:,i) = allan_o;
imu.wb_error(:,i) = error;
arw = allan_get_rw (tau, allan_o, dt);
imu.arw(i) = arw;
[b_drift, t_corr] = allan_get_bdrift (tau, allan_o);
imu.gb_drift(i) = b_drift;
imu.gb_corr(i) = t_corr;
imu.gb_fix(i) = mean(data.freq);
imu.gb_std(i) = s.std;
imu.gb_fix(i) = s.mean;
imu.gb_mean(i) = s.mean;
imu.gb_max(i) = s.max;
imu.gb_min(i) = s.min;
imu.gb_fix(i) = s.mean;
imu.gb_median(i) = s.median;
end
figure;
for i=1:3
loglog(imu.wb_tau(:,i), imu.wb_allan(:,i), plot_line(i,:));
hold on
end
hold off
grid on
title('GYROS ALLAN VARIANCES')
legend('GYRO X','GYRO Y', 'GYRO Z' )
end

你是个人才,程序没头没尾的,哪会有人帮你一句句读,你把完整程序发上来,让人能运行或者运行出错都行.追问

就这几行,主程序。主要想知道这几句主程序什么意思。

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答