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.
     

  • 相关阅读:
    BE Learing 2 名词解释
    mysql学习笔记(二)之一个粗心的问题
    Struts2/XWork < 2.2.0远程执行任意代码漏洞分析及修补
    DataReceivedEventHandler 委托
    JS数组方法汇总 array数组元素的添加和删除
    jQuery学习总结(一)
    js的lock
    mysql学习笔记(一)之mysqlparameter
    Time Span Attack
    Web Vulnerability Scanner 7.0 Patch for 2010_09_21_01
  • 原文地址:https://www.cnblogs.com/fzzl/p/2175343.html
Copyright © 2011-2022 走看看