-
Notifications
You must be signed in to change notification settings - Fork 2
/
gravReader.m
31 lines (29 loc) · 955 Bytes
/
gravReader.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
% 读取重力数据
% 针对TSF格式的重力数据
% clrscr @ STARDUST STUDIO 2012.3.6
% 选择文件
[filename, pathname, filterindex] = uigetfile( {'*.TSF','gPhone重力数据(*.TSF)';...
'*.*','所有文件(*.*)'}, 'Pick file', 'MultiSelect', 'on');
if filterindex ~= 0
gdata = [];
if iscell(filename)
for i = 1:1:length(filename)
fullfilename = fullfile(pathname,filename{i});
% data = [data,load(fullfilename)];
gravData=importdata(fullfilename,' ',11);
gdata=[gdata;gravData.data(:,7)];
end
else
fullfilename = fullfile(pathname,filename);
gravData=importdata(fullfilename,' ',11);
gdata=gravData.data(:,7);
end
% data=data';
time=0:length(gdata)-1;
figure;plot(time,gdata);xlabel('time');ylabel('mGal');
clear filename;
clear filterindex;
clear fullfilename;
clear i;
clear pathname;
end