...
 
Commits (2)
......@@ -12,34 +12,19 @@ cd('/Users/jjheckman/Documents/Data/PhD'); % default data directory
cdir = uigetdir(); if cdir ~= 0; cd(cdir); end
%% Get variables
d = dir('*.sphere');
sname = d(1).name
experimenter = pb_delreadstr(sname,'delimiter','-','n',1);
participant = pb_delreadstr(sname,'delimiter','-','n',2);
year = pb_delreadstr(sname,'delimiter','-','n',3);
month = pb_delreadstr(sname,'delimiter','-','n',4);
day = pb_delreadstr(sname,'delimiter','-','n',5);
bname = [experimenter '-' participant '-' year '-' month '-' day '-']
%% create data files
spheretrial2complete(); % creates 2 .sphere files: calibration "0000" block, and data "000n" block
%% Prep Calibration data
[fname,~] = pb_getfile('ext',[bname '*.sphere'],'dir',cdir);
[fname,~] = pb_getfile('dir',cdir);
sphere2hoopdat(fname); % calibration
sphere2hoopcsv(fname)
sphere2hoopcsv(fname);
%% Calibrate experiment data
[fname,~] = pb_getfile('ext',[bname '*.sphere'],'dir',cdir);
[fname,~] = pb_getfile('dir',cdir);
sphere2hoopdat(fname); % data
sphere2hoopcsv(fname);
......
......@@ -30,6 +30,18 @@ classdef pb_dataobj < handle
% DELETE - destructor
delete(obj);
end
% function split(obj)
% if size(obj)>1
% cdir = '~/Desktop/';
% path = pb_getdir('cdir',cdir);
% if path
% for i = 1:length(obj)
% save([],obj(i))
% end
% end
% end
% end
function dump(this)
% DUMP - show the content of the internal variables
......
......@@ -145,7 +145,6 @@ function writeexp(expfile,datdir,X,Y,snd,int,ledon,sndon,dur,block)
expfile = fcheckext(expfile,'.exp'); % check whether the extension exp is included
fid = fopen(expfile,'wt+'); % this is the way to write date to a new file
ntrials = numel(X);
blocksz = length(block);
......@@ -168,7 +167,7 @@ function writeexp(expfile,datdir,X,Y,snd,int,ledon,sndon,dur,block)
for ii = 1:ntrials % each location
writetrl(fid,ii);
writeled(fid,'LED',0,0,5,0,0,0,ledon(ii)); % fixation LED
pb_writesnd(fid,'SND',round(X(ii)),Y(ii),snd(ii),0,0,ledon(ii)+sndon(ii),ledon(ii)+sndon(ii)+dur); % Sound on
writesnd(fid,'SND',round(X(ii)),Y(ii),snd(ii),0,0,ledon(ii)+sndon(ii),ledon(ii)+sndon(ii)+dur); % Sound on
end
end
fclose(fid);
......
......@@ -18,6 +18,7 @@ function pb_genpassword(varargin)
spc = '±§!@€#$%^&*+=:;|\~<,>.?';
password = '';
rng('shuffle');
for iChunk = 1:nchunk
s = blanks(nchar);
order = randperm(nchar);
......
function [sn] = pb_mountserver(varargin)
function sn = pb_mountserver(varargin)
% PB_MOUNTSERVER(varargin)
%
% PB_MOUNTSERVER(varargin) mounts server for pulling or storing data. TO
......@@ -19,7 +19,7 @@ function [sn] = pb_mountserver(varargin)
if s > 0 && s ~= 64; disp(cout); end
if s == 64 && ~force; system('umount ~/sharename/'); prfx = 'un'; end
if s == 0 && flag; pb_open; end
if s == 0 && flag || flag && force; pb_open; end
disp([srv ' is ' prfx 'mounted.' newline]);
end
......