Extractiong sLoreta Data from EEG: transpose on ND array is not defined, use permute instead
6 ビュー (過去 30 日間)
古いコメントを表示
Steven Stanslowski
2017 年 11 月 16 日
編集済み: Steven Stanslowski
2017 年 11 月 17 日
Hi, I am trying to extract sLoreta data from EEG data using the plug in bellow:
2 件のコメント
Roger Stafford
2017 年 11 月 16 日
I would presume the line "g.data = EEG.data';" is the source of the error message. If so, then EEG.data has more than two dimensions and you cannot do a transpose operation on it, which is only defined for two-dimensional matrices. You will have to figure out just what it is that you want done on EEG.data. The suggestion given in the message is to use the 'permute' operation. I suggest you carefully read up on that in:
https://www.mathworks.com/help/matlab/ref/permute.html
Roger Stafford
2017 年 11 月 17 日
編集済み: Roger Stafford
2017 年 11 月 17 日
I would say that your very first task is to determine how many dimensions EEG.data has. Insert the line
t = size(EEG.data)
after the first line of writesLORdat. The number of elements in t will tell you how many dimensions there are to EEG.data, and what the length of each one is. Assuming there are more than two, your next task, which only you can do, is to determine just what it is you wish done to the arrangement of of EEG.data in order to place it in g.data. As I say, only you can answer that question. Once you have done that perhaps some of us can tell you how to accomplish it. The error message's suggestion of using 'permute' is only a guess on the part of the Matlab people who prepare error messages, though I think it is probably a very good guess in your case. The idea behind 'permute' is to change the order of the various dimensions of an array so that, say, an array of size 3x4x5 would become one of size 5x4x3, for example - in other words, an element which formerly possessed indices of 2,1,4 would be rearranged so as to possess indices of 4,1,2. That is a generalization of what happens in the transpose of a two-dimensional array.
採用された回答
Roger Stafford
2017 年 11 月 17 日
In that case what you probably need is 'reshape'.
g.data = reshape(EEG.data(61,[]);
1 件のコメント
Roger Stafford
2017 年 11 月 17 日
Then try
g.data = reshape(EEG.data(61,[],1);
(I'm responding to your original comment that you needed a 61x3800 matrix for g.data.)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で EEG/MEG/ECoG についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!