zoukankan      html  css  js  c++  java
  • MATLAB中导入数据:importdata函数

    用load函数导入mat文件大家都会。可是今天我拿到一个数据,文件后缀名竟然是‘.data’。该怎么读呢?

    我仅仅好用matlab界面Workspace区域的“import data”button手工导入该文件。恩,还好,竟然成功了。顺便提一下,这个“import data”button功能非常强大,连excel文件都能导入。

    可是假设在脚本里怎样导入这样的非mat文件呢?

    这时候就轮到“importdata”函数登场啦!

    ---------------------------------------------------------------------

    importdata

    Load data from file
    Syntax

    importdata(filename)
    A = importdata(filename)
    A = importdata(filename, delimiter)
    A = importdata(filename, delimiter, nheaderlines)
    [A, delimiter] = importdata(...)
    [A, delimiter, nheaderlines] = importdata(...)
    [...] = importdata('-pastespecial', ...)
    Description

    importdata(filename) loads data from filename into the workspace.

    A = importdata(filename) loads data into A.

    A = importdata(filename, delimiter) interprets delimiter as the column separator in ASCII file filename.

    A = importdata(filename, delimiter, nheaderlines) loads data from ASCII file filename, reading numeric data starting from line nheaderlines+1.

    [A, delimiter] = importdata(...) returns the detected delimiter character for the input ASCII file.

    [A, delimiter, nheaderlines] = importdata(...) returns the detected number of header lines in the input ASCII file.

    [...] = importdata('-pastespecial', ...) loads data from the system clipboard rather than from a file.

    ----------------------------------------------------------------

    这个函数能够支持的文件格式有:MAT文件,ASCII files和Spreadsheets,images, Audio files

    这个ASCII files和Spreadsheets指的是:For ASCII files, data contains a double array. Other fields contain cell arrays.
    For spreadsheets, each field contains a struct, with one field for each worksheet.

  • 相关阅读:
    c#基于业务对象的筛选
    SQLServer索引调优实践
    C#中抽象类和接口的区别
    c#基础(2) 理解委托和事件
    建议学习jQuery的步骤!
    SQL SERVER存储过程调用存储过程并接收输出参数或返回值的方法
    ASP.NET基于JQUERY的高性能的TreeView
    GetManifestResourceStream得到的Stream是null的解决
    Using GDI+ on Windows Mobile 初体验
    提供一个Windows mobile Native UI 程序,循序渐进开发,并附有代码!
  • 原文地址:https://www.cnblogs.com/yxwkf/p/4008106.html
Copyright © 2011-2022 走看看