text stringlengths 8 6.12M |
|---|
function counts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% "The preRC protein ORCA/LRWD1 Organizes Heterochromatin by
% Assembling Histone H3 Lysine 9 Methyltransferases on Chromatin"
%
% Sumanprava Giri, Vasudha Aggarwal, Julien Pontis, Zhen Shen ,
% Arindam Chakraborty, Abid Khan, Craig... |
% Efficiency inverse system equations
%
% mikael.mieskolainen@cern.ch, 2018
clear;
close all;
%{
%Q = 0, M = 2
%-------------------
p1p0 = T2*e0*e0 * A + T4*e0*e0*(1-e0)*(1-e0) * C + T4*e0*e0*(1-e1)*(1-e1) * E
k1k0 = T2*e1*e1 * B + T4*e1*e1*(1-e1)*(1-e1) * D + T4*(1-e0)*(1-e0)*e1*e1 * E
p1k0 = T2*e0*(1-e0)*(1-e1)*e... |
function wasOnTop = WinOnTop( figureHandle, isOnTop )
%WINONTOP allows to trigger figure's "Always On Top" state
%
%% INPUT ARGUMENTS:
%
% # figureHandle - Matlab's figure handle, scalar
% # isOnTop - logical scalar or empty array
%
%
%% USAGE:
%
% * WinOnTop( hfigure, true ); - switch on "always on top"
% *... |
function [indices,subsets] = GenSubsetIndices(data_dim,order)
% Generates two cell arrays of length order. The jth element of subsets is
% a matrix containing binary vectors corresponding to all subsets of weight
% j of a set of size data_dim. That is, each column of the matrix is a
% binary vector of weight j and len... |
function RM = get_fdRM( inv_model,bkgnd1,bkgnd2,alpha)
% This function is used to compute the reconstruction matrix RM, the
% Jacobian of the objective function J and the prior matrix RtR
nb_elem = size(inv_model.fwd_model.elems,1);
hp = calc_hyperparameter(inv_model);
try
mode = inv_model.in... |
function [DOFSet]=DOF_MakerTtranspose(nodeset)
for inode=1:size(nodeset)
DOFSet(2*(inode-1)+1,1) = 2.*(nodeset(inode,1)-1)+1;
DOFSet(2*(inode-1)+2,1) = 2.*(nodeset(inode,1)-1)+2;
end
end |
%% Information
% This file is only an example of how you can start the simulation. The
% sampling time decides how often you store states. The execution time
% will increase if you reduce the sampling time.
% Please note that the file "pathplotter.m" (only used in the second part
% of the assignment) shows the ship ... |
function [b b0] = circ_skew(alpha, w, dim)
% [b b0] = circ_skew(alpha,w,dim)
% Calculates a measure of skewness.
%
% Input:
% alpha sample of angles
% [w weightings in case of binned angle data]
% [dim statistic computed along this dimension, 1]
%
% If dim argument is spec... |
function y = results(scores)
highest_score = 0;
for i = 2 : length(scores)
if scores(1) < scores(i)
y = -1;
return;
end
if(scores(i) > highest_score)
highest_score = scores(i);
end
end
if scores(1) > highest_score
y = 1;
else
y = 0;
end
return; |
function matrixplot(data,varargin)
% 根据实值矩阵绘制色块图,用丰富的颜色和形状形象的展示矩阵元素值的大小。
%
% matrixplot(data) 绘制矩阵色块图,data为实值矩阵,每一个元素对应一个色块,色
% 块颜色由元素值大小决定。
%
% matrixplot(data, 'PARAM1',val1, 'PARAM2',val2, ...)
% 用成对出现的参数名/参数值控制色块的各项属性。可用的参数名/参数值如下:
% 'FigShape' --- 设定色块的形状,其参数值为:
% ... |
% integrate.m
function [trapezoidRS, midpointRS, absoluteErrorTrap, absoluteErrorMidpt] = integralEst(f_x, xmin, xmax, N)
digits(64);
a = xmin;
b = xmax;
x = linspace(a, b, (N+1));
delta_x = (b - a)/N;
x_i = x(1:N);
x_e = x(2:N+1);
trapRS = (2.*f_x(x(2:N)));
trapezoidRS = (delta_x/2).*(sum(trapRS) + f_x(x(N+1)) + f_x... |
function g_gray_map_sp
% g_gray_map Plot a gray basemap of the Samoan Passage region
%
% Gunnar Voet, APL - UW - Seattle
% voet@apl.washington.edu
%
% Last modification: 12/24/2012
% Load bathymetry
spf = spfolders;
load(spf.bathy.low)
% Set region limits
latlim = [-10.4 -7.25];
lonlim = [-170.75 -168.25... |
%%
%POC FLUX data
pdata=importdata('POC_FLUXES_Schlitzer-2002_Exp_C_DBI1niA.txt');
pdata=pdata.data; %lon (degE), lat (degN), depth (m), POC flux (mol/m2/year)
%find unique values for discrete points:
lonp=unique(pdata(:,1)); %non-uniform
latp=unique(pdata(:,2)); %non-uniform -MOST are at less often points than this... |
fprintf('This concludes Lesson 3\n');
pause(5); %wait 5 seconds
quit; |
clear all ; close all ;
cd c:/shared/UTE ; ls
s = load_untouch_nii('MONG_01_RB_DelRec_-_UTE_EEG_3_3.nii') ;
simg = s.img ;
gs = double(simg-imfilter(simg,fspecial('gaussian',65,300))) ;
[~,km] = kmeans(uint8(mat2gray(reshape(gs,[size(gs,1),size(gs,2)*size(gs,3)]))*255),2) ;
kim = reshape(km,size(gs)) ;
me... |
function maskContrast(sb,dirT,ncon)
spm_path = '/data/smark/spm';
data_path = '/data/smark/fmri_sub_preproc_dir/';
addpath(spm_path)
addpath(data_path)
vnpar = [51,50,49,48,46,45,44,43,42,40,38:-1:34,32:-1:28,26:-1:18];
mask = fullfile(data_path,'masks','mni_mask.nii');
for contrast_loop = 1:ncon
if contrast_loo... |
function uuid=generate_Unique_ID(n)
if isempty(n)
uuid = char(java.util.UUID.randomUUID);
else
uuid=cell(1,n);
for i=1:n
uuid{i}= char(java.util.UUID.randomUUID);
end
end
end |
function select_point_clouds_exp(path, iteration_index)
visualize_results = false;
figure_idx = 1;
all_images = read_settings(fullfile(path, 'settings.txt'));
selected_images = read_indices(fullfile(path, 'multi_recon', 'selection.txt'));
all_diffs = load(fullfile(path, ['iteration_', num2str(iteration_index)], 'SFS... |
classdef MicroCluster < matlab.mixin.Copyable
% Class definition of a micro-cluster (can be p-micro-cluster or
% o-micro-cluster)
properties
last_edit_T = -1; % What is this?
creation_time_stamp = -1;
lambda;
current_time_stamp;
label_count =... |
function Mthr=theor_trap_frf_r6(u,fdata,ydata1,phdata1,W,ydata2,fsamp,Rbead,Zbead,kT,falias)%,f0);
i=sqrt(-1);
n1=numel(ydata1);
n2=numel(phdata1);
ffrf=fdata(1:n1);
fph=fdata([n1+1:n2]);
fps=fdata((n1+n2+1):end);
Wf=W*numel(fps)/(n1+n2);
%Wf=Wf.*exp(-ffrf./100);%Wf-ffrf./Wf;%
%Wf=Wf.*exp(-ffrf./50);
[Mth,PHth]=frf_... |
function Hist=hist(im_lpb)
[r,c]=size(im_lpb);
Hist=zeros(1,256);
for i=1:r
for j=1:c
Hist(1,im_lpb(i,j)+1)=Hist(1,im_lpb(i,j)+1)+1;
end
end
Hist=Hist/sum(Hist);
end |
function [] = label2mni_batch()
% Transform surface labels to MNI standard space.
% Creates a batch script ('BatchFile_labels2mni.txt') to be processed from the terminal
%
% flirt
% -in /home/user/RetinotopicLabels/Labels/subject0032/vol_lh.V1.label.nii.gz
% -ref /home/user/atlases/MNI/MNI152_T1_2mm_brain.nii.gz
% ... |
function render_hist( histogram_values )
%RENDER_HIST Summary of this function goes here
% Detailed explanation goes here
clf;
hold on;
br = bar(histogram_values(1, :), 1, 'r', 'EdgeColor', 'none');
bg = bar(histogram_values(2, :), 1, 'g', 'EdgeColor', 'none');
bb = bar(histogram_values(3, :), 1,... |
% Learning Hyperparameters optimization
% Momentum Values
momentum = [0.9 0.7 0.5 0.3 0.1]
momentum_length = length(momentum)
%Learning Rate Values
learning_rate = [0.09 0.07 0.05 0.03 0.01]
lr_length = length(learning_rate)
%Parameter Hypertuning
optimal_cross_entropy_mlp = 100; %declare the initial cross entropy v... |
%Cycles through array and deletes row if a value is missing
function i = Deletion(i)
n = numel(i(:,1));
for row = n:-1:1
for col = 1:numel(i(row,:))
if ismissing(i(row,col)) == 1
i(row,:) = [];
end
end
end
|
function data = paperFontSize()
%全局的论文绘图文字大小设置
data = 10;
end
|
function par_esta
% parameter estimation with derivatives Holzbecher September 2005
% for exponential fit for c0
global tfit cfit lambda
% specify fitting data
tfit = [0.25 1 2 4 8]; %[0 5 18 30 50];
cfit = [0.7716 0.5791 0.4002 0.1860 0.1019]; %[2.3 1.18 0.52 0.23 0.13];
lambda = .3329;
c0 = fz... |
%% subCurve
% Below is a demonstration of the features of the |subCurve| function
%%
clear; close all; clc;
%%
% PLOT SETTINGS
figColor='w'; figColorDef='white';
fontSize=15;
markerSize1=45;
lineWidth1=2;
lineWidth2=5;
lineWidth3=2;
faceAlpha=0.5;
%% LINEARLY UPSAMPLING A CURVE
%%
% Simulating a ... |
function [chehra_accuracy, deva_accuracy, intraface_accuracy, rcpr_accuracy, our_model_accuracy] = get_model_accuracies(path, face_list, dataset, per_part_error_threshold, auto_train_select)
%
if(dataset == 'jack')
load([path '/common_data/fids_mapping/chehra_deva_intraface_rcpr_common_fids.mat']);
... |
function [Mus, Covs, Ws]=rand_split(P,X,M,R,sigma,F,W,nr_of_cand)
k = size(R,1);
[n,d] = size(X);
epsilon = 1e-2; % threshold in relative loglikelihood improvement for convergence in local partial EM
[tmp,I] = max(P,[],2);
Mus=[];Covs=[];K=[];Ws=[];KL=[];
for i=1:k
XI = f... |
function [edge_image,angle_map,phase_map,edge_mag] = getOriAndEdge(Fo,Fe,edgeRange)
if (~exist('edgeRange'))
edgeRange=[eps;1];
else
if(max(size(edgeRange))==1)
edgeRange=[edgeRange;1];
end
end
[r c fn]=size(Fo);
mFo = Fo.^2;
mFe = Fe.^2;
mag_all = sqrt(mFo + mFe);
[max_mag,max_id]... |
% MEAN RESIDUE ELLIPTICITY (MRE)
% MRE = CD signal * Mean Residue Weight
% --------------------------------
% 10 * Protein Concentration * Pathlength
%
% CD signal in mdeg
% Mean Residue Weight (For proteins - 110)
% Protein Concentration in mg/ml
% Pathlength (0.1 or 1 cm)
% MRE ... |
function [theta] = joint_limits_parameters(t)
i = 0;
%% 1: Global translation
i = i + 1;
theta{i}.value = t(i);
theta{i}.type = 'T';
theta{i}.axis = [1; 0; 0];
theta{i}.segment_id = 1;
%% 2: Global translation
i = i + 1;
theta{i}.value = t(i);
theta{i}.type = 'T';
theta{i}.axis = [0; 1; 0];
theta{i}.segment_id = 1... |
set(0,'DefaultTextFontName','Times',...
'DefaultTextFontSize',10,...
'DefaultAxesFontName','Times',...
'DefaultAxesFontSize',8,...
'DefaultLineLineWidth',1,...
'DefaultLineMarkerSize',7.75);
load('tsp_UL_SNR_avg.mat');
I_total_radar_new = I_total_radar;
I_total_UL_new = I_total_UL;
I_total_DL_new = I_total_DL;
I_total_... |
%function_name one line description
%
%[output] = function_name(inputparams)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Example description paragraph ... |
PANCANProcesedLabels = strings(11069,1);
counter = zeros(11069,1); %to check labels are unique
for i=1:11069
% Extract TSS code:
[token,remain] = strtok(PANCANLabels{1,i},'-');
token2 = strtok(remain,'-');
% Compare to TSS codes associated with each cancer type:
for j=1:830
if strcmp(token2,... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function fitGMM
%
%
% Input parameters:
%
% Output parameters:
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function model = fitGMM(data, gaussianType, nbGaussians)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function [nPeople, stadiums, types] = countCapacity(steps, boxSize, draw)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
nPeople = 0;
value = 0;
stadiums = [];
%stadiumsOld = [];
%stadiumsOldOld = [];
types = [];
%nSuitcases = 0;
%suitcases = 5*[normrnd(38.942,3.035,[1,nSuitcases]); n... |
{
struct('foo',1) ...
struct('foo',2)
} |
function [nextState, flag] = VVintegrate(CurrState, h, G, N, breakOut)
%%%%%% First check if bodies are separating %%%%%%
% breakOut = check_if_break(CurrState, G, N);
% orbitRates = calcOrbRates(CurrState, breakOut);
% CurrState.orbitRates = orbitRates;
flag.set=0;
v_mid=zeros(N,3); w_mid=zeros(N,3);
% % 1) Get a(... |
%{
Adams Fourth order predictor corrector
10/9/1017 Jake Tully
This Script is an example of the Adams Fourth order predictor corrector
%}
clear
clc
close all
% Functions & Initial value
f1 = @(t,y) t/2 - y/2;
f2 = @(t) t-2+3*exp(-t/2);
a = 0;
b = 3;
alpha = 1;
t = a;
w = alpha;
N = 30;
h = (b-a)/N;
... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2014 Analog Devices, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http:/... |
% Dock the figures into a window frame
% Copyright 2006-2009 The MathWorks, Inc.
set(4,'windowstyle', 'docked')
set(5,'windowstyle', 'docked') |
%sectionplots_xyz_mean_0406
% first step in constructing section plots of the moored data
% for mean profiles. the routine extracts
% xyz triplets from each mooring file and outputs to matlab file
% for subsequent contouring
X=[];Y=[];Zu=[];Zv=[];Zpt=[];Zs=[];
lat_origin=40.2900;
lon_origin=-70.2000;
%moorin... |
function map=PeakDetect(S,IaRange,IbRange,IcRange,IdRange,noiseRange,sn)
%% This script was originally written to detect potassium peaks. Therefore
%% it is specialized to find both peaks. If you are only interested in
%% detecting one peak, simpy enter that peak in twice and adjust the signal
%% to noise thres... |
function [styles, colors] = curves_styles_colors_COMET_ICML_2015()
styles.comet = '-x';
styles.hdsl = ':d';
styles.lego = '-->';
styles.boost = '-.v';
styles.euclid = ':o';
% cmp = colormap(parula(8));
cmp = get(groot,'DefaultAxesColorOrder');
colors.comet = cmp(1,:);
colors.hdsl = cmp(2,:);
colors.lego = cmp(... |
%RADIATIONON turns classical radiation ON
%
% Switch all magnets currently set to use pass-methods
% 'BndMPoleSymplectic4Pass' and 'StrMPoleSymplectic4Pass'
% to their equivalents with classical radiation
% 'BndMPoleSymplectic4RadPass' and 'StrMPoleSymplectic4RadPass'
%
% NOTES:
% 1. Deprecated funct... |
function[handles]=runLIBS_regular(handles)
delete(findall(handles.ax1,'type','line'));
drawnow
optlib = handles.optlib;
sett = optlib.sett;
Nsett = length(sett);
IJK = handles.IJK;
T1 = handles.T1;
T3 = handles.T3;
Nbranches = size(IJK,1);
setLIB = handles.setLIB;
h = handles.h;
Nsites = s... |
classdef TuASol < TuGame
% TUASOL is a subclass object of TUGAME to perform several computations for retrieving
% and modifying game data. It stores relevant game information and solutions needed by
% overloading functions.
%
% Usage: clv = TuASol(v,'gtype','gformat')
%
% Define variables:
% output:
% clv --... |
clear;
clc;
more off;
##
## Abgabe 8
## Jan Kulose und Marvin Piekarek
## s0557320 / s0556014
##
function [a, b] = linearReg(x,y)
n = length(x);
xquer = sum((1/n).*x);
yquer = sum((1/n).*y);
Sxy = (1/(n-1)) .* (sum(x.*y) - n.*xquer.*yquer);
Sx2 = (1/(n-1)) .* (sum((x.-xquer).^2));
a = Sxy./Sx2;
b = yque... |
% suspect_dir = '../Audio/Suspect/';
% sample_dir = '../Audio/Sample/';
suspect_dir = 'C:/Users/SiddGururani/Desktop/Stevie wonder samples/Inorganic Dataset/New_songs/';
sample_dir = 'C:/Users/SiddGururani/Desktop/Stevie wonder samples/Inorganic Dataset/New_sample/';
annotations = dir([sample_dir '*.txt']);
% file_su... |
%LOWDEGREESWEEP Low-degree node scanning.
% VISITED=LOWDEGREESWEEP(VISITED,A,CANDIDATE,MAXDEGREE) sweeps over the
% node subset (row vector) CANDIDATE of the undirected graph whose
% symmetric adjacency matrix is A, and marks an independent set F nodes
% of degree <= MAXDEGERE. Note: A must have a zero diag... |
function testsr1
%Statystyka stosowana - test dla sredniej - model 1, czyli N(m,sigma), sigma znane
%kwantyle rozkladu N(0,1)
kwantyle=[
% prawdopod. kwantyl N(0,1)
0.900 1.282
0.905 1.311
0.910 1.341
0.915 1.373
0.920 1.406
0.925 1.4... |
function grate(P, scr, t, stim, demo)
%%% Create and and display drifting grating %%%
if ~exist('demo', 'var')
demo = false;
end
nStimuli = length(stim);
if nStimuli == 4
cross_rot = 45;
else
cross_rot = 0;
end
for i = 1:nStimuli
% create texture
texture{i} = CreateProceduralGabor(scr.win, P.gra... |
close all
clc;clear;
num0 = 1;
den01 = [1 0];
den02 = [1 1];
den03 = [1 2];
den0 = conv(den01,conv(den02,den03));
num1 = [1 1];
den11 = [1 0];
den12 = [1 -1];
den13 = [1 4 16];
den1 = conv(den11,conv(den12,den13));
num2 = [1 3];
den21 = [1 0];
den22 = [1 2];
den2 = conv(den21,den22);
sys0 = tf(num0,den0)
sys1 = ... |
function [ MOV ] = NM_Calc( Model_Ref, Model_Test, Pro_Test )
%[ MOV ] = NM_Calc( Model_Ref, Model_Test, Pro_Test )
% As described by ITU-R BS.1387-1 Section 4.5
global debug_var
if debug_var
disp(' Noise to Mask Ratio')
end
MOV.TotalNMRB = TotalNMRB( Model_Ref, Model_Test, Pro_Test );
MOV.SegmentalNMRB = Segm... |
clear
clc
num = [6,7,8,9];
prefix = {'/home/pzhang/chen/move-bed/'};
fname = {'periodic1_'};
for i=1:numel(num)
name = strcat(prefix,fname,num2str(num(i)),'.out');
data = importdata(char(name));
x = data.data(:,1);
y = data.data(:,2);
plot(data.data(:,1),data.data(:,2),'linewidth',2)
hold on
... |
clear;
%Parameter setting ------------------------------------
%synchronization signal
timing_offset = 20; %timing offset
NID = 355; %Physical Cell ID
Snr = 20; %signal to noise ratio, dB
freqOffset = 0; %frequency... |
function [bestParams] = parallelLibSVM(label, feat, log2c, log2g, folds, plotLabel)
for i = 1:size(feat, 2)
if sum(isnan(feat(:, i))) > 0
feat(isnan(feat(:, i)), i) = nanmean(feat(:, i));
end
end
indices = crossvalind('Kfold', label, folds);
Z = [];
%accuracy, c param... |
function varargout = randomAngle3d(varargin)
%RANDOMANGLE3D Return a 3D angle uniformly distributed on unit sphere.
%
% usage
% [THETA PHI] = randomAngle3d
% Generate an angle unformly distributed on the surface of the unit
% sphere.
%
% "Mathematical" convention is used: theta is the colatitude (angle with
%... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Smoothed nonparametric spectral estimation via cepstrum thresholding %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% function Phi = CepSpec(y,mu)
%
% y = input data vector
% mu = selected threshold (see [1] for... |
function iv_out = InvertIV(iv_in,t0,t1)
% function iv_out = InvertIV(iv_in,t0,t1)
%
% "flips" included intervals to non-included, and vice versa
%
% MvdM 2016-04-27
iv_out = iv;
iv_out.tstart = cat(1,t0,iv_in.tend);
iv_out.tend = cat(1,iv_in.tstart,t1);
|
%% Mission: Solving the Clusters!
plot(rr1(1:30), rr1(2:31),'b.');
X=[rr1(1:30); rr1(2:31)].'; %x-values in 1. spalte, y-values in 2. spalte
plot(X(:,1), X(:,2),'r.');
%make a silhouette plot using the cluster indices output from kmeans.
%The silhouette plot displays a measure of how close each point in one
%clust... |
function X = vector2im(data)
cellSize = 8;
im = reshape(data, [32 32 ,3]);
im = im2double(im);
%for i = 1:size(im,3)
% data = im(:,:,i);
% im(:,:,i) = im(:,:,i) - mean(data(:));
%end
hog = vl_hog(single(im), cellSize, 'verbose') ;
X = hog(:);
%n = min(x_hog);
%m = max(x_hog);
%X = (2*x_hog - (m+n) )/(m-n);
X = X';
% im... |
sumaTiempo = zeros(25,1);
cuentaIncorrectas = zeros(25,1);
for i=1:length(s)
resta = ones(length(s{i}),1) - s{i}(:,2);
for j=1:length(s{i})
indice = s{i}(j,1) - 1;
sumaTiempo(indice) = sumaTiempo(indice) + s{i}(j,3);
end
end
for i=1:25
hold on
bar(i, sumaTiempo(i)/25)
end
set(gc... |
function [P,ip] = transitionprob(T,M,s,rm)
% Draws transition probs
%% INPUT
% T size obs
% M numbers of regimes
% s state variable (1,...,M regimes). Dimension (TKxM)
% rm Dirichlet
%% OUTPUT
% P transition matrix
% ip invariant prob
% transprob empirical transition prob
P=zeros(M,M);
nt=[s(1:T-... |
function len = fwrite(obj, varargin)
%FWRITE Write binary data to USB device.
%
% LEN = FWRITE(OBJ, A) writes the data A to the USB device
% indicated by OBJ. The data A will be translated to the precision 'uchar'.
% LEN returns the number of bytes that have written.
%
% LEN = FWRITE(OBJ,A,'PRECISION') writes t... |
function analyse_microstim_2phosphene5_moviedata_aston(date)
%2/4/20
%Written by Xing, extracts eye movement data during a
%microstimulation/visual 2-phosphene task, using session 191118_B7_aston.
allInstanceInd=1;
saveFullMUA=1;
smoothResponse=1;
downSampling=1;
downsampleFreq=30;
alignTargOn=1;%1: align eye movem... |
% The parameters of the paper
D = 1;
H = 0.3;
r = 0.4;
k = 2.0;
A = 0.02;
S = 100;
x0 = 1500;
m = r * k;
%Equilibrium values
uEq = (r * H)/(1 - r);
vEq = (1 - uEq)*(H + uEq);
% Create a new ecosystem with a grid 1 x nX
eco = Ecosystem(1,5000);
% Set the left-top and the right-bottom coordinate of the rectangle
% o... |
%in barnamei baraye PROPERTIES CO-OCCURRENCE MATRIX ast,BARAYE
%EJRAYE BARNAME HAME BARNAME RA ENTEKHAB KARDE(Ctrl+A & Ctrl+C)VA DAR Command
%Window MATLAB PASTE KONID.
clc;
clear all;
close all;
Img=imread('3.2.tif');
%Img=imread('3.1.tif');
%Img=imread('3.3.tif');
figure(1);
imshow(Img);title('tasvire vorudi');
%jah... |
colour_bandwidth = 20.0; % color bandwidth
radius = 3; %3 % maximum neighbourhood distance
ncuts_thresh = 0.1; %0.1 % cutting threshold
min_area = 1000; %200 % minimum area of segment
max_depth = 8; %8 % maximum splitting depth
scale_factor = 0.4; % image downscale factor
image_sig... |
%% Inverter Definition
% ########################################################################
% Define the object of an inverter
% Output:
% - [obj] inverter parameter
% Establishment: 23.08.2020 Zhiqing Yang, PGS, RWTH Aachen
% ########################################################################
functi... |
function arc90(xs,ys,xf,yf,xc,yc)
% Arc90 is a function that takes in the start (xs,ys) and end (xf,yf) coordinates of a
% 90 degree curve along with the center (xc,yc) of the curve, then plots it.
% David Kong
% Calculate radius of the curve
r = max(abs(xf - xs),abs(yf-ys));
% Choose the direction of plot based on r... |
function R = bitrevorder(X)
% (internal function for FNT files)
% Purpose: rearrange vector X (or columns of arrays) to reverse bit order, upto
% max 2^k size <= length(X).
% Example :
% Indices of a 4-length vector X (with first index at 0), namely
% k=0 -> 00 -> flip -> 00
% k=1 -> 01 -> flip -> 10
% k=2 ... |
clear all
addpath(genpath('/gs/project/gsf-624-aa/quarantaine/niak-issue100/'))
path_raw = '/gs/project/gsf-624-aa/database2/repro/data_mnc/';
path_preprocess = '/gs/project/gsf-624-aa/database2/repro/fmri_preproc_20160215/';
subjects_list = {'0025427',...
'0025428',...
'0025429',...
'0025430',...
'0025... |
function C = catmull_rom_eval(P,T,t,varargin)
% C = catmull_rom_eval(P,T,t,varargin)
%
% Inputs:
% P #P by dim list of control points
% T #T list of control point parametric values (times)
% t #t list of parametric evaluation values (times)
% Optional:
% 'Period' followed by finite perio... |
% DC-moottorin Kv-arvon muodostus
% Mitatut arvot vektoreissa Ug ja f
% Pyöritysmoottorin napajännite (ei käytetä mihinkään tässä)
Us = [ 4 5 6 7 8 9 10 ]
% Mitattavan moottorin napajännite (generaattorijännite)
Ug = [ 1.92 2.78 3.66 4.54 5.45 6.38 7.28 9.1 ]
% Pyörimisanturilta saatu taajuus Hz (1 jakso pe... |
%% Horizontal_Checkerboard
% Stimuli.Horizontal_Checkerboard = [Stimuli.Image.checherboardHpb Stimuli.Image.checherboardHnb];
Stimuli.Horizontal_Checkerboard = [Stimuli.Checkerboard.Horitontal.Positive Stimuli.Checkerboard.Horitontal.Negative];
%% Vertical_Checkerboard
% Stimuli.Vertical_Checkerboard = [Stimuli.Ima... |
%load('mat/HRR_subject_kernel_subj=1_K=10_N=10_E=0.050_nsamples=10_sigma_w=1.mat')
%load('mat/HRR_subject_kernel_subj=1_K=10_N=10_E=0.050_nsamples=10_sigma_w=1.000_norm=1.mat');
load('../py_vgdl/mat/HRR_subject_kernel_subj=32_K=10_N=10_E=0.050_nsamples=100_sigma_w=1.000_norm=1.mat');
figure;
subplot(2,4,1);
imagesc(t... |
function I = SSSM(A,Q,C,R,Phi0,eta,y,x0,V0,q,Channel,nC,nS,nT,nQ)
% predicted state estimate
I.xp = zeros(nS,nC,nT);
I.Vp = zeros(nS,nS,nT);
% filtered state estimate
I.xf = zeros(nS,nC,nT);
I.Vf = zeros(nS,nS,nC,nT);
% moment matched state estimate
I.xm = zeros(nS,nT);
I.Vm = zeros(nS,nS,nT);
% prior context p... |
function dsFun = a_median(direction)
function [aimg, inputs] = downfn(image, factor)
factor=factor^2;
[width, height] = size(image);
if mod(direction, 2) > 0
w = 1+floor(factor*(width-1));
else
w = 1;
end
if (direction > 1)
h = 1+floor(factor*(height-1));
else
... |
%Brian Polagye
%July 13, 2013
%Description: color plot of flume chracteristics
clear
plot_case = [1:43]; %data poiunts to include in plot
batch_file = 'FlumeData.xlsx';
plot_parameter = 2;
% 1 = mean velocity
% 2 = turbulence intensity
% 3 = % spikes
%% Load batch data
%load batc... |
function p = finish(p)
%pds.behavior.reward.finish(p) finishes up after end of experiment.
% This is mostly a wrapper to the other reward modules.
pds.newEraSyringePump.finish(p); |
function w_dot_ = propagation_w_dot_R(w, w_dot, theta_dot, theta_ddot, rotation_matrix)
w_dot_ = rotation_matrix * w_dot + ...
cross(rotation_matrix * w ,[0;0;theta_dot]) + [0;0;theta_ddot];
end |
function saveVar(var, varName)
path = '../report_src/variables/';
f = fopen([path varName '.tex'], 'w+');
fprintf(f, num2str(var));
fclose(f); |
%Part C - ME 303
%Sebastien Blanchet, Timothy Wulff
%Intialize code
close all
clear variables
clc
%Define C, lambda, intial delta r, tolerance and iteration counter
C = 4;
lambda = 3;
dr= 0.2;
tol = 0.0001;
iterations=0;
%Declare symbolic variable x for plotting exact solution
syms x;
%Create void loop for grid s... |
function [sample, CI95UCL, CI95LCL]=run_ttest_12mo(max_range,min_range)
%[sample, CI95UCL, CI95LCL] = run_ttest_1mo (max_range,min_range)
%
%
% parameters:
% - 12 months
%
%
% (c) Simon Lansbergen, May 2016.
%
switch nargin % set input varibles
case 2
if isa(max_range,'char')
max_range... |
function M = convectionTermCylindrical1D(u)
% This function uses the central difference scheme to discretize a 1D
% convection term in the form \grad (u \phi) where u is a face vactor
% It is for a cylindrical coordinate in the r direction
%
% SYNOPSIS:
% M = convectionTermCylindrical1D(u)
%
% PARAMETERS:
% u - Fac... |
function [IFArray,IFData] = IF(bench, act, varargin)
% IF measure the Influence Function of one actuator
%
% IFArray = measure.IF(bench act, nPushPull, amplitude)
% [IFArray,IFData] = measure.IF(bench act, nPushPull, amplitude)
% The requested actuator is push-pulled and the difference
% is returned as it... |
function [ x ] = Broyden( fun , x0, maxiter)
%Resolucion de S.E. no lineales sin recurrir a la Jacobiana
iter = 0;
TOL = 1.0e-8;
%maxiterGC = 1000;
[f,J,~] = feval(fun,x0);
B = J;
x=x0;
nf = norm(f);
%conv = norm(B-J);
fprintf(' iter ||f|| ||Bk - Jk|| ... |
figure('Name','Simulink Animation')
OS=OS_xyz.data;
SC=SC_xyz;
for time = 1:10:size(OS,3)
%magnets
scatter3([OS(:,1,time);SC(:,1)],...
[OS(:,2,time);SC(:,2)],...
[OS(:,3,time);SC(:,3)],100,[0.5,0.5,0.5],'filled');
daspect([1 1 1])
drawnow
end
|
function [] = plotPoints( hfig, pointBuffer, H )
figure(hfig);
for i=1:size(pointBuffer, 2)
if (nargin == 3)
pointBuffer(i).coordinates = normalizePoint(H * pointBuffer(i).coordinates);
end
scatter(pointBuffer(i).coordinates(1), pointBuffer(i... |
function [output1] = dJs_RightToeBottomFront(var1,var2)
if coder.target('MATLAB')
[output1] = dJs_RightToeBottomFront_mex(var1,var2);
else
coder.cinclude('dJs_RightToeBottomFront_src.h');
output1 = zeros(6, 20);
coder.ceval('dJs_RightToeBottomFront_src' ...
... |
%% Load the display setup and create mosaic object
% See "imageRecon.mlx" for the basic reconstruction routine
display = displayCreate('CRT12BitDisplay');
% Generate cone mosaic - [eccX, eccY] deg ecc
% with the new cone mosaic (cMosaic class)
eccX = 18.0; eccY = 18.0;
retina = ConeResponseCmosaic...
(eccX, eccY, ... |
function dx = derivativeX(x,y,k)
dx = 15.6*(y - x + k*(.714*x+.2145*(abs(x+1)-abs(x-1))));
end |
% studying the peaks function, specially "translating and
% scaling Gaussian distributions" - see help peaks for details
clear all;
clc;
% NB peaks will run meshgrid(linspace(-3,3,arg1))
% linspace(-3,3,3)
% x = meshgrid([-3 0 3]);
% linspace(-3,3,5)
% x = meshgrid([-3.0000 -1.5000 0 1.5000 3.0000]);
x = meshgrid(linsp... |
function RF = setrfphase(RFPhaseGoal)
%SETRFPHASE - Set the RF phase slow loop
% setrfphase(RFPhaseGoal)
%
% INPUTS
% 1. RFPhaseGoal - Phase Goal (VVM channel SR03S___RFPHASAAM00)
%
% OUTPUTS
% 1. RF - Structure of inputs and outputs
%
if nargin < 1
RF.PhaseGoal = 110;
else
RF.PhaseGoal = RFPhaseGoal;
en... |
def WeightedLinearLeastSquaresFit(x,y,w):
%""" takes input arrays of x,y, and w and returns slope,slope error,intercep"""
%"""remember w is 1/(u^2) where u is the uncertainty"""
w_sum = sum(w)
wy_sum = sum(w.*y)
wx_sum = sum(w.*x)
wxy_sum = sum(w.*x.*y)
w_x_sqr_sum = sum(w.*(x.^2))
wx_su... |
function F1=F_score(net,H,targets)
%Compute accuracy for binary classification
n=length(targets);%# of samples
F1=0;%initialisation
% ====================== YOUR CODE HERE ======================
% Instructions: Compute the F1 = 2*Precision*Recall/(Precision+Recall)
% Precision=TruePositives/(... |
clear all
clc
%% outline
% use 3-20 ser
% loop train ANN to predict 21-60 ser.
% add err ser into trainning set in each loop.
% till all predicted ser in acceptable range
%% main part
% % cd path
% cd /raid4/data/liyan/work_2011b/work_ANN_ml/work_ANN_XP_ser/m_files
% cd /data/liyan/work_matlab/work_ANN_ml/work_ANN_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.