Error occurs when converting muse file to MATLAB format


Exception in thread Thread-2:
Traceback (most recent call last):
File “E:\Program Files (x86)\Python27\lib”, line 810, in __bootst
File “E:\Program Files (x86)\Python27\lib”, line 763, in run
self.__target(*self.__args, **self.__kwargs)
File “E:\Program Files (x86)\Muse\”, line 73, in start
File “E:\Program Files (x86)\Muse\”, line 35, in broadcast_me
File “E:\Program Files (x86)\Muse\”, line 185, in receive_msg


File “E:\Program Files (x86)\Muse\”, line 165, in write_array, result, oned_as='column')

File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\
”, line 207, in savemat
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 876, in put_variables
self._matrix_writer.write_top(var, asbytes(name), is_global)
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 626, in write_top
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 653, in write
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 764, in write_struct
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 782, in _write_items
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 644, in write
narr = to_writeable(arr)
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 486, in to_writeable
narr = np.asanyarray(source)
File “E:\Program Files (x86)\Python27\lib\site-packages
, line 336, in asanyarray
return array(a, dtype, copy=False, order=order, subok=True)
ValueError: setting an array element with a sequence


Hi tsubasa,

Can you provide more information about where the Muse File is from and how it was recorded. Alternatively attach it here for analysis. From this error log I don’t have enough information to understand the cause of the error.



thanks for your reply. I just used muselab to record it, and used museplayer to convert. to CSV file is successful, but to MATLAB file is not. when I attached the .muse file, the system shows it’s invalid.


Hi tsubasa,

I tried to repeat these steps personally and I am not having any issues, it’s writing it fine.

Can you confirm your SDK version? Have you installed the latest, 2.4.2?
Can you confirm your the OS you’re using? (OSX, Windows, Linux)

If you’re on 2.4.2, are you able to provide the actual file that is causing the crash?


the file is attached at

Then, -f data.muse -M data.mat, the error occurs.


Hi tsubasa,

I’ve parsed your file into Matlab without any issues. Can you verify your OS and your SDK version for me?


Win 8, SDK version is 2.4.2. how do you parse the file into Matlab, is my command line correct?


Hmm, very confusing. Are you sure it’s the correct file? I tried on Windows 8 with 2.4.2 and it worked fine without any errors.

It won’t let me upload a .mat file, but it seems to contain the data. Does this happen to every file you record?

One possibility is that you’ve installed the wrong version of scipy. Can you confirm what you installed here?
[SIZE=12px]2.3) Download SciPy installation for Python 2.7:…/scipy/0.14.0/

Run the executable and it will find your Python installation path and install for you.
Follow wizard to the end and finish installation.

2.4) Download NumPy installation for Python 2.7:[/SIZE]


I installed a wrong NumPy version, now correct! Thanks a lot.


But when converted to MATLAB file, dsp elements are lost, than means there is no alpha, beta… band information


Hi tsubasa,

I apologize about that. We will release a version in the near future that will properly add these values to your Matlab output.

In the meantime, you can feel free to use the CSV output version. (-C) to write out these values and import them into Matlab. This should achieve the same result, although a little bit less convenient, you won’t have to wait for a new release of the SDK.

Worth mentioning you can also filter the output data so you can write out only the band information into the csv, individually or collectively.
(ie. ./museplayer -f yourdata.muse -C banddata.csv -i alpha beta delta theta gamma) Will write only alpha, beta, delta, theta and gamma messages

Hope that helps for now.