⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readmala-1.m

📁 GPR matlab The function should work with MATLAB v 5 and above. Please do not hesitate to contact me
💻 M
字号:
function [data,header]=readmala(filename)% READMALA reads GPR data from a file in the Mala format% When the header file can't be opened, both DATA and HEADER will be empty.% When the data file can't be opened, DATA will be empty.%% output:%    data     : raw data from the *.rd3 file%    header   : structure including all entries from the *.rad header file%% input:%    filename : filename to read with or without extension. If no filename%    is given a file open dialog will ask for a filename.%% V1.0% Written by W.P.J. van der Meer, (c) 2004% vdmeer@geosearch.co.jp% License: free for all use%initializationdata=[];header=[];%open file dialog in case filename is not givenif nargin < 1    [fn,pn] = uigetfile({'*.rd3','Mala data format (*.rd3)';'*.*','All Files (*.*)'},'Open Data File');    if fn == 0 %cancel button pressed        return;    end    filename = fullfile(pn,fn);end[pn,fn,ext] = fileparts(filename);data_file=fullfile(pn,[fn '.rd3']);header_file = fullfile(pn,[fn '.rad']);%read the header file[fid,message] = fopen(header_file,'rt');if fid==-1    error(['readmala: can''t open file "' header_file '": ' message]);    return;endln=fgetl(fid);while (ln~=-1)    [ts,rs] = strtok(ln,':');    ts = lower(strrep(ts,' ','_'));    val = str2num(rs(2:end));    if isempty(val)        val = rs(2:end);    end    header.(ts) = val;    ln = fgetl(fid);endfclose(fid);%read the data file[fid,message]=fopen(data_file,'rb');if fid==-1;    error(['readmala: can''t open file "' data_file '": ' message ]);    return;enddata = fread(fid,[header.samples inf],'int16');fclose(fid);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -