Index exceeds matrix dimensions

Hi All,

I am trying to process intracranial EEG data and running into the following error message.
I had updated Brainstorm to the most recent update (4/13/2020) a few days ago and was able to fully load my dataset then. However, when I exited Brainstorm and reopened it later in the day, the patients' names in Brainstorm were present but none of their data were and I get this error message when I click the functional data icon.

Any help is appreciated! Thank you!

Brainstorm error message

Something went wrong with your database, but it's difficult to know what just from this error message.

  1. Make a full backup of your database folder, if you are afraid you might be losing some important work (btw you should always have a daily or weekly backup set up if you don't want to risk losing any work or data). If you do have a backup, you can simply reload the backup instead.

  2. Update again Brainstorm. If you can't use the menu Update>Update Brainstorm, close Matlab, delete the brainstorm3 folder, and download a new one from the website.

  3. Try to reload your database: Go the anatomy view of the protocol, right-click on the top node in the database explorer (the name of the protocol) > Reload.

  4. If this causes an error, do the following:

    • detach your protocol from Brainstorm ( File > Delete protocol > Only detach from database)
    • delete the data/protocol.mat file
    • add your protocol again: File > Load protocol > Load from folder

If you still get an error message at this stage, please copy-paste it here.

Thank you for your prompt feedback. I updated Brainstorm to the latest version (4/24/20), followed the instructions above, and received the following error messages in MATLAB.

However, I am able to successfully run in Brainstorm an older backup I made onto a drive different than the one I've been using, so the problem has ultimately been resolved. This is now a moot issue but the error messages are included in case you're interested.

Index exceeds matrix dimensions.

Error in node_create_db_studies>@(c)c{1} (line 169)
[tmp__, iStudiesSortedNonRaw] = sort_nat(cellfun(@(c)c{1}, {ProtocolStudies.Study(isNonRaw).Condition},
'UniformOutput', 0));

Error in node_create_db_studies (line 169)
[tmp__, iStudiesSortedNonRaw] = sort_nat(cellfun(@(c)c{1}, {ProtocolStudies.Study(isNonRaw).Condition},
'UniformOutput', 0));

Error in panel_protocols>UpdateTree (line 428)
case 'StudiesSubj', [selNode, dbNode, numNodes] = node_create_db_studies(nodeRoot,
'subject', iSearch);

Error in panel_protocols (line 44)

Error in gui_brainstorm>SetCurrentProtocol (line 952)

Error in gui_brainstorm (line 33)

Error in db_reload_database (line 88)
gui_brainstorm('SetCurrentProtocol', prevProtocol);

Error in db_load_protocol (line 78)

Error in gui_brainstorm>SetCurrentProtocol (line 1045)

Error in gui_brainstorm>CreateWindow/protocolComboBoxChanged_Callback (line 567)

If this is not an error you can reproduce anymore, there is no chance we can reproduce it ourselves or fix it. Maybe it was simply the result of something getting corrupted in the database description.

If you ever see this error again, try to trace back what operation caused it, so we can investigate it further.

Keep doing regular backups, this is the only way to keep your data safe :slight_smile: