sacsun2mat/sacpc2ma​t

版本 1.1.0.0 (8.7 KB) 作者: FTil
Read SAC files directly into MATLAB data structures.
3.1K 次下载
更新时间 2018/1/24

查看许可证

* Note that SACPC2MAT works on little-endian machines (Linux and Windows PCs) and SACSUN2MAT is for big-endian machines like SUNs.
[SACdata,SeisData,filenames]=SACPC2MAT('file1','file2',...,'filen')
[SACdata,SeisData,filenames]=SACSUN2MAT('file1','file2',...,'filen')
reads n SAC files file1, file2, filen with SUN or PC byte order and converts them to MATLAB format. The filenames can contain globbing characters (e.g. * and ?). These are expanded and all matching files loaded.

SACPC2MAT( cellarray ) where cellarray={'file1','file2',...,'filen'} is equivalent to the standard form.

SACdata is an nx1 struct array containing the header variables in the same format as is obtained by using MAT function of SAC2000. SACdata(i).trcLen contains the number of samples.

SeisData is an mxn array (where m=max(npts1, npts2,...)) containing the actual data.

filenames is a nx1 string cell array with the filenames actually read.

Note that writing

[SACdata,SeisData]=sacpc2mat('file1','file2',...,'filen')

is equivalent to the following sequence

sac2000
READ file1 file2 .. filen
MAT
(in fact the failure of above sequence to work properly on my system motivated this script).

SACSUN2MAT/SACPC2mAT was written by F Tilmann based on sac_sun2pc_mat by C. D. Saragiotis (I copied the routines doing the actual work from this code but used a different header structure and made the routine flexible). It was tested on MATLAB5 on a PC but should work on newer versions, too.

引用格式

FTil (2024). sacsun2mat/sacpc2mat (https://www.mathworks.com/matlabcentral/fileexchange/5546-sacsun2mat-sacpc2mat), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R11
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Geology 的更多信息
致谢

参考作品: SAC_Sun2PC_mat

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Typo fix in description
Include sacpc2mat for PC byte order

1.0.0.0