You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unrecognized function or variable 'pacstruct'.
Error in eeg_pac (line 561)
pacstruct.ermipac.pacval(i,j,k,:) = filtfilt(b,a,squeeze(pacstruct.ermipac.pacval(i,j,k,:))');
Error in pop_pac (line 440)
[~, ~, freqs1, freqs2, alltfX, alltfY,~, pacstruct, tfXtimes, tfYtimes] = eeg_pac(X, Y, EEG.srate, options{:});
I am wondering if the error is coming from the eeg_pac() function code here :
% Loop phase frequencies
for find1 = 1:length(freqs1)
if strcmpi(g.verbose, 'on')
fprintf('Progress : %.2f %% \n', 100*(find1-1)/length(freqs1));
end
% Defining time vector and other stuff before runnning the loops
if strcmp(g.method, 'ermipac')
windowsearchsize = round(srate/freqs1(find1));
micomplimits = [round(windowsearchsize/2)+1 ti_loopend-round(windowsearchsize/2)-1];
tindxvector = micomplimits(1):micomplimits(2); %%%% HERE
else
tindxvector = 1:ti_loopend;
windowsearchsize = [];
end
In fact, there is a problem here cause tindxvector is empty because micomplimits(1) cause is positive and micomplimits(2) is negative. I tried to solve this error but as I don’t really know what is representing tindxvector I struggle a bit to understand what I am doing!
I tried to order micomplimits(1) and micomplimits(2) according to their values to obtain a non-void tindxvector :
if micomplimits(1)<micomplimits(2)
tindxvector = micomplimits(1):micomplimits(2);
else
tindxvector = micomplimits(2):micomplimits(1);
end
But then I have another error so I think it was not a good idea :
Error using eeg_pac
Index in position 1 is invalid. Array indices must be positive integers or logical values.
Error in pop_pac (line 440)
[~, ~, freqs1, freqs2, alltfX, alltfY,~, pacstruct, tfXtimes, tfYtimes] = eeg_pac(X, Y, EEG.srate, options{:});
Have you already encountered this error? If yes, do you know how to solve it?
Thanks a lot for your help!!!
The text was updated successfully, but these errors were encountered:
Sgas0000
changed the title
Error event-related MIPAC
Issue event-related MIPAC
Feb 16, 2024
Hello!
I am trying to implement an event-related MIPAC on my data, but I encountered an error that I struggle to solve.
Here is my EEG objet :
And here is the part of my code where I apply the pop_pac() function :
When i run pop_pac() I have this error :
I am wondering if the error is coming from the eeg_pac() function code here :
In fact, there is a problem here cause tindxvector is empty because micomplimits(1) cause is positive and micomplimits(2) is negative. I tried to solve this error but as I don’t really know what is representing tindxvector I struggle a bit to understand what I am doing!
I tried to order micomplimits(1) and micomplimits(2) according to their values to obtain a non-void tindxvector :
But then I have another error so I think it was not a good idea :
Have you already encountered this error? If yes, do you know how to solve it?
Thanks a lot for your help!!!
The text was updated successfully, but these errors were encountered: