<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi EEGLablist,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I am trying to calculate the PSD value for a range of frequencies, for 23 channels. I do this for 1799 epochs, for 42 hours. I will then repeat this for 24 patients. I am using CHB-MIT EEG data.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I implemented a for loop which calls the spectopo function and stores the required values in a 23 x 1799 x 42. Indeed, the for loop, loops over the number of hours and for each hour it loops over the number of epochs and then for each channel, the spectopo function is called and the values are stored accordingly.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Spectopo gets the required psd values well even though this is taking hours to calculate (have not considered parallelisation yet), but during the 25th hour this error that I don't know how to fix pops up:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style><div style><font face="arial, sans-serif">Improper assignment with rectangular empty matrix.</font></div><div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif">Error in spectopo (line 471)</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre"> </span>reallimits(1) = min(min(eegspecdB(:,minfreqidx:maxfreqidx)));</font></div><div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif">I tried to see if there was anything wrong with the data for the 25th hour but everything seems fine. Taking a look at line 471, I couldn't find anything out of the ordinary but then again I found it hard to understand what exactly is happening during this line. Moreover, the "Improper assignment" error does not make sense, I was not trying to assign an empty matrix anywhere in my code. In fact the 23x1799x42 matrix assignment happens outside of the code. Can anyone please shed any insight on this matter? I will greatly appreciate any help given! </font></div><div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif">Thank you.</font></div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Regards,</div><div><br></div>-- <br><div class="gmail_signature"><b><i>James Bonello</i></b></div>
</div>