sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d4e4eefa01b6a5716bb8120718554ab517df0025ce77a0c3f0a228225f906a1c
MATLAB
164
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'map', 'pipeline_map'); end obj = schemaObject; end
e1f895e21b55814df3a5e52f6946b14f8ef37ee4eb582364c4f68612cd0b99f2
MATLAB
164
9
function vl_test_print(varargin) addpath(fullfile(vl_rootnn(), 'examples', 'mnist')); net = cnn_mnist_init('networkType', 'dagnn'); net.print(varargin{:}); end
4945ece978c60dee74dee8fdeec62978813f03ab0eb93b001c16a9b92e978d47
MATLAB
165
12
%Creado por Luisca Mayo09. function [SSRR]=SortSRR(A) N=size(A,2); j=1; for i=1:(N-1) SSRR=sortrows(A,i); end; pcolor(SSRR) %save Ras_Ren.dat Ras_Ren -ascii
dc7ba0ad84e319a4a1b5ca0dfa558a5de01253ffe68c15ec948eae9b86cc97c0
MATLAB
165
9
function lg = logGamma(a, p) if nargin < 2 p = 1; end lg = (p*(p-1)/4)*log(pi); for i=1:p lg = lg + gammaln(a + (1-p)/2); end end
077784d3cf34bae4c5655a61de98199bf0ff7d7e3545ec3b26c3b2209979b213
MATLAB
166
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'fuse', 'pipeline_fuse'); end obj = schemaObject; end
4c6a9b43950bd33954886839b4a23a79c976ee2ecebac0c6a013a323c8e84922
MATLAB
166
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'meso', 'pipeline_meso'); end obj = schemaObject; end
795ba0aba0f6558068be4efaa514f2da1a4279968c42f6c9ac0f232a9a7a715a
MATLAB
166
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'reso', 'pipeline_reso'); end obj = schemaObject; end
7b0151a5b051c4382d7ac22d313d0a5b7384a98eeabf021d573cd7dc6cde0d13
MATLAB
166
5
function fn_par = sero_srr_fn_nii2par(fn_nii) % function fn_seq = sero_srr_fn_data2nii(fn_data) [a,b] = msf_fileparts(fn_nii); fn_par = [a filesep b '_par.nii.gz'];
8302e7512b32ef075fa20f4b6c85eaa81cf7542a714920416748cb2745d73514
MATLAB
166
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'tune', 'pipeline_tune'); end obj = schemaObject; end
e94b701ce2dd8efd9776083d36ef895a035afd8347700e63cedb0ac520ce077f
MATLAB
166
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'sync', 'pipeline_sync'); end obj = schemaObject; end
32e77f2196f5005d6b5d18c2176ef41af3ada61327fc24c2d272b65ad5d03a50
MATLAB
167
4
% return boolean value to check if the input name contains certain string function bool = ContainName(name,string) bool= ~isempty(strfind(lower(name),string)); end
c3f404ea4a716907e4c59cd93d0fd31e95608db05a75832c4c8eaeb7b1ec3b4e
MATLAB
167
11
function [states] = tapas_vlinear_init_states(data, model, inference) %% % % aponteeduardo@gmail.com % copyright (C) 2016 % states = cell(inference.niter, 1); end
04d7e9a5e192d2d13acdbc35664b7163521e8eb4a931ff546de76434a6c2efb3
MATLAB
168
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'stack', 'pipeline_stack'); end obj = schemaObject; end
0e4c4e9e33ee60fec2e534f504be642d43bf6698393bbd4d8c2f59082e5ce7ec
MATLAB
168
9
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'vis2p', 'vis2p_manolis'); end obj = schemaObject; end
5a2fefd5e6659745e2b1fa39f78b859f79d7bdf60f711e4762f3f97fb79fb1aa
MATLAB
168
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'monet', 'pipeline_monet'); end obj = schemaObject; end
7706dcd0b15ec14ce3188149d76daacc227cb646fb75e88e383352a6aacc5972
MATLAB
168
8
function anomalies = detect_anomalies(outputs, factor) errors = abs(outputs - mean(outputs)); threshold = factor * mean(errors); anomalies = errors > threshold; end
9f03a1922ae1725c417d465f63f8c9b496f15744e8e479f2729eb33f54ac142d
MATLAB
168
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'vreso', 'pipeline_vreso'); end obj = schemaObject; end
a78afd5a0e28a0b5f712bed9d1a616eb96484bafb2e33bce52de3431505bb755
MATLAB
169
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'stack', 'pipeline_stacks'); end obj = schemaObject; end
0d7d44b30e6562229f3d493159ed0b40b72aa3998fb4ef2380e04a94748b6a46
MATLAB
170
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'shared', 'pipeline_shared'); end obj = schemaObject; end
10ace9a0087222a16fc7c2259d6903ec29b09940b9023be8267d06c4cb286f4d
MATLAB
170
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'movies', 'pipeline_movies'); end obj = schemaObject; end
dec76a5c2913c6e8d6c4b437c537a0f17a3e2b546d389f0ffaccdf8746609f9c
MATLAB
170
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'trippy', 'pipeline_trippy'); end obj = schemaObject; end
ea8538215cf1e57cfca405aa7bc9de66fe1bc7387a8d3e6b1e47d53ae727b209
MATLAB
170
3
function x = is_search(x) % Determine whether some object is a search() expression. x = all(isfield(x,{'head','parts'})) && numel(x)==1 && strcmp(char(x.head),'search');
f3ab15defce7fc9bbbf705dc7793485585b4686d14a32f21a0f8961233338e0c
MATLAB
170
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'tuning', 'pipeline_tuning'); end obj = schemaObject; end
0f212721d0d92e158463f1695cd065f89f9dc171a1c62c6fa767c95496ec8deb
MATLAB
171
8
function fn_xps = sero_pulseq_fn_seq2xps(fn_seq) % function fn_xps = sero_pulseq_fn_seq2xps(fn_seq) [a,b,c] = fileparts(fn_seq); fn_xps = fullfile(a, [b '_xps.mat']);
f42fa0d00a8a9d50749b9b6c8ae3d5f525c3da02a0fbed3ef6347e0e6fe02411
MATLAB
171
4
function x=gather(x) % GATHER Compatibility stub for the GATHER() function % GATHER() is a function in the Parallel MATLAB toolbox. MATCONVNET % can work without it.
1574127ada3b01fbe9b417da5df58013ace229d94a39a0b6b6ff0684b0ad23ae
MATLAB
172
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'anatomy', 'pipeline_anatomy'); end obj = schemaObject; end
3b8b029658f495857afb5eacc58e47b6f99b7cf0f7a80d4fc3530f22dae3fe77
MATLAB
172
12
function [flg] = filexist (filename) % % [flg] = filexist (filename) % % if filename exists then flg = 1, else flg = 0 % flg=0; if exist(filename,'file') flg=1; end
9418685050dde0ca70b9a0a09da05c2317017b935bb2f670ab53b54f07624bb4
MATLAB
172
11
function p = sero_srr_tr2position(TR, w) % function p = sero_srr_tr2position(TR, w) if nargin < 2 w = sum(TR>0, 2); end ind = 1:size(TR,2); p = (TR>0) * ind' ./ w;
a1e1dc7aaf676a54212fc223c066ab5786ffb342c0fc3fc612e509bc6e47cb7e
MATLAB
172
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'quality', 'pipeline_quality'); end obj = schemaObject; end
e2db9fac475c152340de0bcfa9fb1884d70a09ed2457e441f3a36ec2acdefdb8
MATLAB
172
8
function close_all_ports load tone PsychPortAudio('Stop', tone.pahandle); % Close the audio device PsychPortAudio('Close', tone.pahandle); % Clear the screen sca;
2214900cf14cd836b42f321a53434dffdb18485c562ade810c603435db10057b
MATLAB
173
5
function fn_seq = sero_srr_fn_data2nii_aco(fn_data) % function fn_seq = sero_srr_fn_data2nii_aco(fn_data) [a,b] = fileparts(fn_data); fn_seq = [a filesep b '_aco.nii.gz'];
8544d57e92dba5193c9a30d0e6a1741ee6df1e162b0eb2e49ad986689c1c5990
MATLAB
174
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'trk', 'pipeline_pupiltracking'); end obj = schemaObject; end
91d41eb5cc546d4cf3b1d9fefb670a872705cbee3e41fd6a83c011d684a69081
MATLAB
174
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'pre', 'pipeline_preprocessing'); end obj = schemaObject; end
d4dc91f81d45fb4c76e7359107bfa3d8bc8bc338a9459a71f15fca963636012b
MATLAB
174
10
%{ # field/channels that should not be segmented (used for web interface only) -> experiment.Scan -> shared.Field -> shared.Channel %} classdef DoNotSegment < dj.Manual end
4422877d8ec63fbddb646e8e90302bde33a03285e86a6397192fd9e15450cd5e
MATLAB
175
10
%{ experiment.SessionPMTFilterSet (manual) # Filters used in the session -> experiment.Session --- -> experiment.PMTFilterSet %} classdef SessionPMTFilterSet < dj.Relvar end
bca67585fcfd3fbf73fb259cc15eac5abd240977d6c1e7817391d67df38fc109
MATLAB
175
12
function [ny] = tapas_ti_init_y(y, ptheta, pars) %% Default initilization. % % aponteeduardo@gmail.com % copyright (C) 2016 % ny = cell(1, numel(pars.T)); ny(:) = {y}; end
d16308152be32ffb39302414ada41039e565fd39309102887ca93c4bea72471b
MATLAB
175
9
function Z = multiprod_ez(X, Y) Z = zeros(size(X, 1), size(Y, 2), size(X, 3)); for k = 1 : size(Z, 3) Z(:, :, k) = X(:, :, k) * Y(:, :, k); end end
3cdd5a82a438f9fd9a62ec6763b348d608e95ac69cd9ee8c88bccaf2fd56f094
MATLAB
176
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'aod_monet', 'pipeline_aod_monet'); end obj = schemaObject; end
66a17daf2ed9c69ee131948e898b4223fd97087229ca5fb260dc5a20f0549297
MATLAB
176
13
function f = flatten(m) % function f = flatten(m) % % <m> is a matrix % % return as a row vector. % % example: % a = [1 2; 3 4]; % isequal(flatten(a),[1 3 2 4]) f = m(:).';
729073b6df60743d4bbf3e43189af92a49fa693f6d06f95436178e8984ea9644
MATLAB
176
7
function output = oddRatio(lposP, lnegP) %% see Mladenic, D. & Grobelnik, M. (1999) output = log(... exp(lposP).*(1-exp(lnegP)) ./ exp(lnegP).*(1-exp(lposP))... ); end
78c89869ebb20ef1fa9386d47113a169a7627e154baaaf13f4a04d11b45958ec
MATLAB
176
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'treadmill', 'pipeline_treadmill'); end obj = schemaObject; end
c81bbf857b129ffcd10790e2027d488ea9c1775b5d25cd63534c6a82d056e319
MATLAB
176
4
% MATLAB runs the test [result,rt] = UnitTest('MEGA',1,1); assert(sum(rt{1}.Failed) == 0 && sum(rt{1}.Incomplete) == 0 &&sum(rt{2}.Failed) == 0 && sum(rt{2}.Incomplete) == 0)
f2f0f10fbe8bc923b93eb9cc86d5f4dcb1ecc72aaf1ed3d6da7296d1f7742c35
MATLAB
176
8
%{ # recording channel, directly related to experiment.PMTFilterSet.Channel channel : tinyint # %} classdef Channel < dj.Lookup end
fb43c6ed730d3ff6f5c2637e57414e652e099187a0ab154c7d4272a07148cc74
MATLAB
176
5
function fn_par = sero_srr_fn_nii2par_avg(fn_nii) % function fn_par = sero_srr_fn_nii2par_avg(fn_nii) [a,b] = msf_fileparts(fn_nii); fn_par = [a filesep b '_par_avg.nii.gz'];
0f7c9ea6b648ad85480001aa92f8ad7a99bf73fc2794184695ec124094b3043d
MATLAB
177
4
% MATLAB runs the test [result,rt] = UnitTest('PRESS',1,1); assert(sum(rt{1}.Failed) == 0 && sum(rt{1}.Incomplete) == 0 &&sum(rt{2}.Failed) == 0 && sum(rt{2}.Incomplete) == 0)
72fe9b0ac4099856c59e88a9eb5c4bae98e9818c1770c34c20434bccb011d4f7
MATLAB
177
6
function gzip_if_needed(niiPath) if endsWith(lower(niiPath), '.nii') if isfile([niiPath '.gz']), delete([niiPath '.gz']); end gzip(niiPath); end end
e3558d89ed05a7861c6595471f998051fa6b72004c8ad74c256f2452f6a6e8bb
MATLAB
177
8
function matchIdx1=greedyPairs(C,THD) % C: cost matrix % THD [minCost,idx] = min(C,[],2); matchIdx1 = find(minCost<=THD); matchIdx1 = [matchIdx1, idx(matchIdx1)]; end
ebe89026463f5b48517beaa8b39726147f948af23c7a084a41b01f60ff7086cb
MATLAB
177
11
function obj = paramopt(obj) % optimize parameters for an NBC classifier % parse parameter vector into params % [s_param w_act_noact w_prior_vs_like] acc = 1 - nbc.b_err;
1263d5781696f32b657a1678b584eabb816a5f1b26daa7e89dceeb7c3ad6d3e0
MATLAB
178
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'preprocess', 'pipeline_preprocess'); end obj = schemaObject; end
9cba713be3fcdd9f8471ebb49622b8b191ec2487e009184089c47be555c0497f
MATLAB
178
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'experiment', 'pipeline_experiment'); end obj = schemaObject; end
90ac23669438128a30a0f0ab0e4434e4642bf19e40c683ed729bc768e4e2d07f
MATLAB
179
7
function refPath=getRefPath(voltagePath) % 2020-06-27 04:22:40 RC refPath=strrep(voltagePath,'cG','cR'); if ~isfile(refPath) error('Reference file has not been found') end end
91cb885263a5a83aa7dcd63644f44ac0db9ad3dc86c6b1da471cb54f0019e7f6
MATLAB
179
5
function rotatematlab(varargin) % This function calls the Matlab rotate function % This prevents the issue with the function in the private folder of Dipfit rotate(varargin{:});
1759346d02ad9e8a854ab9f6ad18c0438c756d6d698695b20b3871197258bce0
MATLAB
180
5
ecfunction p = mixpdf(x, mu, K, Pm) %weighted mixture of von Mises pdf and uniform pdf %p = vonmisespdf(x,mu,K)*Pm + 1/(2*pi)*(1-Pm); p = circ_vmpdf(x,mu,K)*Pm + 1/(2*pi)*(1-Pm);
1925f8f6d64a4067bfa0352638b614f05847a08026a04295bdfd481d07a0ac2f
MATLAB
181
6
clear all, close all mex -O -outdir ../compiled/ lbfgsAddC.c mex -O -outdir ../compiled/ lbfgsC.c mex -O -outdir ../compiled/ lbfgsProdC.c mex -O -outdir ../compiled/ mcholC.c
a68b2fdee3c9a0ce7638e377259912af02d3b86457fb585f1bd739e0d0b598e6
MATLAB
181
7
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'aodpre', 'pipeline_aod_preprocessing'); end obj = schemaObject; end
15ab74ba40eb49ff4b09a15be2b57075d5a47960aa93f0dd1792d61c41a979ab
MATLAB
182
9
%{ preprocess.Method (lookup) # methods for extraction from raw data for either AOD or Galvo data extract_method : tinyint # --- %} classdef Method < dj.Relvar end
c0968f9a52795e061d74556f2ecf177c0b85d2e912153e29cd0df866b8568560
MATLAB
182
3
function res = is_impure_expression(x) % an impure expression is a MATLAB structure with a .tracking.expression field res = isfield(x,'tracking') && isfield(x.tracking,'expression');
07add6ad4d9f0bb5fd19964edc328c5e5a4e6e1df821373c10b83f241a81a6a6
MATLAB
184
3
function res = has_canonical_representation(x) % determine whether an expression is represented as a struct with the fields 'head' and 'parts'. res = all(isfield(x,{'head','parts'}));
e6c6c60b716a5d987ac2cba883ee1d4f573cd491d1a947f2884820f7f573a99b
MATLAB
184
3
% determine whether some object is a raw EEGLAB data set with no BCILAB constituents function res = is_raw_dataset(x) res = all(isfield(x,{'data','srate'})) && ~isfield(x,'tracking');
19af4d8fb6e170e62f30abbff5764bf46fae75db9559f46d3ac713c2eb1053e2
MATLAB
185
7
function effectsize = effsize_ind(x, y) meandiff = mean(x, 'omitnan') - mean(y, 'omitnan'); std_pooled = std(x, 'omitnan'); %independent groups effectsize = meandiff./std_pooled; end
36555ff60ea13b8269d9c9f1978e5a46cc18c230ea857dc46a30f8c020896cf6
MATLAB
185
10
function profile_start(profile_on) if ~exist('profile_on','var'), profile_on = 0; end; if profile_on == 0, tic elseif profile_on > 0, profile on -detail builtin tic end;
5c840b793366348816207520fa3554e389acc3fa8ae3bf1ebd9137e7050f8845
MATLAB
185
3
function result = hlp_memfree % Get the amount of free physical memory, in bytes result = java.lang.management.ManagementFactory.getOperatingSystemMXBean().getFreePhysicalMemorySize();
f2ba0b13752c359d6994d09a13f92e7fda7cec68e876eb42c4f260838b006a33
MATLAB
185
6
function duline(start, stop, varargin) % Line annotation in data units. annotation(gcf, "line", du2nfu([start(1) stop(1)],'x'), du2nfu([start(2) stop(2)],'y'), varargin{:})
17fc0090c1bfdf276233b17af8848b178d6452b44e587f27d61e98fa11c1ddca
MATLAB
186
10
function outp(address,byte) global cogent; %test for correct number of input arguments if(nargin ~= 2) error('usage: outp(address,data)'); end io64(cogent.io.ioObj,address,byte);
61463a77ca015a89e81c08ae12af2f80178f6d93496f8145495a88b57be344cb
MATLAB
186
7
function callLCModel(controlFile, pathLCModelBinary) % Wrapper function for LCModel binary callLCMCommand = ['"' pathLCModelBinary '" < "' controlFile '"']; system(callLCMCommand); end
a9da64b879b93e77aea5a399c49b33f06cff790aace12bb41da9e46459eb2526
MATLAB
186
9
function pial=mapPial(region) VG=spm_vol(region(1,:)); pial=zeros(VG.dim(1:3)); for i=1:VG.dim(3), pial(:,:,i) = spm_slice_vol(VG,spm_matrix([0 0 i]),VG.dim(1:2),1); end end
ae6a5698766961d7ba597fd8cb25405b6372f7ee76e02ec7d090cd146d06a151
MATLAB
186
10
%{ # key to original visualization -> vis.MostExciting --- -> `cortex_ex_machina_madness_analysis`.`__visualization__most_exciting_image` %} classdef MostExcitingCNNKey < dj.Manual end
e33862969c2df832cde55fde4c19d659521c8bbfb603a8c3393ecd6a76e73cf5
MATLAB
186
4
function p = mixpdfGauss2(x, mu, sigma, Pm, sigma2, Pm2) %weighted mixture of von Mises pdf and uniform pdf p = normpdf(x,mu,sigma)*Pm + normpdf(x,mu,sigma2)*Pm2 + 1/(2*pi)*(1-Pm-Pm2);
e51da381431457b97c582f1040829be7df36a1a767bd2cbd70b72256d1ed86df
MATLAB
186
10
%{ experiment.Person (lookup) # Users username : char(12) # lab member --- full_name : varchar(2048) # %} classdef Person < dj.Relvar end
e090f0c44eb608abe1ca98593f44db1ebc3322a37b332cec02e0df47ed76a142
MATLAB
187
9
function tr = sero_srr_time2tr(t) % function tr = sero_srr_time2tr(t) tr = nan(size(t)); for i = 1:size(t,2) ind = find(~isnan(t(:,i))); tr(ind, i) = diff([-inf; t(ind,i)]); end
0cfee5d5593f4770bb8bacb2e9e0f756a07f86c12cb1ead44bd823c1a5f9eb26
MATLAB
188
5
data = readtable("file.csv"); test_data = data(data.freq_band == "high_gamma", :); [p, tbl, stats] = anova1(test_data.dur, test_data.period); [results, ~, ~, gnames] = multcompare(stats);
bdbfe2b851c33a4e1b5de3b94ce70ebabf2443287714cf4f12645c834b36debd
MATLAB
188
6
function duarrow(start, stop, varargin) % Arrow annotation in data units. annotation(gcf, "arrow", du2nfu([start(1) stop(1)],'x'), du2nfu([start(2) stop(2)],'y'), varargin{:})
e88fc31441c7142bc1b8fd4d5d51911041b49f263528d42f514e8f406bb392f5
MATLAB
188
7
% this function is called when the file is being saved function obj = changefile(obj, newfile) movefile(obj.dataFile, newfile); obj.dataFile = newfile; obj.writable = false;
1a947434eec1ecafe12b070b95250881104ca86a67c7ec6a25cc64cab5a2881d
MATLAB
189
5
function ptime(T) ehour = floor(T/3600); emin = floor((T-ehour*3600)/60); esec = floor( T - ehour*3600 - emin*60); fprintf('ELAPSED : %d hours %d min. %d sec.\n', ehour,emin,esec );
1f74e879fce42750a68597b86f5e5832ab95b3758a8bb0a8fa58eb2d44ca2831
MATLAB
189
11
function [states] = tapas_linear_init_states(data, model, inference) %% % % aponteeduardo@gmail.com % copyright (C) 2016 % state = tapas_linear_init_states(data, model, inference); end
95e2c9cb1649f80635088d6a098320ef47764468801874e984ebb86dea159956
MATLAB
189
9
%{ preprocess.Channel (lookup) # recording channel, directly related to experiment.PMTFilterSet.Channel channel : tinyint # --- %} classdef Channel < dj.Relvar end
e1c1a354eccd38e5cd1da326cae24a10d1bb42290d1d61af56ee2f851c4736b6
MATLAB
189
15
function [ant] = iseven (x); % [ans] = ISEVEN (x) % returns 1 if x is even and 0 if x is odd % % Ziad Saad May 8 95. d = x ./ 2; if fix(d) == d, ant = 1; else ant = 0; end;
8766a24cef389ed6eadefca43eb2aa19472b56c7e38f8fec02bdb8db73705921
MATLAB
191
17
function S = getPES(data) nPars =numel(data); nCons = 2; for pars = 1:nPars parData = data(pars).outcome; parData = data(pars).rt; end end
aa282f249008c9d52248eb628c6c749bdc12ab84525e7e83c1917ce7526068c8
MATLAB
191
3
function res = is_builtin_function(x) % check if the given object is a valid handle to a builtin function res = isa(x,'function_handle') && exist(char(x),'builtin') && ~exist(char(x),'file');
f0d8d1d2f5b345fb946b27b0bb05721d7dd310bc9a01a1d58fc1b28b2aeb4a65
MATLAB
192
10
%{ # key to original visualization -> vis.MostExciting --- -> `cortex_ex_machina_madness_analysis`.`__linear_visualization__most_exciting_image` %} classdef MostExcitingLNKey < dj.Manual end
f3f0851655d1aeebc8ba07b7c1e1829673bf2293535aba5ff8cddea7c269403a
MATLAB
192
11
clc,clear imgs = {'t1.nii' 'meanfundata.nii'}; TMSSloverSPM(imgs,'correct') close all clc,clear imgs = {'t1.nii' 'mfun (copy).nii,1'}; wgr_slover_spm(imgs,'false') close all
804d9b8443c1a6325aa3e727fb073b54a91a9944de389dd2a028bc0ca34a1a9c
MATLAB
193
8
function plot(acq, cfg, varargin) % Placeholder plot function for a McsCmosLinkedDataSource object % % function plot(acq, cfg, varargin) % % This function is empty at the moment end
1561618b34972fcefcad16712c368850216418d564ff557880abbb3362b0526a
MATLAB
194
10
function Models = modelRDMs_SL_sim() % Models.main_clusters = kron([ 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0], ones(10,10)); % Models.random = squareform(pdist(rand(40,40))); end%function
7ecfe6bb69f2a0a1d27a6c2c45c762758d0a2988e67424a5d41c9517507d7eb8
MATLAB
194
10
function unwarpfun = unwarp(warpfun) for i = 1:warpfun(end) n = find(warpfun ==i); if isempty(n) unwarpfun(i) = unwarpfun(i-1); else unwarpfun(i) = n(1); end end
41a3de3a670d1214fa1150a304866400f9f70bcbef9ba643d99b53057c380dc8
MATLAB
195
10
%{ preprocess.MethodGalvo (lookup) # extraction methods for galvo -> preprocess.Method --- segmentation : varchar(16) # %} classdef MethodGalvo < dj.Relvar end
71b95fcfd8ed79d761017589c6ead5abefdfdb2b5dcdd74935fcb640e42c51f1
MATLAB
195
5
% MATLAB runs the test [result,rt] = UnitTest('SinglePRESS',2,1); assert(sum(rt{1}.Failed) == 0 && sum(rt{1}.Incomplete) == 0 &&sum(rt{2}.Failed) == 0 && sum(rt{2}.Incomplete) == 0)
69ab95945afd18dabfaec358f558eb6bfede8c53527902a1d2fc14c11f548044
MATLAB
196
6
function ID = coordinates2ID(coordinates, numRows, numCols) ID = numRows*(coordinates(1)-1) + coordinates(2); if ID > (numRows * numCols) error('ID out of range!') end end
74e6695fbb661b0680293ae0351bcfe283a9272ec7ab9b2d7072c0b55e7428ef
MATLAB
196
7
function effectsize = effsize(x, y) meandiff = mean(x, 'omitnan') - mean(y, 'omitnan'); std_pooled = (std(x, 'omitnan').^2+std(y, 'omitnan').^2)./2; effectsize = meandiff./sqrt(std_pooled); end
0d85ae6cdbe63220aa1e2e4319091688c4310469b9521a425128c369f7110bdb
MATLAB
197
10
list = ls('*.m'); for k = 1 : size(list, 1) s = strtrim(list(k, :)); s = s(1:end-2); % remove '.m' if ~strcmp(s, mfilename()) % don't run yourself eval([s, ';']); end end
d241ebbe5665bc154c04adb7eb40cb1d4786b5fab3276619d83838705021c9a0
MATLAB
198
10
%{ preprocess.CircleRadii (lookup) # my newest table # add primary key here radius : smallint # radius of the cluster ----- # add additional attributes %} classdef CircleRadii < dj.Relvar end
f5781be97f245ed5ff6ed96d776471f6214182d86d2302de1a4cb5f8bfcd3046
MATLAB
198
7
function [ output_args i_shuffle ] = shuffle_vector( input_args ) %shuffle Shuffles the elements of a vector i_shuffle = randperm( numel( input_args ) ); output_args = input_args( i_shuffle ); end
3c7bee8d9c0a3d281c14b74efbed251e809d26839fe6aa8d32ea9f5bfee4b2eb
MATLAB
200
11
function hsi_nr = remove_hylid_noise_bands(hsi) hsi_nr = hsi; [nb,nb_inds] = hylid_noise_bands(); hsi_nr.info.wavelength = hsi.info.wavelength(~nb_inds); hsi_nr.Data = hsi.Data(:,:,~nb_inds); end
7a82ad59e16c2c8e303d62068c55e1edd17acc46634103762275ad9d54b747d4
MATLAB
200
9
function res = afni_isdigit(s) % res = afni_isdigit(s); % res(i) = 1 is s(1) is a digit between 0 and 9 (inclusive) % digit_msk=s >= '0' & s <= '9'; res = zeros(size(s)); res(digit_msk) = 1; return;
03c09864b451853764c90abe48fa94ff932adc5b33d5179abcea5057aa024ffb
MATLAB
201
12
function dg = diGamma(a, p, k) if nargin < 3 k = 0; if nargin < 2 p = 1; end end dg = 0; for i=1:p dg = dg + psi(k, a + (1-i)/2); end end
d0daa4019cd7cf4f6af049acbf01fa7adccf2c8d76c3c7b3d2feba38ea8a27f8
MATLAB
201
8
while true parpopulate(pre.ExtractSpikes) parpopulate(monet.DriftTrialSet) parpopulate(monet.DriftResponseSet) parpopulate(monet.VonMises) parpopulate(monet.RF) pause(1000) end
b06b0f7cc786a09f7227f897272cb549c66b2de2cb4d1eafcef93251c79e7a27
MATLAB
202
8
function retval = startsWith(s, prefix) n = length(prefix); if n == 0 # Empty prefix retval = 1; # Every string starts with empty prefix return endif retval = strncmp(s, prefix, n); end
e8b7e1f73d450a80891b7fc46abeee7372910a8916b95f2cdc940ffa79e8944e
MATLAB
202
12
function y=Afunc(x) % y=Afunc(x) % Testfunction returning a linear operator applied to x. % Used for testing lansvd. % % y = A'*x % Rasmus Munk Larsen, DAIMI, 1998 global A MxV y = A*x; MxV = MxV + 1;
546a7ff527ce052a05f1ef284a69fa9bd792ec8b8ba217dd52edd4b195bad559
MATLAB
203
9
function obj = getSchema persistent schemaObject if isempty(schemaObject) psy.getSchema; common.getSchema; schemaObject = dj.Schema(dj.conn, 'rf', 'pipeline_rf'); end obj = schemaObject; end
dc6ed8b8d0a9eb90d821afc1c18018d0350fd610c73d79bf3f7a694e39512466
MATLAB
203
16
function [data] = tapas_linear_data(y, u, pars) %% % % aponteeduardo@gmail.com % copyright (C) 2016 % tapas_linear_validate_data(y, u); data = struct('y', [], 'u', []); data.y = y; data.u = u; end
16b76780d783278cf6dbccca9467622416f52b909ef4c01c7eb5d0fe170d3356
MATLAB
204
14
function generate_SPD_matrix(n, density) A = sprandsym(n,density); % generate a random n x n matrix A = A + n*speye(n); X = rand(n, 1); B = A*X; save A4.txt A save B4.txt B save X4.txt X endfunction