How to use pymatreader - 1 common examples

To help you get started, we’ve selected a few pymatreader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dnvgl / qats / qats / readers / View on Github external
        Time and data

    >>> tname, names = read_names('data.mat')
    >>> data = read_data('data.mat', [tname, *names])
    >>> t = data[tname]   # time
    >>> x1 = data[names[0]]  # first data series

    # ignore the data field (if it exists) which contains the time series data in
    # latest file format
    data = read_mat(path)

    if "chan_names" in data.keys():
        # latest exhange format based on v.7.3 mat files
        data = dict(zip(data["chan_names"], np.transpose(data["data"])))
        # exhange format based on v.7.2 mat files
        ignored = ["comment", "fs", "test_num", "test_date", "__header__", "__version__", "__globals__"]
        data = {k: v for k, v in data.items() if k not in ignored}

    if names is not None:
        return {k: v for k, v in data.items() if k in names}
        return data


Convenient reader for Matlab mat files

Latest version published 12 months ago

Package Health Score

47 / 100
Full package analysis

Popular pymatreader functions