Commit 2f803183 authored by Jesse Heckman's avatar Jesse Heckman
Browse files

minor fixes vPrime

parent a7f8dccc
......@@ -63,7 +63,6 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg)
acq = stim(selacq);
cfg.RZ6_1.SetTagVal('eventAcq',acq.onevent+1);
cfg.RZ6_1.SetTagVal('delayAcq',acq.ondelay);
cfg.RZ6_1.SetTagVal('acqSamples',cfg.nsamples); % amount of DA samples
end
......
......@@ -50,7 +50,7 @@ function pb_vRunExp(handles)
stim = handles.block(iBlck).trial(iTrl).stim;
handles.cfg = pb_vClearTrial(stim,handles.cfg);
%[stim, cfg] = pb_vSetupTrial(stim,handles.cfg);
[stim, cfg] = pb_vSetupTrial(stim,handles.cfg);
% pb_vRunTrial(experiment(iTrial));
% pb_vFeedbackGUI(); %% <-- MAYBE NOT NECESSAIRY?
......
function pb_ellipsoid()
% PB_ELLIPSOID()
%
% PB_ELLIPSOID() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
%% Initialization
out = keyval('outlier',varargin);
splot = pb_keyval('show',varargin,true);
if isempty(out)
out = []; % (Hz)
end
%% Eigen-values for covariance-matrix
[Veig,Deig] = eig(cov(x,y)); % Veig gives main axes
A = bf_rad2deg(atan2(Veig(2),Veig(1))); % angle
%% Delete response >3SD
if ~isempty(out)
SD = sqrt(diag(Deig)); % diagonal Deig = variance in the 2 main axes
xmu = mean(x);
ymu = mean(y);
[Xr,Yr] = rotate2d(x,y,-A);
seld = abs(Xr-mean(Xr))<out*SD(2) & abs(Yr-mean(Yr))<out*SD(1);
x = x(seld);
y = y(seld);
%% Eigen-values for covariance-matrix
[Veig,Deig] = eig(cov(x,y)); % Veig gives main axes
A = bf_rad2deg(atan2(Veig(2),Veig(1))); % angle
end
%% diagonal Deig = variance in the 2 main axes
SD = sqrt(diag(Deig));
xmu = mean(x);
ymu = mean(y);
MU = [xmu ymu];
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment