uwmadison-chm / bioread

Utilities to work with files from BIOPAC's AcqKnowlege software
MIT License
66 stars 23 forks source link

function to write to matlab files doesn't work #20

Closed bobchicken closed 7 years ago

bobchicken commented 7 years ago

MatlabWriter.write_file(data, "emg.mat")

File "", line 1, in MatlabWriter.write_file(data, "emg.mat")

NameError: name 'MatlabWriter' is not defined

matlabwriter.write_file(data, 'emg.mat') Traceback (most recent call last):

File "", line 1, in matlabwriter.write_file(data, 'emg.mat')

AttributeError: module 'bioread.writers.matlabwriter' has no attribute 'write_file'

njvack commented 7 years ago
from bioread.writers import matlabwriter
matlabwriter.MatlabWriter.write_file(data, 'emg.mat')

works for me. You could also do:

from bioread.writers.matlabwriter import MatlabWriter
MatlabWriter.write_file(data, 'emg.mat')

... they're functionally identical. Note that you'll need scipy installed for it to work, bioread uses their savemat() function.