sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
91158af80f9e990707913d6985912f9508975d1ade247b8c16853160b763c121 | MATLAB | 1,444 | 41 | function [X, Y, Z] = extract_contour(pos, tri, indx, mask)
% EXTRACT_BOUNDARY generates contour around specified vertices of a
% triangulated surface.
% It returns the coordinates of the vertices which form the contour
% % Use as
% [X, Y, Z] = extract_contour(pos, tri, indx, mask)
%
% where mask specifies which ve... |
9a94fa20d1c9bce073e3e167e0f2557aa26c372f253eecab0a2ce162c8851ba9 | MATLAB | 1,444 | 54 | function gifmaker(filename,out)
filename = append(filename,'.gif');
PART = out.MOV.P; NEUR = out.MOV.N;
div = out.div;
[X,Y] = meshgrid(1:div);
s = out.s;
f = out.f;
mapcol(:,:,1) = [ repmat([1 0 0],s,1) ; 1 1 0 ]; % strain 1: A yellow, B red
mapcol(:,:,2) = [ repmat([0 0 1],s,1) ; 0 1 .5 ]; % strain 2: A g... |
a4724449e7a39f0d9c9cd625acdcc9d6af58db1476e432c1900b4f2ec5d8bcce | MATLAB | 1,444 | 46 | function [Pw] = RFT_Pval(u,k,c,fwhm,L,type,dof)
% computes Pval according to Friston et al. (1996), Eq. 1-4.
% [Pw] = RFT_Pval(u,k,c,fwhm,L)
% This function ca be called to derive the p-value at different levels of
% inference, i.e.:
% - P_peak = RFT_Pval(u,0,1,fwhm,L)
% - P_cluster = RFT_Pval(U,k,1,fwhm,L), where U wa... |
d1d91ba82ea7f0fb35153a1e5a1f7d42136bb248b6c56c9e4da2d87f2d0f1355 | MATLAB | 1,444 | 30 | function [ cfg ] = ft_trialfun_balert( cfg )
%ft_definetrialBAlert: Extract trials B-Alert data from CSV file.
% FieldTrip cannot yet interpret the event markers from B-Alert data.
% Therefore, it is necessary to have B-Alert LAB. This is (paid) software
% from Advanced Brain Monitoring, in which you extract the... |
2370ae01c1d5881e2d4c57fd85f0c72962bbff087bde54710e332054d0d3a82a | MATLAB | 1,445 | 65 | function [sigma, shrinkage]=shrink2para(x,shrink)
% Shrink towards a 2 parameter matrix
% function sigma=cov2para(x)
% x (t*n): t iid observations on n random variables
% sigma (n*n): invertible covariance matrix estimator
%
% Shrinks towards two-parameter matrix:
% all variances are the same
% all covariances ar... |
5d7a8380f5b78aec3df7ba48ab517a0b313190cc5a966bb0baa9679cecd2d094 | MATLAB | 1,445 | 34 | function manipulation = make_manipulation_file(basepath,varargin)
%Make manipulation file loads the analogin.dat file and retirieves the
%channel associated with optogenetic stimulation waveform.
p = inputParser;
addParameter(p,'stim_channel',16,@isnumeric) %snlab rig wiring for opto digitalin events
addParameter(p,'r... |
61588b447074605353a61e6c2369792688931a61535cb416d135f79b8f9aff65 | MATLAB | 1,445 | 30 | function [TempTrace2]=Smart_Trace_Align(TempTrace1,AlignFrame,FrameWindow,MaxFrames)
%Smart_Trace_Align(All_TestTraces_DeltaFF0(i,:),All_TestTraces_Event_Peaks(i),EventDetectionSettings.SimpleEventTestFrameWindow,ImagingInfo.FramesPerEpisode)
% TempTrace1=All_TestTraces_DeltaFF0(i,:);
% FrameWindow=EventDetectionSet... |
ae2e7bfdaa6baec311edf57716ea768310bf07ddf09acd9af5a16a95a5a8e294 | MATLAB | 1,445 | 37 | function data = fixcoordsys(data)
% FIXCOORDSYS ensures that the coordinate system is consistently
% described. E.g. SPM and MNI are technically the same coordinate
% system, but the strings 'spm' and 'mni' are different.
%
% See also FT_DETERMINE_COORDSYS
% Copyright (C) 2017, Robert Oostenveld
%
% This file is part... |
fa2ab790ee9a87cad2c8948d12caa555cd9171c146b08e507c18d68e6561866d | MATLAB | 1,445 | 52 | function clf = clfLda( p, type, prior )
% Create a Linear Discriminant Analysis (LDA) classifier.
%
% Same algorithm as matlab's function 'classify' (in the statistics
% toolbox). Nice to have in form that actually stores a model that can be
% applied multiple times. For the meaning and usage of prior and type see
% c... |
30a9f998aa3fd102abce6a827e3037eafd479ef13dbfc8d8c4ee0983457f61c0 | MATLAB | 1,446 | 44 | function a = subsref(t,s)
%SUBSREF Subscripted reference for tenmat.
%
% Examples
% X(i,j) <-- returns the (i,j) entry in X
% X.data <-- returns a 2D array of the data
% X.tsize <-- returns the size original tensor
% X.rdims <-- tensor dimensions that were mapped to rows
% X.cdims <-- tensor dimensions that... |
c606e650dea2955fc6821d623d5b434d420c9b42d4c28eab529e3d46830b436d | MATLAB | 1,446 | 43 | %function calib_gui_normal,
cell_list = {};
%-------- Begin editable region -------------%
%-------- Begin editable region -------------%
fig_number = 1;
title_figure = 'Camera Calibration Toolbox - Standard Version';
clear fc cc kc KK
kc = zeros(5,1);
clearwin;
cell_list{1,1} = {'Image names','data_calib;'};
... |
4505d02de260b20c8056258a4f6b16faf0c7f5bbcc5e077c144aa84e8957e8d3 | MATLAB | 1,447 | 65 | %% Compare Bayes and ERM
% Based on Minka 2001
% http://research.microsoft.com/en-us/um/people/minka/papers/erm.html
setSeed(0);
mu = 5; N = 20;
[styles, colors, symbols, str] = plotColors;
names = {'bayes', 'ERM'};
%% Gaussian case
for trial=1:5000
y=randn(1,N) + mu;
yhat(1) = mean(y); % bayes
yhat(2) = medi... |
c0e68d63d06cd3dc5afc07ab8dc92fe23729ba8d975fdc2f9397b5ca69276020 | MATLAB | 1,447 | 56 | % Calculates DF/F
% DF/F is defined with the following formula
% dF/F =( F(t) - F0)/F0
% where F0 is baseline, F(t) is each time point for a given cell
% F0 is defined as the median of a 10s window around F(t)
Fnorm = F-0.7.*Fneu;
dfftraces.all = Fnorm;
wdwSize = round(60/si_img*1000); % size of window for F0 (in ... |
ceb53fc36b40530b840e4bb569c10d55729c94c621eff1869d99ab6c07f612cb | MATLAB | 1,447 | 60 | function [Aout] = esoin_processSAD(synapseAnalysisData,filter)
sad = synapseAnalysisData;
presence = sad.presenceMatrix;
questionable_incidents = sad.lowSynapseConfidence;
spine_presence = sad.isSpineMatrix;
synapseIDs = sad.synapseNumber;
fns = sad.analysisFileName;
notes = sad.synapseNotes;
%~~~ Shitty Code Below, ... |
cfaa2b0818904b9b8a2f14a6a2714e1f30041a3cd3366a183bfd3fa722f6b290 | MATLAB | 1,449 | 73 | function ploteeglab(LAN, marca)
% v.0.0.1
%
%
% Herramienta para graficar formato LAN
% Usando EEGLAB
%
%
%
%
% 7.4.2009
if nargin < 2
marca = [];
end
EEG = LAN;
if iscell(LAN.data)
try
a = cat(3,EEG.data{:});
epo = 1;
EEG.trials = length(EEG.data... |
0f8eabf00fa3e6f5c5da119c9f08123b12d413621578934c2bd1d70bec0445fb | MATLAB | 1,450 | 87 | function [T, preorder] = mkRootedTree(adjMat, root)
% Adjmat should be the adjacency matrix of an undirected tree
% All arrows point away from the root (root defaults to 1)
% T is a sparse matrix.
% Also returns nodes in pre-order (parents before children)
% This file is from pmtk3.googlecode.com
%{
Example
1 ... |
746e34574fc2df32f3c0139f720bf70316d48b8e6342d4f32085def5ddd25f9a | MATLAB | 1,450 | 50 | function c_fit = SearchSigmoid(x, y, c0, ShowPlot, offset)
if nargin < 5
constrain_offset = false;
else
constrain_offset = true;
end
if nargin < 4
ShowPlot = false;
end
SigFun = GetSigmoid(2);
% Search optim
if constrain_offset
SigmoidFun = @(c) 1./(1 + e... |
bd247d8c67cfedd66c97b0b87ffd1c4e082fe3c9b7d9f9de1458a4e3ec47f1c5 | MATLAB | 1,450 | 64 | % this demo looks at analytical approximations to the product of two
% sigmoids
close all
clear all
x = -50:5e-2:50;
nx = length(x);
s1 = VBA_sigmoid(x);
a = -2:4; % slope
b = 0;%-4:4; % inflexion point
na = length(a);
nb = length(b);
dim.p = nx;
dim.n_t =1;
dim.n_phi = 2;
dim.n_theta = 0;
dim.n = 0;
g_fname = @g_s... |
61a6a3a179f155b1111d4b7c166329a405253ba1e040c85626962ac3f773aea3 | MATLAB | 1,451 | 34 | function [featureLexiconNameList, ...
featureLexiconFileNameList, ...
featureLexiconAnimalTypeList] = ...
getFeatureLexiconListsFromXML()
% Figure out the name of the XML file holding the list of the possible
% feature lexicons
if isdeployed() ,
filename = deployedRelative2Global('params/featur... |
739c11da38e1f26867321a4669d2edcafd68fb4be21696af7b801eb6f7897b24 | MATLAB | 1,451 | 30 | disp('############################################');
disp('#### Design a rosette trajectory ####');
disp('#### ####');
disp('############################################');
disp(' ');
Gmx = 4;
Smx = 15;
T = 17/Gmx;
Kmx = 6;
w1 = 0.147*2*pi*Gmx;
w2 = 0.087/1.02*2*pi*Gmx;
t = 0... |
3a9753ac2c4bb3edaefb27e021aefc6f4557e0ca205d46b9e2914f6936166fe1 | MATLAB | 1,452 | 59 | % [snd] = singlebup_old(srate, att, { 'width', 5}, {'ramp', 2}, {'basefreq', 2000}, ...
% {'ntones' 5}, {'PPfilter_fname', ''}); ...
function [snd] = singlebup_old(srate, att, varargin)
pairs = { ...
'width', 5 ; ...
'ramp', 2 ; ...
'basefre... |
7c7655e5e9b1612b5369050fbb019a58caeaf855590fe8605bd63ab1f801e1e1 | MATLAB | 1,452 | 39 | function D = dfunm(funm, X, H)
% Fréchet derivative of matrix functions.
%
% function D = dfunm(funm, X, H)
%
% Computes the directional derivative (the Fréchet derivative) of a matrix
% function (such as @logm, @expm, ...) at X along H (square matrices),
% according to a very nice trick which appears in this pa... |
8b938ecba211d36784b15e3e607c475b0f835ca8bfe036224c2d12e6595f2220 | MATLAB | 1,452 | 48 | function [data_crop,data_outofcrop,Int] = loc_list_roi_DualChannel(data,Int)
global Int
if isempty(Int)
Int = 1;
end
try
coordinates = getline();
data_crop = cell(1,length(data));
data_outofcrop = cell(1,length(data));
for i = 1:length(data)
[data_crop{i},data_outofcrop{i}] =... |
8e42014994b20759490aa5cf172d4f8b238c9cfc4c5784b84e026e9e0529c4a4 | MATLAB | 1,452 | 56 | % plot_FigS7
%% Setting up the parameters
load(fullfile(saveLoc, 'sig_allSessions'))
% For highlights plot
sigCohs = nanunique(sigSL.sig_coh); plotCohs = [6 2];
plotSig = {'WhenD', 'WhatD'};
sigName = {'S^{when} [a.u.]', 'S^{what} [a.u.]'};
yLims_BLsub = {[-.8 1.4], [-1 2]};
yTicks = {[-.5 0 .5 1], [-1 0 ... |
144cb95d39fcad63c3684805607678455b91225206ddedc7d0025bed659aef82 | MATLAB | 1,453 | 47 | % Pre-create the experimental information to load during the experiment.
% 171206 adapted from MR version to EEG for older adults
%% initialize
if ispc
pn.root = ['C:',filesep,'Users',filesep,'eeg',filesep,'Desktop',filesep,'StateSwitchEEG_OA',filesep,'C_Paradigm_171205',filesep];
else
disp('Setup no support... |
3daa6177923dbf8ee50bb9ed132db3165511310b398ffc158a5ca78fe530c64f | MATLAB | 1,453 | 32 | function [fx] = f_kToM(x,P,u,inF)
% wrapper around recursive k-ToM evolution function
% function [fx] = f_kToM(x,P,u,inF)
% A k-ToM agent with k>0 learns the unknown parameters (theta) of her
% opponent's learning and decision rules. Typically, theta includes her
% opponent's prior volatility about herself (which contr... |
6f84ed4e498eedb0f80a93e6d529b23af7c61c1e6e1f46c50456bba07c9ce616 | MATLAB | 1,453 | 46 | function [localCPDs, localCPDpointers, localMu, localSigma] = ...
condGaussCpdMultiFit(X, obs, Nstates)
% Fit a set of conditional Gaussian distributions
% Xj -> obsj for j=1:Nnodes
% X is Ncases*Nnodes, X(i,j) = {1..K}
% obs(i,j,:) are the observations for node j in case i
% So obs is Ncases * Nnodes * Ndims
[Ncase... |
9fe4635dc5a0d69f108ef726f9e359b9fbe3d2dbd5a7b987bb1260c06513d97d | MATLAB | 1,453 | 49 | %% Illustration of bigO and bigTheta.
%
%%
% This file is from pmtk3.googlecode.com
function bigO
domain = 0:0.01:6;
f = @(x) 0.5*x + 2*gaussProb(x,1,0.5.^2)' + gaussProb(x,2.5,0.2.^2)' + 0.2*sin(x);
g1 = @(x) 2*x/3 + 0.3*sin(1.1*x) + 0.7;
g2 = @(x)0.5*g1(x);
intersect = find(abs(f(domain) - g1(domain)) < 0.05);
x... |
1fd95b56953d3497f7d3376a6ae35e67999c7e32f7930c0514c034ba4fdab549 | MATLAB | 1,454 | 48 | function shift = phaseOnlyCorrelation(baseImg,moveImg,offsets)
%border_mask = zeros(size(baseImg));
%border_mask(1:offsets(1)+1,:,:)=1; border_mask(end-offsets(1):end,:,:)=1;
%border_mask(:,1:offsets(2)+1,:)=1; border_mask(:,end-offsets(2):end,:)=1;
%border_mask(:,:,1:offsets(3)+1)=1; border_mask(:,:,e... |
3cca1c22f601c62de1c024ff9540dd8a681e2c64d63ac0ef9fc48d762e858c3a | MATLAB | 1,454 | 44 | function varargout = VBA_spm_get_defaults(defstr, varargin)
% Get/set the defaults values associated with an identifier
% FORMAT defaults = spm_get_defaults
% Return the global "defaults" variable defined in spm_defaults.m.
%
% FORMAT defval = spm_get_defaults(defstr)
% Return the defaults value associated with identif... |
7d798a8f13944fbe09c225a0cbfcd8f8098089dd08ec890ca49d56c5effab5a4 | MATLAB | 1,454 | 50 | function [volume, permutevec] = volumepermute(volume, permutevec)
% VOLUMEPERMUTE
%
% See also VOLUMEFLIP
% do a low-level check on the input data
if ~isfield(volume, 'transform'), ft_error('the input volume needs a transformation matrix'); end
if ~isfield(volume, 'dim'), ft_error('the input volume needs a dim ... |
cb328e7a2a3f30aacc554750a665246a62fe669dd1a0bd8e5b60c29775ca752f | MATLAB | 1,454 | 45 | function n = CombinePermData(saveFolder, varNames)
% load up each perm file, combine 3rd dim, save per var
if ~exist('varNames','var') || isempty(varNames)
varNames = {'velres', 'srt','depAngle'};
end
nVars = length(varNames);
if ~exist('saveFolder','var') || isempty(saveFolder)
saveFolder = './Data/';%'C:\Us... |
654c1b53eddcb67fd5471e1a0dec3e80c8de741f5b4ccc71405af41c2ae6b0d6 | MATLAB | 1,455 | 52 | classdef MovieIndex < int32
% A MovieIndex is a unique identifier for a movie(set) in an APT project.
%
% For a long time, this purpose was served by a single positive (row)
% index into labeler.movieFilesAll ('iMov'). With the addition GT mode
% and the GT movielist, a single positive index is no longer su... |
967c31f806a6c77030055b99706d7fb1ce1dd4e2aaa8f510dc0a1c3a889989e5 | MATLAB | 1,455 | 45 | function [Res] = cal_pFit(data,opt,varargin)
% opt.lanmuda
% opt.xThr : the maximum of x obtained from fit curve
% opt.yThr
% opt.thrMethod
% opt.plotYN
% varargin: fitMethod:
% fitRes: if fitted previous, use this function as:
% Thrcal(data,opt,'fitRes',fitRes);
mIp = inputParser;
mIp.a... |
9d69f1afa9507e39420aca291e4e6996be8387090409b70d3d52fb24bfaad2bd | MATLAB | 1,455 | 40 | % function WriteMatrix2Text ( X, FileName, FmtStg, CaseCol )
%
% This is a generic routine to write a data matrix to an ASCII file.
%
% Usage: WriteMatrix2Text ( X, FileName, FmtStg, CaseCol );
%
% Input arguments: X data matrix
% FileName file name string
% ... |
4fedc04d24f2e74e5c5b4c715a0471994d41ca6e39c1a37a2534cfe04ec94977 | MATLAB | 1,456 | 58 | function [outputs] = oof_fitting_v2(psd_in_db,frequency_domain)
%FOOOF_MATLAB_V1 Summary of this function goes here
% Detailed explanation goes here
% psd_in_db and frequency_domain should be column vector
% frequency_domain should avoid 0
%% functions for fitting
modelfun = @(b,x) b(1) - log10(b(2) + x(:,1).^b(3));... |
91e1466c2d10e9c2aad9cae093e39fb78e06d7884171843099a588477ab7aca3 | MATLAB | 1,456 | 37 | % This script computes and plots the magnetic field magnitude
% (or any of the components) for any brain compartment surface/interface
%
%
% Copyright SNM/WAW 2017-2024
%% Compute the B-field for all surfaces/interfaces
tissue_to_plot = 'Skin';
objectnumber = find(strcmp(tissue, tissue_to_plot));
Point... |
abb455c509d2bd3060600c94ae51459ed85b232d6a5bd1b98610cc23ff1c8896 | MATLAB | 1,456 | 45 | function gz_blips = prepare_gz_blips(params)
lims = params.gen.lims;
% Kz Blips:
tmp = params.gen.n(3);
if mod(tmp,2) == 1; tmp = tmp + 1; end
for i=1:tmp
if mod(params.gen.n(3),2) == 1
area = -(params.gen.del_k(3)*(params.gen.n(3)/2))+(params.gen.del_k(3)*(i-1))+(params.gen.del_k(3)... |
d8b5ae2b697e0265746930ee8164fc8d10e0e38087dc149eea1f5cf062b67438 | MATLAB | 1,457 | 43 | function [event]=ft_fetch_event(data)
% FT_FETCH_EVENT mimics the behaviour of FT_READ_EVENT, but for a FieldTrip
% raw data structure instead of a file on disk.
%
% Use as
% event = ft_fetch_event(data)
%
% See also FT_READ_EVENT, FT_FETCH_HEADER, FT_FETCH_DATA
% Copyright (C) 2008, Esther Meeuwissen
%
% This file... |
edc06bad5ea98db9617235a23cca57e35c42c53f459942d66316a21314355b0c | MATLAB | 1,457 | 53 | function gifmaker(filename,out)
filename = append(filename,'.gif');
PART = out.MOV.P; NEUR = out.MOV.N;
div = out.div;
[X,Y] = meshgrid(1:div);
s = out.s;
f = out.f;
mapcol = [ autumn(s) ; 0 .9 0 ]; % A green, B red/yellow based on size
% Setup figure
figure('units','normalized','outerposition',[0 0 1 1]); ho... |
b7f6430abf1ed214ce8aebe1126f6b0b2fee21b7fb867b37e3c2b8e9807d3699 | MATLAB | 1,458 | 47 | function [dat] = ft_preproc_derivative(dat, order)
% FT_PREPROC_DERIVATIVE computes the temporal Nth order derivative of the
% data
%
% Use as
% [dat] = ft_preproc_derivative(dat, order)
% where
% dat data matrix (Nchans X Ntime)
% order number representing the Nth derivative (default = 1)
%
% See al... |
257fe6f4e2182fa873ebf4e151288d7f6498ede16fe624b36872f6a826c62f2b | MATLAB | 1,459 | 48 | function L2 = sp_merge(L,img)
for threshold = 1:27
el = unique(L);
el(end+1) = el(end) + 1;
[counting,dict] = histcounts(L(:),el);
target = dict(counting==threshold);
for obs = 1:numel(target)
inx = find(L == target(obs));
[i,j,k] = ind2sub(size(L),inx);
si... |
6c6fa518f6bd185c1333193d81b24b7fc167482da8879004f9ce3c8d9fdf6779 | MATLAB | 1,459 | 57 | function obj = TLsmoothVols(obj,smoothingFWHM)
%
% optional inputs formatted as with a call to fnames.
f=obj.tMNI_run;
for i=1:length(f)
nv(i)=length(tippVol(f{i}));
end
disp('This will smooth the following volumes:'); pause(eps); drawnow;
for i = 1:length(f)
disp(f{i}... |
2d0323b41604670a925e546aecfb5b21a029063af9494c0165d0fa6d1e6e4ed3 | MATLAB | 1,460 | 48 | %{
## Example command locally:
workspace = getenv('WORKSPACE');
mappers_path = [workspace, '/results/cme_mappers/mappers_cmev6kval_fast.json/SBJ01/'];
output_path = [workspace, '/results/cme_mappers/res.csv'];
## Run the with the following command on Sherlock (on `sdev`)
module load matlab
ARGS=""
ARGS="$ARGS mapper... |
e68ff34e8c798610c9b62d8820f94f131dc792e56e16b3f779e07e240570de87 | MATLAB | 1,460 | 44 | function fx = f_RLinGame(x,P,u,in)
% Reinforcement-learner in a dyadic game
% function fx = f_RLinGame(x,P,u,in)
% An RL agent learns by trial and error. The RL agent updates its action
% values as follows:
% V(chosen action) = V(chosen action) + alpha*(feedback-V(chosen action))
% V(unchosen action) = V(unchosen actio... |
0945b38b5752452c82e559d241a4f7e86c71c3f552a9411533b5e48eef917699 | MATLAB | 1,461 | 66 | function DATA = lan_getdatafile(filenames,filepath,varname)
% v.0.2
% DATA = lan_getdatafile(filenames,filepath,varname)
%
% 15.08.2022
% improve error in new MATLAB version
% improve seaerch for filena with extend path
if nargin == 0
help lan_getdatafile
if strcmp(lanversion('t'),'devel')
edit lan_getdat... |
5c8e2354f04125f85e626179fa7d3cb94ce908a4ec9d61584e8f27c7704706a4 | MATLAB | 1,461 | 84 | function [Xtrain, ytrain, Xtest, ytest] = processAmlAllData()
raw = getText('data_set_ALL_AML_train.txt');
raw = removeEmpty(raw);
raw = cellfuncell(@(c)tokenize(c, '\t'), raw);
raw(1) = []; % header
raw = cellfuncell(@(c)c(3:end), raw);
Xtrain = zeros(38, 7129);
for i=1:numel(raw)
Xtrain(:, i) = ce... |
b05facfd1babef3e0547fb6e6df3fbfbe82490f81e0086f830a824217dc543e9 | MATLAB | 1,461 | 51 | %% for representative figure purposes, shows the a traveling wave
clear
Fs = 20000/8;
load('D:\InVivo\S1-Baclofen\2022-04-07_Baclofen\4-baseline_220407_141157\Grid-LFP-DS.mat')
load('D:\InVivo\S1-Baclofen\2022-04-07_Baclofen\4-baseline_220407_141157\trialData.mat')
gridMapping = [15 0 16 31 ...
... |
f80082a2b8336fb5eccc73fda8ff8467cccb5a0a25fea1e86cf3515e1b0f4614 | MATLAB | 1,461 | 65 | %% Compare different inference methods for an HMM
%
%% Create a random hmm model
% This file is from pmtk3.googlecode.com
setSeed(0);
nstates = 250;
d = 10;
T = 100;
model = mkRndGaussHmm(nstates, d);
%% Sample data
X = hmmSample(model, T, 1);
%% infer single marginals using fwdback
tic
[gamma, logpHmm] = hmmInferNo... |
4f100ad029c1460e75fbec90ab7fa02410cc0e1671be16cb4a583463bcdf7346 | MATLAB | 1,462 | 30 | % 根据白化法或目标函数法构造出的空间滤波器矩阵CSPMatrix,提取CSP特征
function features = func_extractCSPFeatures(EEG, CSPMatrix, nbFilterPairs)
% Input
% EEG: 训练集或测试集
% EEG.x: (times, channels, trials)
% EEG.y: trials*1
% CSPMetrix: 学习到的CSP空间滤波器矩阵, 每个都是channels*channels
% nbFilterPairs: m
% Return
% f... |
dd51fcad402cec301007a8bc4cd5920bce720d3878f1378f3d88ab24b7ea84d5 | MATLAB | 1,462 | 45 | function redrawFarField(src,~,v)
h_f = gcbf;
nSl = numel(v.h_sliders);
nNonSi = find(size(h_f.UserData) > 1,1,'last');
nNonSl = nNonSi - nSl;
%% Set slider if source was one of the center buttons
for iSl = find(src == v.h_centerbuttons)
set(v.h_sliders(iSl),'Value',(numel(v.axisValues{iSl})-1)/2 + 1);
... |
39405050c98357d91aeeac5ec3ac3c304fc42b51781f218ab67a5f4052bf9d65 | MATLAB | 1,463 | 53 | function iimg_write_images(dat, volInfo, outnames)
% Write a series of Analyze images given inputs.
%
% :Usage:
% ::
%
% iimg_write_images(dat,volInfo,outnames)
%
% :Inputs:
%
% **dat:**
% voxels x images matrix of image data in index format
%
% **volInfo:**
% spm-style info structure; see iimg_re... |
5fc5ad947692db7cee707022f94fb3881fad80b137023c27bede1ca81223f3c3 | MATLAB | 1,463 | 37 | %function calib_gui_no_read,
cell_list = {};
%-------- Begin editable region -------------%
%-------- Begin editable region -------------%
fig_number = 1;
title_figure = 'Camera Calibration Toolbox - Memory efficient version';
cell_list{1,1} = {'Image names','data_calib_no_read;'};
cell_list{1,2} = {'Read image... |
6b535e952f114880ae03df5f4f4613f7f5fed21db7cfd6fd7d2d1402e80afc5a | MATLAB | 1,463 | 69 | function histo(x,N,odd,scale)
% PURPOSE: Plot a histogram
% ------------------------------------------------------------
% USAGE: histo(x)
% or hist(x,m,odd,scale)
% where: x = data
% m = approximate # of bins
% odd = 0,1 for bin placement
% Least significant digit o... |
98f519f4dd914c781795e0f7423b879711ded2639ffa9c84f109fef79f6ff07e | MATLAB | 1,463 | 38 | function PunctaStats=PunctaStatistics(Coord_Values, Pixel_Area, PixelScaleFactor_um_px, BinSize, BinMax)
Coord_Values=double(Coord_Values);
if size(Coord_Values,1)>size(Coord_Values,2)
else
Coord_Values=Coord_Values';
end
PunctaStats.Num_Puncta=length(Coord_Values);
Punc... |
8e666c8dec425b0ad327b9515da097fc4a51a5b481800d6e7099287a86736169 | MATLAB | 1,464 | 46 | % PadVelocity.m
% Sarah West
% 5/26/23
% Converts the short position & velocity behavior stacks.
function [parameters] = PadVelocity(parameters)
MessageToUser('Checking ', parameters);
input_data = parameters.input_data;
% If less than frames
if size(input_data.FL.total_magnitude, 1) < parameters.... |
9dd3ef6a14182348a37948adfd4ab0d49ce749746fad8b1af5b45cd483e6527a | MATLAB | 1,464 | 78 | function convMatMultDemo()
% convolution as matrix multiply
%% Demo of im2col
X = reshape(1:20, [4 5]);
phi = im2col(X, [3 3], 'sliding');
disp('X')
printMatrixToLatex(X)
disp('Xcol')
printMatrixToLatex(phi)
%% Single 2d filter applied to 2d image
setSeed(0);
X = randn(8,10);
F = randn(3,3);
Y = myxcorr2(X, F); % cr... |
e7ecd3a29c795ee12292f4410c84b19edcc32ea7ec0571528a3b526beef45c6a | MATLAB | 1,464 | 38 | function [time_projection] = assembly_activity(AssemblyTemplates,SpikeCount)
% Activities = assembly_activity(Patterns,Activitymatrix): computes the
% time course of the activity of assembly patterns defined in Patterns in
% the spike matrix Activitymatrix with single bin resolution.
%
% Description of inputs:
% ... |
572bb27358f97d68dedbd59b6338e2364260a54f076e6811b31eb6a52fdd9b4e | MATLAB | 1,465 | 43 | %% ensure2DMatOrientation
% Macro to ensure that the direction of data is as expected.
% (Occassionally, MATLAB will represent what should be a [1xN] vector as
% [Nx1] or vice-versa, which causes issues when concatenating w/ [NxK]
% data.
% Copyright (C) 2023 Trevor S. Smith
% Drexel University College of Medi... |
c7bbaf9c444cec9244f23ce00f7e3713617dfc9123fc094f89e417c6b44ceb16 | MATLAB | 1,465 | 40 | function ImageStats=ImageStatistics(TempImage, TempMask, PixelScaleFactor_um_px, IntensityBinSize, IntensityBinMax, ShowPlots)
clear ImageStats
if ShowPlots
figure,
subtightplot(1,2,1)
imagesc(TempImage),axis equal tight
subtightplot(1,2,2)
imshow(TempMask),
e... |
ce25b3efab5e4b57ccc8dd2de50107380559b1f361ebcf72413744dac2b2d1f8 | MATLAB | 1,465 | 62 | function [mu, Sigma, loglikCases, loglikAvg] = catFAinferLatent(model, discreteData, ctsData, varargin)
% Infer distribution over latent factors given observed data
%
% discreteData(n, j) in {1..data.nClass(j)}
% ctsData(n, k) in real
% Any location can be NaN, meaning missing value
%
%
% Output:
% mu(:,n)
% Sigma(:,:,... |
eb42bbc2c1e91d94306f0376495b3b2540b1f3cabcf157d3594395b63f47387e | MATLAB | 1,465 | 61 | function [tfDLT,rpe] = compute_rperr_table(t,pfld,fly2calibMap)
tfFly2Calib = exist('fly2calibMap','var')>0;
n = height(t);
tfDLT = true(n,1);
rpe = nan(n,5,2);
for i=1:n
if mod(i,50)==0
disp(i);
end
pLbl = t.(pfld)(i,:);
xyLbl = reshape(pLbl,[10 2]); %pLbl is all xs then all ys
uvLbl = cat(3,xyLbl(... |
ee2457b29633c980183d9569283990015352b66e406682bd6947f05bed9500e4 | MATLAB | 1,466 | 50 | classdef handle_light < handle
% Trick class to hide methods inherited from the handle class
% when calling methods(myclass).
%
% Source:
% http://stackoverflow.com/questions/6621850/is-it-possible-to-hide-the-methods-inherited-from-the-handle-class-in-matlab
% Posted by sclarke81 on StackOverflow on Oct. 24, 201... |
763b52da9f5209aa14fc88d763dfd8f5d339149fef1411638d77dadabe9549a5 | MATLAB | 1,467 | 37 | function [gx] = g_VBvolatile0(x,P,u,in)
% computes the probability of the learner choosing 'a=1'.
% [gx] = g_VBvolatile0(x,P,u,in)
% This function derives the action emission law from the current belief of
% the learner. It is valid in an empirical context akin to a multiarmed
% bandit problem, whereby the learner is a... |
80aed61f71737cbbca12b59bef47bea964dce99e714a31337e8a1077e974da30 | MATLAB | 1,467 | 57 | %% Determine if Newcomb's speed of light data is Gaussian
% Example from Gelman04 p77
%%
% This file is from pmtk3.googlecode.com
setSeed();
%% Data from http://www.stat.columbia.edu/~gelman/book/data/light.asc
D = [28 26 33 24 34 -44 27 16 40 -2 29 22 24 21 25 30 23 29 31 19 ...
24 20 36 32 36 28 25 21 28 29 3... |
be04ac46cb2efbe6dedf9408c1d70c44605133d2dcb275abb9ad41c3fae27dbb | MATLAB | 1,467 | 57 | function stage_registration()
loadParameters;
%Save the loadParameters into the output director in case we need to do
%later debugging
copyfile('loadParameters.m',fullfile(params.registeredImagesDir,...
sprintf('loadParameters.m.log-%s',date)))
% sub-stage 1: calculate descriptors
ret =... |
f54c5f7d6e624a47bed0b1d275a78aa46349a701c51ab83c668cef8e4d47169d | MATLAB | 1,468 | 60 | function [marker] = readmarkerfile(folder)
% Read the MarkerFile.mrk file in a CTF dataset.
%
% Use as
% marker = readmarkerfile(folder)
%
% Creates a marker structure which contains number_markers,
% number_samples, marker_names, and trial_times.
% Contributed by Tom Holroyd by email on 21 May 2005
name = fullfil... |
f718bcd76f46ed7e3915231bb701a20770ac1678bf5756a55b99ae4e9dff252e | MATLAB | 1,468 | 80 | function [T ind]= ifcellis(a,con,type)
% <*LAN)<]
% v.0.2
%
% IFCELLIS computedlogical operation (a==con) in a cell-array
% [T ind] = IFCELLIS(A,CON) CON puede ser numero o string
% if CON contain '@' eval de exprecion of the
% where '@' es de value of eac... |
ff6b470359ec0690634caa6d6bfad95ef4b8baf89c723f866d6eb4c7c9ebab3b | MATLAB | 1,468 | 66 | %% Imputation for a mixture of Gaussians
% PMTKneedsStatsToolbox regstats
%%
% This file is from pmtk3.googlecode.com
requireStatsToolbox
%% Make data
setSeed(1);
d = 10; n = 100; pcMissing = 0.5;
K = 5;
mu = rand(d,K); mixweight = normalize(rand(1,K));
Sigma = zeros(d,d,K);
for k=1:K
Sigma(:,:,k) = randpd(d);
end... |
33ed88374997d5191cf0daddff3c9a91448bf29ef5b2c310cf346a2b1eda94ce | MATLAB | 1,469 | 50 | function [spikeTimes,spikeTimes_conc] = rasterToTimes(spikenums,si,offset)
%% >>> OPERATION >>>
% Extract spike times from a logical spike raster (in which each row is a cell)
% >>> INPUTS >>>
% NAME TYPE, DEFAULT DESCRIPTION
% spikenums double spike raster matrix
% si ... |
e3c5635ea31cfc84afb29ef1b50f9daeb88eb5977c2a44afd2be4a14db7bbd1a | MATLAB | 1,469 | 60 | %
% Name: demo_PCA2.m
%
% Description: Demonstrates the performance of PCA by decomposing
% correlated multivariate Gaussian samples into
% their principal components
%
% When d == r, the PCA reconstruction is *exact*. Thus
% ... |
54244b329890b85b905e37c067438d2ddab57762c446f81a246c3ffecdb342a9 | MATLAB | 1,470 | 55 | function [ Mout ] = transformBrain( Min, t_struct, s_struct, r_struct, phi )
%TRANSFORMBRAIN Transform all vertices of a brain model.
%
% Translation, rotation and scaling is supported by setting the arguments
% appropriately - see transf3Dmatrix for the t_struct, s_struct,
% r_struct, phi arguments.
%
%
% C... |
bdff563e16a012c9238a846cd85e5182b02a54efe0aa03b0eab5a46e69aee767 | MATLAB | 1,470 | 60 | function com = center_of_mass(XYZ,Z)
% This function returns the center of mass of a cluster of voxels or mm coordinates
% defined as the nearest in-list coordinate to the average of the
% coordinate values weighted by the Z-score
%
% :Usage:
% ::
%
% com = center_of_mass(XYZ,Z)
%
% assigns a rank to each coordina... |
d472f7d13a92548866daa4109f951e75a86cd3edf5a11daa65b0c47653f063b5 | MATLAB | 1,470 | 55 | %% Bayes factors for simple linear regression
% We reproduce the example on p64 of Marin and Robert, 2007
% This computes logBF(i) = log p(D|X(:,:)) / p(D|X(:,-j)) for each feature j
% using a g-prior
%%
% This file is from pmtk3.googlecode.com
X = loadData('caterpillar');
% from http://www.ceremade.dauphine.fr/~xia... |
f1d227976dcb1dffa589047fe1fc15250e78d05e7bb2fbf045b21088b7ae7eac | MATLAB | 1,470 | 75 | function [CReg,count]=CleanClust(map)
% function will eliminate pixels that form excursions(attached only by 1
% side) or filaments (attached by two parallel sdes only)
[imax,jmax]=size(map);
list=zeros(imax*jmax,2);
count=0;
for i=1:imax
for j=1:jmax
if map(i,j)>0
crt=[0 0 0 0];
... |
35880e2b96ec254a8c3355fe9f69ce19dbc420107374ad6b63f030c20f763ad5 | MATLAB | 1,471 | 40 | function [removedTooShortDataVec] = removeSmallBadVecClusters(inputVector,minNumDataPoints)
transposeBack = false;
if(~isrow(inputVector))
inputVector = transpose(inputVector);
transposeBack = true;
end
diffVector = logical([1 abs(diff(inputVector))]);
numClusters = sum(diffVector)... |
9646a1a0cbcc8686a1fb67dfd4681b1bab26b859fbc814f520370069d06355eb | MATLAB | 1,471 | 66 | addpath(genpath('/groups/branson/home/bransonk/tracking/code/piotr_toolbox_V3.02'));
addpath /groups/branson/home/bransonk/behavioranalysis/code/Jdetect/Jdetect/misc;
addpath /groups/branson/home/bransonk/behavioranalysis/code/Jdetect/Jdetect/filehandling;
folder = 'janLegTracking';
file = 'Labels20160421.mat';
ld = ... |
c156ee233bbe310dcc4cb3b2af6d39490fafe3832b81bce0021b1da0dcfebbf9 | MATLAB | 1,471 | 81 | function data = measureSNR(DataDir, spike_file, data)
disp(spike_file.name)
self = crabsort(false);
self.path_name = DataDir;
self.file_name = strrep(spike_file.name,'.crabsort','');
self.loadFile;
if isempty(self.raw_data)
disp('no data')
return
end
% window size to average over the "noise"
N = round(.1/self.d... |
ebefa52a4fed41d9af1f7f79db7e04b9a86a982f9a3e7583afba5c9b0b0b270a | MATLAB | 1,471 | 57 | %-------------------------------------------------------------------------------
% Updright : SPACE Research Centre, RMIT
% Project : SPACE
% Author : Changyong HE
% Language : matlab
% CreateTime: 23 Nov 2017
% Function : This function is used to make density plot
%--------------------------------------... |
340753b63dfc067d6f6e4007f8378fddbead7051bc0eccda01cbf0fc074b4858 | MATLAB | 1,472 | 46 | function stat = twodecision (parameter)
if length(parameter) ~= 3
disp ('The parameter of the function should be a vector of length 3');
return;
end;
% parameters of the model
a = parameter(1); % connection between input and correct output
b = parameter(2); % connection between input and incorrect output
c = parame... |
b4b98fd4158d8ceda0975ff27cec8d0860d1ff7a1336d7691a17fad65f8f6dfb | MATLAB | 1,473 | 54 | % outfilenames = SaveFigLotsOfWays(hfig,basename)
function outfilenames = SaveFigLotsOfWays(hfig,basename,formats)
if exist('savefig1')
savefigfun = @savefig1;
elseif exist('savefig_pa')
savefigfun = @savefig_pa;
else
savefigfun = @savefig;
end
if nargin < 3,
formats = {'fig','png','pdf','svg'};
... |
de5466c5a49fe994ae2485de87809ddfa465300388fc42716182fdb851495e33 | MATLAB | 1,473 | 51 | %PDF2EPS Convert a pdf file to eps format using pdftops
%
% Examples:
% pdf2eps source dest
%
% This function converts a pdf file to eps format.
%
% This function requires that you have pdftops, from the Xpdf suite of
% functions, installed on your system. This can be downloaded from:
% http://www.foolabs.com/xpdf ... |
e3459bce27229234fb08a38b4b2a174a6374e5336d092e5d048de65c09262e88 | MATLAB | 1,473 | 71 | addpath('./functions')
load('../data/FIG4_spiral_240105_analyzed.mat')
figure;
hold on;
for i = 1:4
plot(i-1.6+out2(i,1:50)'/2,'color',[1 0 0 1],'linewidth',1.5)
plot(i-1.6+data2(i,1:50)'/(2*52.4278),'color',[0 0 0 0.7],'linewidth',1.5)
end
set(gca,'linewidth',2,'ytick',0:3)
ylabel('Class output')
x... |
e565de9261d56f68f2bca0c4179cd86d22e2e74c42f25c0e29afecfd1af80658 | MATLAB | 1,473 | 40 | function h_selectLine3
h_unSelectLine3; % h_selectCurrentPlot3 is also called inside FV_unSelectLine
% FV_selectCurrentPlot;
set(gco,'Selected','on','LineWidth',1.5,'MarkerSize',6);
t0 = clock;
currentAxes = gco;
UserData = get(currentAxes,'UserData');
if isfield(UserData,'timeLastClick') && etime(t0,Use... |
e83f736f4e8276a2449a02c044e5647c0779ab44a3f55942bf0416b04ecf4150 | MATLAB | 1,474 | 53 | classdef SavedFeaturesImporter < FeaturesImporter
properties
end
methods(Static)
function n = typeName()
n = 'Saved Features';
end
function c = canImportFromPath(featuresFilePath)
c = false;
if exist(fe... |
3d836bde959b15e913cc27929ca11b9b13b7efe09e691f43f1f29b26f8c60d51 | MATLAB | 1,476 | 56 | %% reparameterizeSdo
%
% Used to 'normalize' SDOs by the initial/prior probability distribution of state
%
%
%_______________________________________
% Copyright (C) 2024 Trevor S. Smith
% Drexel University College of Medicine
%
% This program is free software: you can redistribute it and/or modify
% it under the term... |
6c76ba9faa4854894debdda63a376bbe844d90a02ae24cef1a64db1f1916ad1f | MATLAB | 1,476 | 69 | %% Bernoulli Risk Function Demo
%
%%
% This file is from pmtk3.googlecode.com
Ns = [1 10 50];
for i=1:length(Ns)
n = Ns(i);
figure();
ps = 0:0.01:1;
R = ps.*(1-ps)/n;
plot(ps, R, 'b-o');
hold on
a = 1; b = a;
R = (n*ps.*(1-ps)) ./ ((a+b+n)^2) + ((n*ps + a)./(a+b+n) - ps).^2;
plot(ps, R, 'r:x... |
7079c8b1c8eb21286bb4a7f2b8c515952f1e20a490c24a9052dfe972fcf99be8 | MATLAB | 1,476 | 69 | function [v,xbest,sbest] = cross_entropy_method(score,generate,maximize,v,rho,varargin)
maxniters = 100;
d = 5;
N = 50;
epsilon = .00001;
iter0 = 1;
sbest = -inf;
for i = 1:2:length(varargin),
switch varargin{i},
case 'maxniters',
maxniters = varargin{i+1};
case 'niters no change',
d = varargin{i+1};
... |
a60b98ffd93ad1cca73abc26577c1b69dd7c1c4cc661f9223946cf61af785f59 | MATLAB | 1,476 | 49 | function gscatter3(x,y,z,group,clr,sym,siz,doleg,xnam,ynam,znam)
%GSCATTER3 3D Scatter plot with grouping variable
% gscatter3(x,y,z,group,clr,sym,siz,doleg,xnam,ynam,znam)
% Designed to work in the exactly same fashion as statistics toolbox's gscatter
% This function does not require the statistics toolbox i... |
e32376b0b32d94cea2675396b329acd7d0cb3e70412324ffe73e614e925d650f | MATLAB | 1,476 | 45 | function [RESU t0] = fMRI_waitScannerTriggers(scannerPort, b, triggerSwitches, RESU)
% 1. The first file is the code that should be put in our scripts BEFORE using the trigger counting function.
% 2. The second file is the function that is actually counting the triggers as well as recording the trigger signal.
% 3. ... |
0229e27ad7b60c2abf88ea77c84d9845e0732e057b47a4a64ba351581852c004 | MATLAB | 1,477 | 59 | function meg_topoplot(vals, layout, cmap, highlightChannels)
%
% function meg_topoplot(vals, [layout], [cmap], [highlightChannels])
%
% INPUTS
% vals is an Nx1 vector one value per channel, where N is number of channels
% layout is an ft layout (see ft_prepare_layout). will generate layout from
% custom file if not inc... |
6fcffc3046e6b7044667fb7407a7fa8c7c1e2d5b5e66b58debfbce61ba0f1ecc | MATLAB | 1,477 | 60 | function [T,W,P,C,Wstar]=plscode(X,Y,A)
% PLS
%
% INPUTS
% X: predictor data matrix
% Y: response data matrix
% A: number of PLS components
%
% OUTPUTS
% T: scores
% P: X loadings
% C: Y loadings
% W: weights
% Wstar: normalized weights
%
% Copyright (C) 2016 A. Folch-Fortuny and F. Arteaga
%
% This program is free ... |
bab804776b28bfc0f806e02d4c254a00631bea3d6576ec760ac94a8fb9cb6b59 | MATLAB | 1,477 | 59 | function [marker] = readmarkerfile(folder)
% Read the MarkerFile.mrk file in a CTF dataset.
%
% Use as
% marker = readmarkerfile(folder)
%
% Creates a marker structure which contains number_markers,
% number_samples, marker_names, and trial_times.
% Contributed by Tom Holroyd by email on 21 May 2005
name = fullfil... |
7175441a147d4c83f1d1404d25f19ef993c880e40ab3b8bc5be562fa90e60d36 | MATLAB | 1,478 | 42 | function [d,f]=d2statio(sig);
%D2STATIO Distance to stationarity
% [D,F]=D2STATIO(SIG) evaluates the distance of the signal
% to stationarity, using the pseudo Wigner-Ville distribution.
%
% SIG : signal to be analyzed (real or complex).
% D : vector giving the distance to stationarity for each frequency.
% F : vec... |
a27a73f93a8fd456e9ea67895a6aa7fb698376b685b68cdce5d9ff49ddfb054e | MATLAB | 1,478 | 61 |
eval(['Ip = Ip_' num2str(kk) ';']);
eval(['In = In_' num2str(kk) ';']);
xr = xr_list(kk);
yr = yr_list(kk);
fprintf(1,'Processing image %d...',kk);
if ~recompute_corner,
[x,X,n_sq_x,n_sq_y,ind_orig,ind_x,ind_y] = extract_grid(Ip,wintx,winty,fc_save,cc_save,kc_save,dX,dY,xr,yr,1);
xp... |
df7067082a3fd6c00ee6d86eed6a4729c51e8ebe3676b96ac95ddf8f0c0c7bfa | MATLAB | 1,478 | 52 |
%% Fit a mixture of Gaussians using variational Bayes
% Reproduce Bishop fig 10.6
% Based on code by Emtiyaz Khan.
% This file is from pmtk3.googlecode.com
function mixGaussVbDemoFaithful
%% Load Data
setSeed(0);
X = loadData('faithful'); % 272x2
X = standardizeCols(X);
%% Run mixGaussBayesFit
K = 6;
[model, loglikH... |
eda2a5d05b1aea18f6ac31dbed74d06495d26df1d89e15844168ffc92ab9ef45 | MATLAB | 1,478 | 44 | function [B,inds] = spBlkDiag( A, inds )
% Creates a sparse block diagonal matrix from a 3D array.
%
% Given an [mxnxk] matrix A, construct a sparse block diagonal matrix B of
% dims [m*k x n*k], containing k blocks of size mxn each, where each block
% i is taken from A(:,:,i).
%
% When computing B, a time consuming st... |
86360bf4cb0943f837571e65f2c5f5510ea7a10471e180e712d9bbf2c8ae9b42 | MATLAB | 1,479 | 45 | % comb_par
load(fullfile(saveLoc, ['spk_S' num2str(1)]), 'par')
% Create shorter time vector
tsl_s = [-0.2 1]; tpts = find(par.tsl >= tsl_s(1) & par.tsl <= tsl_s(2));
trl_s = -1 * flip(tsl_s); tpts_r = find(par.trl >= trl_s(1) & par.trl <= trl_s(2));
tsl = par.tsl(tpts);
trl = par.trl(tpts_r);
global par_ses... |
895a5c1adb5d79cb12d14a9beef0c6bdd19771fc67d447bee779f6de7f0408af | MATLAB | 1,479 | 58 | function [sx] = VBA_softmax (x, logTemperature, dim)
% // VBA toolbox //////////////////////////////////////////////////////////
%
% [sx] = VBA_softmax (x, logTemperature, dim)
% softmax function (generalized logistic mapping)
%
% IN:
% - x: array of values to transform
% - logTemperature: optional parameter (defau... |
b63c217940d2a5504986e8dd2d91fcac74f960fa0796ed968a7b81ddab3568d7 | MATLAB | 1,479 | 59 | %% Plot the sampling distribution of mean shrinkage estimators
% Based on fig 5.6b of Hoff09 but applied to different data
%%
% This file is from pmtk3.googlecode.com
k0s = [0 1 2 3];
xrange = -1:0.05:2.5;
n = 5;
thetaTrue = 1;
sigmaTrue = 1;
thetaPrior = 0; %thetaTrue;
figure(); hold on;
[styles, colors, symbols] =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.