物探论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 908|回复: 0

[算法] 分离头文件和数据

[复制链接]
发表于 2013-11-24 09:27:03 | 显示全部楼层 |阅读模式
MHDRLOAD Load data from an ASCII file containing multiple text
  headers throughout the file.
  [header, data] = MHDRLOAD('filename.ext') reads a data file
  called 'filename.ext', which contains a text header.  There
  is no default extension; any extensions must be explicitly
  supplied.

  The first output, HEADER, is the header information, returned
  as a text array.
  The second output, DATA, is the data matrix.  This data matrix
  has the same dimensions as the data in the file, one row per
  line of ASCII data in the file.  If the data is not regularly
  spaced (i.e., each line of ASCII data does not contain the
  same number of points), the data is returned as a column
  vector.

  Limitations:  No lines of the text header can begin with
  a number.  The header must come before the data.

  MODIFIED from hdrload.m: Dec 20, 2002  Jeff Daniels, NSWCCD - ARD
  UPDATED September 20, 2006, J. Daniels

  See also LOAD, SAVE, SPCONVERT, FSCANF, FPRINTF, STR2MAT, HDRLOAD.
  See also the iofun directory.

  EXAMPLE:
    If example_data.txt is:
    Recorded Data: 12/15/2001
    header 1
    rows = 2 cols = 2
    12 23
    34 21
    header 2
    rows = 3 cols = 3
    19 73 13
    33 32 47
    34 12 68

    MHDRLOAD returns:
          header(:,:,1) =
         
          Recorded Data: 12/15/2001
          header 1                 
          rows = 2 cols = 2        
         
          header(:,:,2) =
         
          header 2                 
          rows = 3 cols = 3   

          data(:,:,1) =
         
         12    23     0
         34    21     0
          0     0     0

          data(:,:,2) =
         
         19    73    13
         33    32    47
         34    12    68

mhdrload.m (5.77 KB, 下载次数: 0, 售价: 2 物探币)

相关帖子

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|物探论坛 ( 鄂ICP备12002012号 微信号:iwutan )

GMT+8, 2024-4-29 07:39 , Processed in 0.084032 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表