Commit 0a4b9acb authored by Jesse Heckman's avatar Jesse Heckman

update helper functions

parent 8b26590c
......@@ -36,6 +36,7 @@ spheretrial2complete(); % creates 2 .sphere files: calibration "0000" block, and
sphere2hoopdat(fname); % calibration
sphere2hoopcsv(fname)
%% Calibrate experiment data
[fname,~] = pb_getfile('ext',[bname '*.sphere'],'dir',cdir);
......
function pb_closeedit(varargin)
% PB_CLOSEEDIT
%
% PB_EDITOR(varargin) allows you to save and reopen your coding
% projects (multiple m-files in editor).
%
% See also PB_EDIT
% PBToolbox (2019): JJH: j.heckman@donders.ru.nl
v = varargin;
mode = pb_keyval('which',v,'current');
switch mode
case 'current'
h = matlab.desktop.editor.getActive;
case 'all'
h = matlab.desktop.editor.getAll;
otherwise
return
end
h.close;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2019) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% com.mathworks.mlservices.MLEditorServices.closeAll
\ No newline at end of file
......@@ -37,12 +37,14 @@ function pb_editor(varargin)
quest = 'Do you want to empty all current files in editor?';
title = 'Editor Action';
answer = questdlg(quest, title,'Yes','No','Cancel','Cancel');
if strcmp(answer,'Yes')
pb_closeedit('which','all');
elseif strcmp(answer,'Cancel')
return
end
end
if strcmp(answer,'Yes')
h.close;
elseif strcmp(answer,'Cancel')
return
end
load(fn,'fns');
for idx = 1:length(fns)
edit(fns{idx})
......@@ -60,6 +62,4 @@ end
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2019) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% com.mathworks.mlservices.MLEditorServices.closeAll
\ No newline at end of file
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
\ No newline at end of file
function x = pb_gaussfun(len,varargin)
% PB_GAUSSFUN
%
% PB_GAUSSFUN(len, varargin) simple GWN function.
%
% See also RANDN
% PBToolbox (2019): JJH: j.heckman@donders.ru.nl
v = varargin;
mu = pb_keyval('mu',v,0);
sigma = pb_keyval('sigma',v,1);
P = pb_keyval('P',v);
if ~isempty(P); sigma = sqrt(P); end
x = sigma*randn(len,1)+mu;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2019) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
Markdown is supported
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