Calculating Coherence in an Matrix
13 views (last 30 days)
Show older comments
Jasper Mark
on 17 Dec 2020
Answered: KALYAN ACHARJYA
on 18 Dec 2020
This may be a simple quesiton, but I have been working with fieldtrip and have had difficulty with the freqanalysis function since I am processing data outside of fieldtrip synchronously.
I have a dataset that is 259 X 683000. Where each row coincides with a specific electrode on the body.
I was wondering if there was anyway to calculate coherence between the first 256 (1:256) electrodes and the final 3 (257:259).
Regards,
J
0 Comments
Accepted Answer
KALYAN ACHARJYA
on 18 Dec 2020
I am trying to answer using the following code
% Sample Array Data
data_set=rand(259,1000); %I intentionally changed the column number
%First 256 Electrodes
req_data1=data_set(1:256,:);
%Last 3 Electrodes
req_data2=data_set(257:259,:);
% Vertical Concatenation
result_data=[req_data1;req_data2];
% Next Mutual coherence of the matrix
coh_data=mutual_coherence(result_data)
The custom function mutual_coherence avalible here (please verify). You may look on other MATLAB inbuilt function, like corr,norm etc. Once you select a very large array size, a problem may arise, please refer to this answer.
0 Comments
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!