📄 loadrd3.m
字号:
function [A,samples,traces] = loadrd3%LOADRD3 loads radar profiles from a ramac format file. %%Usage:%A = loadrd3; opens an "open file" dialog box to interactively choose%file. Matrix A is created. rows of A have common two-way-travel-time,%columns of A have common profile station. %%[A,samples,traces] = loadrd3; will return matrix A and variables%"sapmples" and "traces", which contain the dimensions of A.%Copyright: (c) Brian Barret, 2004%Glaciology Group, School of Geography, University of Leeds%ask for file to load - automatically determines header file[dat,pathname]= uigetfile ('*.rd3', 'Load Ramac format radar file');name=double(dat);chrctrs=size(name);header=char([name(1:chrctrs(2)-2),97,100]);%open header file - find number of samples and number of tracesfid=fopen([pathname,header],'r');for k=1:30 % Read the Header line=fgetl(fid); if ~isempty(findstr('SAMPLES:',line)) pt=findstr('SAMPLES:',line); samples=str2num(line(pt+8:length(line))); end if ~isempty(findstr('LAST TRACE:',line)) pt=findstr('LAST TRACE:',line); traces=str2num(line(pt+11:length(line))); endendfclose(fid);%close header%open datafid=fopen([pathname,dat],'r');A=fread(fid,[samples,traces],'int16');fclose(fid);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -