<div dir="ltr">Dear mne expert,<div><br></div><div>I wanted to write a covariance matrix into a *-cov.fif file using python command &#39;mne.write_cov&#39; but failed. I saved the covariance matrix into a txt file &#39;R2262.txt&#39; and then read it via python to cov_matrix. The error occurred in the step of &#39;write_cov&#39;. In tutorial, only file name and the matrix are needed. Everything should be correct but it said &#39;str&#39; had no attribute &#39;save&#39;. The detail is as follows.</div><div><br></div><div>







<p class=""><span class="">&gt;&gt;&gt; cov = open(&#39;/Users/Peng/Documents/MNE/MNE_analysis/MNE_TRFs/MEG/R2262_S0807/R2262cov.txt&#39;); cov_matrix = cov.read()</span></p>
<p class=""><span class="">&gt;&gt;&gt; mne.write_cov(&#39;/Users/Peng/Documents/MNE/MNE_analysis/MNE_TRFs/MEG/R2262_S0807/R2262_trf-cp-cov.fif&#39;,cov_matrix)</span></p>
<p class=""><span class="">Traceback (most recent call last):</span></p>
<p class=""><span class="">  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;</span></p>
<p class=""><span class="">  File &quot;/Users/Peng/Library/Python/2.7/lib/python/site-packages/mne-0.12.dev0-py2.7.egg/mne/cov.py&quot;, line 1181, in write_cov</span></p>
<p class=""><span class="">    cov.save(fname)</span></p>
<p class=""><span class="">AttributeError: &#39;str&#39; object has no attribute &#39;save&#39;</span></p><p class=""><span class=""><br></span></p><p class="">Do you have any idea how should this work?</p><p class="">Thank you very much!</p><p class="">Sincerely,</p><p class="">Peng</p></div></div>