text stringlengths 8 6.12M |
|---|
function range = bootstrap_mean_small(data,varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Setup variables and parse command line
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
i_p = inputParser;
i_p.addRequired('data',@isnumeric);
i_p.add... |
function [starttime, endtime,index_start, index_end] = get_trial_TTL(TTL,ts,threshold)
index = [];
TTL_threshold = ((max(TTL)-min(TTL))/threshold);
trial_times = [];
TTL_shift = [TTL(1) [TTL(1:(length(TTL)-1))]];
diff = TTL-TTL_shift;
starttime = ts(diff > TTL_threshold)';
endtime = ts(diff < -TTL_threshold)';
index_... |
% Author: Guosheng Lin (guosheng.lin@gmail.com)
% perform segmentation prediction on user provided images.
% specify the location of your images, e.g., using the following
% folder which contains serveral example images:
% ds_config.img_data_dir='../datasets/custom_data';
function demo_refinenet_test_example_egoha... |
for p = 4:40
isgood = 1;
for a = 2:p/2+1
b = p-a;
if isprime(b) && isprime(a)
isgood = 0;
break;
end
end
if isgood
disp(p);
end
end |
function ce30_Raw2CartPolar(obj)
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% @Func ce30_Raw2CartPolar;
% @Brief 将全部原始数据转化为需要的类型;
% @Param NONE
% @Retval 修改属性的值;
% @Date 2019/11/21;
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
%% 函数主体
indexCartMatrix = 1;
indexCartPo... |
% this is used in app designer
function myTimerFcn(app,~,~)
cd('C:\Users\Stage-2\Desktop\HandEyeApp\Variables\hand-eye');
if exist ("posesRobot.csv")
imageDir = fullfile('C:\Users\Stage-2\Desktop\HandEyeApp\Images\realRobotImages');
i... |
%% 5.5a
%Parameters
K = 0.16;
T = 75;
omega0 = pi/4; %0.7823;
lambda = 0.07;
sigma = 0.0281;
Kw = 2*lambda*omega0*sigma
% Sampling
fs = 10;
Ts = 1/fs;
% The system
A = [0, 1, 0, 0, 0;
-omega0^2, -2*lambda*omega0, 0, 0, 0
0, 0, 0, 1, 0
0, 0, 0, -1/T, -K/T
0, 0, 0, 0, 0];
B = [0;
0;
0;
K/T... |
function [E,P]=MT_VCA_initialize(X,labels,parameters)
% Inputs:
% X - Inputdata, reshaped hyperspectral image treats each pixel as column vector, d by N
% parameters - struct - parameter structure which can be set using the EF_parameters() function
% labels - binary the same size as input data, indicates po... |
function E = minGlucReg(model, m, d)
r = model.result;
AUC = trapz(r.time, r.vcurr(:, m.v.Ra_g));
E = AUC - m.c.Gtot; |
function CXX= CX(Alpha,el)
% Body-axis X Force
a=[-.099 -.081 -.081 -.063 -.025 .044 .097 .113 .145 .167 .174 .166
-.048 -.038 -.040 -.021 .016 .083 .127 .137 .162 .177 .179 .167
-.022 -.020 -.021 -.004 .032 .094 .128 .130 .154 .161 .155 .138
-.040 -.038 -.039 -.025 .006 .062 .087 .085 .100 .110 .104 .091
-.083 -... |
% function isdetected = detectEd(filename,RotatedDir,EdemaDir)
%
% hema_file_name = [hemaDir, filename];
% edema_file_name = [EdemaDir, filename];
img = imread('18.png');
% img = imread([RotatedDir, filename]);
% img = rgb2gray(imread('14.jpg'));
% img = rgb2gray(imread('13.png'));
% img = imrotate(img,-2.5);
... |
% clean
clear all;
%clc;
% load
load('/Volumes/TOSHIBA/Seņales suizos tercero, cuarto, quinto y sexto escenario/Datos/Datos_raw/test_train_raw_s_resh.mat');
%definimos las layers
layers = [ ...
%input
sequenceInputLayer(1)
%hidden
bilstmLayer(100,'OutputMode','last')
% Output
... |
function varargout = request(action,varargin)
% request [Not a public function] Persistent repository for container class.
%
% Backend IRIS function.
% No help provided.
% -IRIS Macroeconomic Modeling Toolbox.
% -Copyright (c) 2007-2017 IRIS Solutions Team.
mlock( );
persistent X;
if isempty(X)
% @... |
function str = get_arch_id ()
% str = GET_ARCH_ID ()
%
% Retrieves OpenCV arch identifier for Windows platforms (i.e., x86 for
% win32 and x64 for win64). For other platforms, an empty string is
% returned.
%
% This function is primarily aimed for determining OpenCV library or
% binary... |
clc;clear all; close all;
t=-5:0.005:5;
u1=0.5*(sign(t-1)+1);
u2=0.5*(sign(2*t+1)+1);
ims=0.5*(sign(t-2.5)+1)-0.5*(sign(t-2.5-0.005)+1);
tt=0:5;
rpm=0.5*(sign(tt-3)+1);
subplot(4,1,1);
plot(t,u1);
axis([-5 5 0 1.5]);
title('UNIT STEP SIGNAL');
subplot(4,1,2);
plot(t,u2);
axis([-5 5 0 1.5]);
title('UNIT STEP FUNCTION')... |
clear all
Exps=[1:3 5:53];
for e=1:length(Exps),
ExpNum=Exps(e);
frun=['runs/Exp' num2str(ExpNum) '.mat'];
load (frun);
load dat/Robin_Sensitive_study.mat
%% estimate & temperature profiles
iUse=1:N>N/5; %burn in
rhohat=median(rhoc(iUse));%use the median to estimate the true values
... |
function [callpricef,sigmaf]=mybeta4(beta0,beta1,beta2,lath,T,K)
%beta0=m_input(1);
%beta1=m_input(2);
%beta2=m_input(3);
%lath=m_input(4);
%T=m_input(5);
%K=m_input(6);
sigma0=0.19319;
%K=(2.15:0.05:2.9);
%[~,col]=size(K);
%T=78;
%K=2.07;
sigmasqrt0=sigma0^2;
r=0.043;
S0=2.301;
St=zeros(100000,T);
sigm... |
R1 = 5;
A1 = 2;
R2 = 5;
hmax = 15;
PriorityTank = 1;
|
function norm_theta = normalize_angle(theta)
%Put angle theta in [-pi, pi]
norm_theta = theta;
while norm_theta < -pi
norm_theta = norm_theta + 2 * pi;
end
while norm_theta > pi
norm_theta = norm_theta - 2 * pi;
end
end |
% Setup data structures for read / write on the daq board
s = daq.createSession('ni');
% Add output channels
s.addAnalogOutputChannel('Dev1', 0, 'Voltage');
s.addDigitalChannel('Dev1', ['port0/line4'], 'OutputOnly');
s.addDigitalChannel('Dev1', ['port0/line8'], 'OutputOnly');
SAMPLING_RATE = 1000;
s.Rate = SAMPLIN... |
function [] = betweenness()
% 本脚本可用于将CCpeak等网络拓扑结构矩阵转换成对称形式,并计算可通过计算其中的betweeness来获得Hub Neuron
% Identify hub neurons in the network
% CCPEAK is extracted by mutual information method
network_matrix = (CCpeak + CCpeak');
for i = 1:64
for j = 1:64
if network_matrix(i,j) < 0.1
network_ma... |
%%Arctic multilayer cloud detection algorithm
%Written by Maiken Vassel, latest update 2019
%This is the main program of the classification algorithm. Here the dataset is analysed for
%seeding/non-seeding multilayer clouds from day to day.
%The general structure is that one day (i) is evaluated and the resulting info... |
%evaluate and tune Bayesian-SARSAQ with the features identified by linear
%regression
clear,close all,clc
addpath('../MatlabTools/') %change to your directory for MatlabTools
addpath('../metaMDP/')
addpath('../Supervised/')
addpath('../')
load ../../results/lightbulb_fit.mat
S = lightbulb_problem(1).mdp.states;
nr... |
fc_tools.utils.cleaning()
N=10;
options={'perm',@(A) colamd(A)};
[bvp,info]=fc_vfemp1.examples.setBVPfunny2D01(N,2);
fc_vfemp1.examples.print_info(info)
fprintf('*** Solving %s\n',info.name)
[U,SolveInfo]=bvp.solve('split',true,'time',true,options{:});
fprintf(' -> ndof (number of degrees of freedom) = %d\n',sum(ce... |
%DAM_HIST Histogram of dam fly activity
% [avg,sem]=dam_hist(o,wells,p)
%
% SDL 23-JUN-02 : abstracted core functionality to HIST.M
%
function [avg,sem]=dam_hist(o,wells,p)
if nargin < 2 | isempty(wells)
wells=1:size(o.data,2);
end
if nargin<3
p=dam_hist_par;
end
if isempty(p.title)
if length(wells)>1
titl... |
%% ------------------------------------------------------------------------%
% EE 569 Homework #3
% Date: Nov. 1, 2015
% Name: Faiyadh Shahid
% ID: 4054-4699-70
% Email: fshahid@usc.edu
%------------------------------------------------------------------------%
function type = mvbq(CMY_vector)
% This code is inspired f... |
% Written by Patrick Strassmann
function [probeCategVect, rewardCategVect, probeStmCategVect, rewardStmCategVect] = findPrecededTrialCateg(startTime, endTime, eventStartTimes_probe, eventStartTimes_rwd, eventStartTimes_probeStm, eventStartTimes_rwdStm)
if nargin<5
eventStartTimes_rwdStm = [];
eventStartT... |
function plot_lines_noise
load('t_scale_noise.mat');
marker= { '^', 'v', 'square', 'o', 'x', 'x', 'none', '+','none', '<','v','v','^'};
color= {'r','g','b','y','m','c','g','k','r','g','b','b','g'};
markerfacecolor= color;%{'r','g','n','m','n','n','r','r','g'};
linestyle= {'-','-','-','-','-','-','--','-','--',':','-',... |
function [aV] = vol_invert(aV_input, varargin)
%
% NAME
%
% function [aV] = vol_invert(aV_input [, aV_maskVol])
%
%
% ARGUMENTS
% INPUTS
% aV_input volume data space to "invert"
% aV_maskVol volume (optional) if specified, use non-zero
% entries as mask for inversion
%
% OUTPUTS
% aV vo... |
% File tema2.M
% Function: tema2
% Call: tema2(wt,M)
% Se aleg parametri de intrare wt1 si M. wt1 trebuie sa fie un numar
% subunitar in scopul aplearii functiei fir1. De asemenea,
% construirea vectorului de tip fereastra trebuie facuta pe un
% suport de lungime ... |
function opts = parse_varargin(defaults, optargs)
% Parses varargin, sets defaults, and replaces defaults with user-supplied
% values when appropriate. Returns the optional arguments as a structure.
%
% Required Inputs
% ===============
% defaults A structure corresponding to the default arguments. For
% ... |
function start_listening
% MATLEAP.START_LISTENING Start listening for frames from Leap motion controller (needed for matleap.frames)
matleap.matleap(3);
|
function [image] = loadGrayImage(filename)
% LOADGRAYIMAGE Loads an image, and, if RGB, makes it greyscale.
image = imread(filename);
if size(image, 3) == 3,
image = rgb2gray(image);
end
end
|
classdef kcsd2d < handle
%-------------------------------------------------------------------------
properties
X % X - component of the estimation area
% (meshgrid logic)
Y % Y - component of the estimation area
% (meshg... |
function [path, cost]= postProcess(path, map)
%returns postProcessed path and its cost
n = size(path);
head = 1;
final_ids = head;
for i = 1:n(1)-1
validBranch = checkBranchValid(path(head, :),path(i+1, :), map, 20*i, true);
if ~validBranch
body = i;
... |
%% MLBREADIV reads the baseball statistics from mlb07al.dat
%
% Demonstrates using the FGETL function to import character data from the
% 'mlb07al.dat' file. In this example, the FGETL function reads a line of
% text from the file and discards the newline character. The WHILE-loop
% continues executing until it encoun... |
%% defend.m
% determines where to move king to avoid check
% check to see if king will move into check
% takes argument of moves struct and moves.board matrix
% returns [0,0] if no check
% returns [-1,-1] if checkmate
function position = defend(moves)
%get position of king
[r,c] = find(moves.king1 =... |
function [ estimatedLabels ] = classifyWithTemplateMatching( templates , testData , method, errorMeasure,emotions)
%CLASSIFYWITHTEMPLATEMATCHING Given a set of templates and a test dataset,
%this function estimates the labels of each sample in the test dataset
%comparing it with each of the templates.
%Convert... |
%% fn_savefile
%% Syntax
% filename = fn_savefile(varargin)
%% Description
% synonyme de "filename = fn_getfile('SAVE',varargin)"
%
% See also fn_getfile
%% Source
% Thomas Deneux
%
% Copyright 2003-2012
%
|
function spc_drawAll
%Fig2 = lifetime in ROI.
%set(gui.spc.figure.projectImage, 'CData', spc.project);
spc_drawLifetimeMap;
spc_drawLifetime; |
%% MULTIFRAME MOTION COUPLING FOR VIDEO SUPER RESOLUTION
%
%
% Be sure to initialize the submodules and to compile them,
% following their instructions
clearvars;
%% Data properties
datasetName = 'surfer';
startFrame = 1;
numFrames = 5;
cslice = ceil(numFrames/2);
factor = 4; % Magnification facto... |
function boxes = detect(input, model, thresh)
% Keep track of detected boxes and features
BOXCACHESIZE = 100000;
cnt = 0;
boxes.s = 0;
boxes.c = 0;
boxes.xy = 0;
boxes.level = 0;
boxes(BOXCACHESIZE) = boxes;
% Compute the feature pyramid and prepare filters
pyra = featpyramid(input,model);
[components,filters,resp... |
% clc, clear
format LONGG
%%Ch 3 Formulas
PV = @(FV, i, n) FV./((1+i./100).^n);
%Calculates the Present Value from a Future Value
FV = @(PV, i, n) PV.*((1+i./100).^n);
%Calculates the Future Value from a present value
EIR = @(r, m) (((1 + r./(100*m)).^m) - 1).*100;
%EIR is calculating effective interest... |
cd \\sonas-hs.cshl.edu\churchland\data\fni17\imaging\151028
%%
a = dir('*_MCM.TIF');
aa = {a.name};
showcell(aa')
%%
for i=1:length(aa)
o = aa{i};
n = [aa{i}(1:end-4),'_eachSess.TIF'];
movefile(o, n)
% pause
end |
function [auth, sigmat, sigind] = GenSig(share1,share2)
crap = size(share1);
crap(1) = crap(1)/2;
crap(2) = crap(2)/2;
auth = zeros(crap(1),crap(2));
fileID = fopen('gensig.txt','w');
bleh = crap(1)*crap(2);
sigmat = zeros(1,bleh);
k=1;
for i=1:crap(1)
for j=1:crap(2)
auth(i,j)=bitxor(s... |
% Fish eats tank
function [thisFish, tank] = cannibalism(thisFish, tank)
% Maximum size of target fish
sizeLimit = thisFish.size * thisFish.cannibalismSizeCoefficient;
% Filter with fish of specific size
targetCounter = 0;
[~, n] = size(tank.fish);
targetList = ones(n) * -1;
for i = 1:n
... |
%% PSET4
% CPNS 34231
% The file mtNeuron.mat contains the responses of a single directionally tuned
% MT neuron to random dot stimuli moving coherently in directions varying from
% -90 to 90 degrees relative to the previously measured preferred direction of
% the neuron. The thirteen stimuli were each presented 184 ... |
clear
path_data = '/home/pbellec/database/stability_surf/';
%in.part = [path_data 'basc_cambridge_sc10.nii.gz'];
in.part = [path_data 'preproc' filesep 'trt' filesep 'part_sc100_resampled.nii.gz'];
opt.sampling.type = 'window';
opt.sampling.opt.length = 30;
% Scale 10
list_subject = {'sub90179','sub94293'};
pipe = s... |
load([project.paths.processedData '/original_fake_convergence.mat']);
gmm = load([project.paths.processedData '/GMM_scores.mat']);
load([project.paths.processedData '/processed_data_word_level.mat']);
% project.paths.figures = 'C:/Users/SMukherjee/Desktop/data/figures/convergence';
%% merge into only event distribut... |
function nop(varargin)
%NOP %NOP Do nothing
%
% NOP( ... )
%
% A do-nothing function for use as a placeholder when working with callbacks
% or function handles.
% Intentionally does nothing
end
|
function [M_sort_r,numParticles] = fluor_sizing(M_sort_cut,pixeldistance,~,ROIsize,check)
global FolderName FileNameImage ImageNumber
%Measures the radius of fluorescent particles
%Nested function: myfun5
clc;
close all;
% Allocate, initialize M_sort_r
M_sort_r = M_sort_cut;
% Generate 2D arrays to represent reg... |
% snesim_set_resim_data : Select and set a region to resimulate.
%
% Call
% S=snesim_set_resim_data(S,D,lim,pos)
%
% S : SNESIM of VISIM structure
% D : completete conditional data set (e.g. S.D(:,:,1));
% lim : lim(1) : horizontal radius (in meter)
% lim(2) : vertical radius (in meter)
%
% resi... |
clear all;
load( 'NonRepeatStim');
load('NonRepeatstimtimes');
load('SpTimes');
addpath('preProcessTools');
defineGlobalParameters();
load('globalParams');
% Build general data for training(Spike train, stimulus, stimulus design
% matrix)
[spikes, stimulus, stimulusDesignMatrix, postSpikeBaseVectors, spikeHisto... |
% compare localization
clear all
close all
clc
load('RushilGabriel_filtered_50_90.mat');
Fs = 6500;
SensorLocations = [0,0;0,3;5,0;3.5,0];
options = optimoptions('fsolve','Algorithm','levenberg-marquardt','Display','none');
sensorID = 1;
sensorNum = 4;
for personID = [1,3]
personID
for traceID = 1:10
... |
stat = 'pixelStats';
stimfname = 'allStimuli123_6.mat'; % if not on path, it's in equneq/
load(stimfname,'sizes','sTr','dTr'); % some trials and parameters
ratios = sizes(:,1)./sizes(:,2);
psyAxis = log2(ratios);
nTicks = numel(psyAxis);
conds = {'6vs6', '12vs12', '6vs12', '12vs6'};
nConds = numel(conds);
figure();
... |
function figure2_massGap
tic;
%
minBHmass = 2.5;
maxBHmass = 300;
lowTotalMassStevenson = 80;
lowGap = 43;
uppGap = 124;
massRatioLimit = 0.9;
% Loading LIGO posteriors
% GW170729
GW170729_90 = importdata('../data/GW170729_mirroredM1M2_90percent_contour.dat');
GW170729_90_m1 = GW170729_90(:,1);
GW170729_90_m2 = GW170... |
clear all
%[Y,Fs] = audioread('test.wav');
%Y = wavread('test.wav');
n = [1:100];
f= 80;
Fs = 8000;
Ns = Fs/f;
N = 1:100;
Y1 = 2048+ 2048* sin(2*pi*N/Ns-pi/4);
Y2 = 2048+ 2048* .1*sin(2*pi*N/Ns-pi/4);
Y3 = 2048+ 2048* .3*sin(2*pi*N/Ns-pi/4);
%Y = int16(Y1);
Y= [Y1 Y1 Y1];
Y = int16(Y);
%Y = 2047+ Y*2047;
[re,en1]... |
%% Stelling 21
%
% Een element-wise logische operator bestaat altijd
% uit 2 symbolen:
%
% || en de operator &&
%
Antwoord = 0;
|
clear all
load('test_13-Feb-2020_2500_0.6.mat')
beta1 = [0.5 + 0.5; 0; 1; -1];
rho1 = 0.6;
rho2 = rho1;
disp('The mean estimates are')
disp(mean(b2(:, [1, 2, 3, 4, end-2, end-1]) - [beta1', rho1, rho2]))
disp(mean(SE1(:, [1, 2, 3, 4, end-1, end])))
disp(mean(SE2(:, [1, 2, 3, 4, end-1, end])))
disp('The standard error... |
%% Opdracht 7
% Maak een functie aan met de naam 'opdracht_7'.
% Deze functie heeft 1 input: genaamd 'vector'.
% Deze functie heeft 2 outputs: respectievelijk het aantal elementen van
% de input en de waarde van het laatste element van de input.
function [totaalElementen, laatsteWaarde] = opdracht_7(vector)
totaalEl... |
function win=biorwin(wins,dM,dN);
% biorbin : Find Biorthogonal analysis Window for STFT
% ***************************************************************@
% Inputs:
% wins, synthesis window;
% dM, sampling step in Time;
% dN, sampling step in Frequency;
% Output:
% win, analysis window;
% Us... |
function Ko = jacfun(theta,varargin)
% K=jacfun(theta,varargin)
[wn,gasvec,cros,refe,invgas,sol,wn_shift,noise,L,geo,err,offset,ncut] = extract_varargin(varargin);
ninvgas = length(invgas);
[p1,p2,p3,offset] = fetch_params(theta,invgas,offset);
% scale densities:
dens = geo.layer_dens;
for n = 1:ninvgas
dens.(c... |
function solution = AV_gu(n,xi,beta,k)
A = S2C_matrix(n,xi);
% A = [0,0.2,0.8;0.4,0,0.6;0,1,0];
p= sdpvar(n,1) ;
delta= sdpvar(n,1);
y = sdpvar(n,n,'full');
r = sdpvar(n,n,'full');
x = sdpvar(n,1);
z = sdpvar(n,1);
d = sdpvar(n,1);
constraints=[d==min(x+z,(1-p)),...
x'==beta*((min(x,1-p))'*A+ones(1,n)*y)+delta'... |
function [ output_args ] = visualizeTrajectory( trial, left, sampling)
if nargin == 2
sampling = 1;
end
data = trial{left};
color = (data(:,9)+pi)/(2*pi);
[n p] = size(color);
subset = sort(randsample((1:1:n),round(sampling*n)));
gray = subset'/n;
output_args = plot3(data(subs... |
%チェッカーボード周囲のLIDAR取得点群の空間分解能計算
Filename = 'data\evaluation\LIDAR\2021-08-03-21-02-32_Velodyne-HDL-32-Data_thesiscand.pcap';
velodyne = velodyneFileReader(Filename,'HDL32E');
checkerRanges = [-0.55, -0.4;
0.6, 0.8;
-0.1, 0.1];%チェッカーボード板のある範囲を指定する
totalptcnt = 0;
for i = 1:velody... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Bounded Data Uncertainty Filter (BDU) %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% * Description:... |
function ptest(results)
numbm = size(results,1);
for i = 1:numbm
bmname = results{i,1};
bmerror = results{i,3};
pcnterr = results{i,5};
power = results{i,9};
pactual = results{i,12};
thalf = 5*(1:size(power));
t = 5*(1:size(pactual));
maxtime = max... |
function [] = mesh(ref_area, subspace)
% import global parameters needed for domain construction
global vertices;
global Ndof;
global boundaries;
global inputs;
Domain.InputVertex = vertices;
% ---------------------------------------------
% Definizione del dominio a part... |
function val = g(x)
% val = 1./(1+exp(-x));
val = heaviside(x);
end
|
function [ leftMat, rightVec, paramsUsage ] = loadEnsemble( currentResidue, conNames, header )
self = 20;
pair = 400;
files1 = dir(sprintf('*_%s.pdb', currentResidue));
files2 = dir(sprintf('*_%s_*.pdb', currentResidue));
files = {files1.name, files2.name};
%% lay out the residues coverred by a pdb file
residueLists... |
function [trial_list] = randomized_trials_lds(not_outlier_IDs,outlier_IDs,nOutliers,nTests,rep_limit)
outlier_list = [];
nOutlierTypes = length(outlier_IDs);
if nOutliers >0
for i1=1:ceil(nOutliers/nOutlierTypes)
outlier_list((i1-1)*nOutlierTypes+1:i1*nOutlierTypes)=outlier_IDs;
end
outlier_list = ... |
function C = contract(tensors, indices, kwargs)
% Compute a tensor network contraction.
%
% Usage
% -----
% :code:`C = contract(t1, idx1, t2, idx2, ...)`
%
% :code:`C = contract(..., 'Conj', conjlist)`
%
% :code:`C = contract(..., 'Rank', r)`
%
% Repeating Arguments
% -------------------
% tensors : :class:`Tensor`
% ... |
function y = grdf_smrt(a,H,x)
y = H*x + a;
end |
%% Assignment 4
close all;
clear all;
tic
% initialization
nbrActions = 4;
map = 1 ;
% gives random start position
gwinit(map);
state = gwstate;
gamma = 0.9;
alpha = 1;
% epsilon=0.9;
% Look-up table
Q = rand(state.xsize, state.ysize, nbrActions);
%edges
Q(1,:,2)=-inf;
Q(state.xsize,:,1)=-inf;
Q(:,1,4)=-inf;
Q(:,stat... |
function bdytde=btide(recllh,cdate)
%
% Function btide
% ==============
%
% Computes the radial, s->n and w->e displacements due to boody tides
% for given time and position.
%
% Sintax
% ======
%
% bdytde=btide(recllh,cdate)
%
% Input
% =====
%
% recllh -> receiver geodetic coor... |
function [ret] = pglobals_set(name, value)
%% pglobals_set
%
% File: pglobals_set.m
% Directory: 2_demonstrations/lib/matlab
% Author: Peter Polcz (ppolcz@gmail.com)
%
% Created on 2018. June 09.
%
%%
persistent Old_Values
eval(['global ' name ' ; ']);
if nargin > 1
% Store old variables
if ~i... |
addpath(genpath('./activeBrain'));
addpath(genpath('./alignmentTool'));
addpath('/Applications/freesurfer/matlab/');
%% Load files
clc;
clearvars;
%% Settings
pathToFsInstallDirectory='/Applications';
%%
disp('Specify Subject Output Directory (input data will be copied to this folder)');
workspace_path=uigetdir('... |
function [ u ] = deconvolution_FA( f, nit, tau, lambda, epsilon, sigma )
%DECONVOLUTION_FA Calcul de la deconvolution par fonctionnelle approchee.
% Notre algorithme se base sur une descente de gradient
% Inputs :
% f : l'image bruitee
% nit : nombre d'iterations
% tau : pas de temps
% lambda
% epsilon : parametre emp... |
% Copyright (c) 2009, Kyle Scott
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are
% met:
%
% * Redistributions of source code must retain the above copyright
% notice, this list of condit... |
function [A] = denavit_hartenberg(r, a, d, teta)
A = zeros(4, 4);
A = [cos(teta) -sin(teta)*cos(a) sin(teta)*sin(a) r*cos(teta);
sin(teta) cos(teta)*cos(a) -cos(teta)*sin(a) r*sin(teta);
0 sin(a) cos(a) d;
0 0 0 1];
end |
x = -0.9: 0.1: 1;
% Plotting for Task 1
plot(x, log(1+x), 'r', 'LineWidth', 3);
hold on;
title('Graph for ln(1+x)');
xlabel('values of x');
ylabel('values of ln(1+x)');
grid;
% Plotting for Task 2
plot(x, naturalLog(x, 1), 'b--', 'LineWidth', 3);
hold on;
plot(x, naturalLog(x, 3), 'c:', 'LineWidth', 3);
... |
function [fn]=mapwindow()
[filename, pathname]=uigetfile('*.*','Select a image');
if isequal(filename,0) || isequal(pathname,0)
fn=0;
else
fn = fullfile(pathname, filename);
end
|
function [S_out,S_in,MSE]= Th_LMMSE_Simu_Sort_De(K,N,H,snRdB,snrNo,modType,Q_StepSize,B_Bit1,B_Bit2,B_Bit3,S1,S2,S3)
Q(1,:) = [2.638, 1.925, 1.519, 1.277, 1.131, 1.043, 0.990]; % optimal step size of 1-bit
Q(2,:) = [0.992, 0.874, 0.801, 0.759, 0.735, 0.721, 0.713]; % optimal step size of 2-bit
Q(3,:) = [0... |
function [V1,V2,Phase,RatioPfMd]=Vaccination_over_Time_without_Kids(UpTake, Date)
Separation=11*7;
Delay=14;
Inf_to_Symp=5;
load Surrogate_Vacc_Data.mat
load Regional_PP.mat
% Remove the later data and use approximation instead
Vacc1(:,Date:end,:)=[];
Vacc2(:,Date:end,:)=[];
a80=[17:21]; p80=Region_PP(1:11,a80)/sum... |
%function [I, phan] = loadCTPhantomFromTiff( dataPath, dataName, geom )
dataPath = '\data\prostate-patient-ct-fiducial\';
dataName = 'prostateScans';
noSlices = 149;
info = dicominfo([ dataPath 'reference'] );
dx = info.PixelSpacing(1);
dy = info.PixelSpacing(2);
dz = info.SliceThickness;
nx = info.Rows;
ny = in... |
function [model, gap_vec_heuristic, num_passes, progress] = solver_multiLambda_BCFW_hybrid( param, options )
% [model, gap_vec_heuristic, num_passes, progress] = solver_multiLambda_BCFW_hybrid( param, options )
%
% solver_multiLambda_BCFW_hybrid solves the SSVM problem for multiple values of regularization parameter... |
function feature_output = voxel_Volume(varargin)
global image_global;
global image_property;
global mask_for_TA;
global tumor_volume_CGITA;
% global image_global_ni;
% global mask_ni;
%image_property.pixel_spacing = img_obj.pixel_spacing;
if exist('image_global')==1
temp1 = image_global(:);
nonz... |
%------------- BEGIN CODE --------------
% ekran ve bellek on temizleme
close all ; clear all ; clc ;
xa = 1;
%xu = 3;
xu = 7;
tol = 0.0001;
xo = (xa + xu) / 2;
%fxo = (xo^2)-5;
%fxa = (xa^2)-5;
fxo = xo^3 + xo^2 - 12 * xo;
fxa = xa^3 + xa^2 - 12 * xa;
iter = 0;
while (abs(fxo) > tol)
if... |
% extract directions from interest vectors
nmember = size(m,1);
direction = m;
for i = 1 : nmember
direction(i,:) = m(i,:) / norm(m(i,:));
end
% build the graph
graph = zeros(nmember);
for i = 1 : nmember
for j = 1 : nmember
dif = direction(i,:) - direction(j,:);
graph(i,j) = sum(abs(dif));
... |
%% go to the directory in tier 2
cd('V:\users\Aaron\150814_BMWR17')
load 'Run1ShiftsCorr1'
%% display the correlation of one of the shifts
Shifts = cell2mat( FirstMap(:,1));
Corr = cell2mat( FirstMap(:,2));
X = Shifts(:,1);
Y = Shifts(:,2);
Z = Shifts(:,3 );
close all
figure
scatter3(X,Y,Z,40,Corr,'filled')
colormap hs... |
function [ desired_state ] = trajectory_generator(t, qn, W_in, t_in)
% TRAJECTORY_GENERATOR: Turn a Dijkstra or A* path into a trajectory
%
% NOTE: This function would be called with variable number of input
% arguments. In init_script, it will be called with arguments
% trajectory_generator([], [], map, path) and late... |
%load data.mat
%copy this:
%stats=runCrawford(patientScores,controlMean,controlSd,nC,1);
function stats=runCrawford(patientScores,controlMean,controlSd,nC, ...
plotFig,allControls)
% structure of input
mC=controlMean;%mean
sC=controlSd;%STD
nCond=length(mC);%each column is a variable
[c,d]=size(patie... |
function a_init = genInitActions(policy, J, type, actionTitles, varargin)
%genInitActions generate distributions for actions in initial rollouts.
%
% 1=gaussian, 2=Uniform, 3=Random Walk (Brownian), 4=sinusoid
%% Code
a_init = cell(1,J);
% Normally distributed initial rollouts:
if type==1
t = varargin{1};
... |
% NMEA parser
f = fopen('nmea1.txt', 'r');
fo = fopen('nmea1.out', 'w');
while (! feof(f))
buf = fgetl(f);
bufa = strsplit(buf, ',');
%checksum bitxor(a,b)
bufascii = double(buf(2:strcmp(buf, '*')));
cs = double(buf(2));
for c = buf(3:end-3)
cs = bitxor(cs, double(c));
end... |
% Calibrate to match 1960
clear
format compact;
%%% employment shares [L M] sectors (based on lswt), rows correpsond to 1950, 1960, 19670, 19980, 2000, 2007
emp_targets=[0.310725868 0.382496238
0.267881393 0.422307283
0.272726774 0.38019526
0.278642148 0.344125986
0.315280378 0.28167513
0.32847103... |
function do_canonical_variatescva3
% Function implementing the Canonical Variates Analysis method
% written by Prof Geoff Bohling - March 2006
% from the University of Kansas, US
% Modified by Dr William Sellers, University of Manchester, UK to produce various color images
% Modified to read Class text files produce... |
%% B3
clear,clc,close all;
% Vp(s)/Vm(s)
% These values are taken from PartA.m
km = 82;
alpha = 30;
% Known Resistor Values
R2 = 33e3;
R1 = 10e3;
% Removed the -ve as it shouldnt matter as it only controls the direction of the motor.
k = R2/R1;
% Cascaded foward path
num = k*km;
den = [1 alpha 0];
sys = tf(num, ... |
function output = Pairwise_Dis(Centers_X,Centers_Y)
N = length(Centers_X);
A = zeros(N,N);
for i =1:N-1
for j=i+1:N
A(i,j) = sqrt((Centers_X(i)-Centers_X(j))^2+(Centers_Y(i)-Centers_Y(j))^2);
end
end
output = A+A';
end |
function dist = chordal_dist(theta1, theta2, phi)
% compute chordal dist
theta = theta1-theta2;
dist = 2*sqrt((sin(theta/2))^2+sin(theta1)*sin(theta2)*(sin(phi/2))^2);
end |
% ctrl_figure_stuff
function ctrl_figure_stuff(input, k)
global REMORA PARAMS
switch input
case 'get'
set(REMORA.fig.disk_handles{k}, 'String', uigetdir);
case 'ctn_disk'
% get string from each of the disk fields
blanks = false;
for k = 1:length(REMORA.hrp.dfs)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.