Extractiong sLoreta Data from EEG: transpose on ND array is not defined, use permute instead
5 次查看(过去 30 天)
显示 更早的评论
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!