zoukankan      html  css  js  c++  java
  • 【转】matab中dlmread 和dlmwrite函数的具体应用

    转自:http://www.ymlib.net/article/sort010/info-376.html

    matab中dlmread 和dlmwrite函数的基本格式:
    M = dlmread(filename, delimiter, R, C)
    M = dlmread(filename, delimiter, range)
    range = [R1 C1 R2 C2] where (R1,C1) is the upper left corner of the data to be read and (R2,C2) is the lower right corner. You can also specify the range using spreadsheet notation, as in range = 'A1..B7'.
    示例:



    dlmwrite: Write matrix to ASCII-delimited file

    1、定义输出格式:dlmwrite(filename, M, 'attrib1', value1, 'attrib2', value2, ...) is an alternate syntax to those shown above, in which you specify any number of attribute-value pairs in any order in the argument list.
    属性定义:
    delimiter(分割符): Delimiter string to be used in separating matrix elements.
    newline(断行符):Character(s) to use in terminating each line.
    (1) 'pc': PC terminator (implies carriage return/line feed (CR/LF))
    (2) 'unix': UNIX terminator (implies line feed (LF))
    roffset(行偏移): Offset, in rows, from the top of the destination file to where matrix data is to be written. Offset is zero based.
    coffset(列偏移): Offset, in columns, from the left side of the destination file to where matrix data is to be written. Offset is zero based.
    precision(输出精度): Specify the number of significant digits or a C-style format string starting in %, such as '%10.5f'.
    示例:
    dlmwrite('data.txt', data, 'precision', '%10.6f', 'roffset', 10, 'coffset', 10, 'delimiter', ';', 'newline', 'pc');


    2、追加方式输出:dlmwrite(filename, M, '-append', attribute-value list) appends the matrix to the file. If you do not specify '-append', dlmwrite overwrites any existing data in the file. You can place the '-append' flag in the argument list anywhere between attribute-value pairs, but not in between an attribute and its value.
     

  • 相关阅读:
    ElasticSearch常见经典面试题
    系统剖析Android中的内存泄漏
    Android Studio在导入eclipse的项目时一直卡在gradle:Configure project
    记录Android Studio项目提交到github上的出错处理
    如何将Android Studio项目提交(更新)到github
    MOB 短信验证
    mob免费短信验证码安卓SDK调用方法
    Git的安装与使用
    svn代码提交注意事项
    Fragment详解之三——管理Fragment(1)
  • 原文地址:https://www.cnblogs.com/fzzl/p/2175343.html
Copyright © 2011-2022 走看看