text stringlengths 8 6.12M |
|---|
%% Mean mesh sampling method.
%addpath(genpath('../'));
%clear all;
% Data path
local_input_path = '/input';
local_output_path = '/output';
cluster_input_path = '../../../data/bu4dfe/output';
cluster_output_path = '../../../data/bu4dfe/output/conc';
input_path = cluster_input_path;
output_path = cluster_output_path... |
%% Description:
% This script applies the function "FileNumChecker.m" on top of the guided
% filtering appraoch of image fusion. Thus, it can constantly detect the
% scaned image and perform image blending along with the scan. The used
% stack images will be stored in the folder "finished" and the blending
% results w... |
colors=['b' 'g' 'r' 'c' 'm' 'y'];
originalImage = imread('Images/autoSegments/train/MGF1-Cross-0009.tif');
%imshow(originalImage);
%hold on;
%Convert to grayscale
if size(originalImage,3) == 3
originalImage = rgb2gray(originalImage);
end
[BW, cellMask] = segmentImage(originalImage);
%imshow(BW);
% Remove small... |
function [QueryProjection,DatabaseProjection] = InteglatePrj_forSato(exName, DatabaseGeodesicID, QueryGeodesicID, imgSize, modelTypeRow)
% gdid = 2;
% imgSize = 128;
% modelTypes = {'clutch'; 'die'; 'gear';};
exType = 'Query';
prjData_Query = IntegratePrj2(exName, exType, QueryGeodesicID, imgSize, modelTypeRow);
m... |
function nii_cleanup3(gi,wi,ci, bi,si);
%clean segmentation partitions
% gi: gray matter image filename
% wi: white matter image filename
% ci: CSF matter image filename
%
%Example
% nii_cleanup('c1head_2.nii','c2head_2.nii','c3head_2.nii',2)
%
%Adapted John Ashburner's from spm_preproc_write
% Copyright (C) 2005-2... |
function [x,y] = measureShift(fxcorr)
% Aligns images with subpixel precision
% Example:
% [x,y] = measureShift(fft2(img1), conj(fft2(img2)));
% Dimitri Yatsenko, 2016-01-07
sz = size(fxcorr);
assert(all(sz(3:end)==1), 'only 2D images are accepted')
assert(all(sz(1:2)>0 & mod(sz(1:2),2)==0), 'image must have eve... |
[x, fs] = audioread('coh18sample_ERB.wav');
[Pxx, f] = pmtm(x, 1.5, 2^ceil(log2(numel(x))), fs);
semilogx(f, pow2db(Pxx) - max(pow2db(Pxx)), 'k', 'linew', 2);
xlim([100, 10000]);
set(gca, 'XTick', [0.25, 0.5, 1, 2, 4, 8]*1000, 'Xticklabel', {'0.25', '0.5', '1', '2', '4', '8'});
set(gca, 'FontSize', 20);
xlabel('Frequen... |
%lets graph a dipole now
type emtensor
type xlor
type offcentercoulomb
%so now we are going to translate the reference frame to one where this
%charge is moving at a relativistic speed, lets say .5c
v = .1 %ratio of the speed of light that this thing is moving
x = -3:1:3;
y = -3:1:3;
z = -3:1:3;
[X,Y,... |
function [ array_binary ] = kbits( n,k )
%GENERATE_BINARY Summary of this function goes here
% Detailed explanation goes here
% n is number of digits
% k is sum of all digits
array_binary = [];
if (k>n)
return
end
if k == 0
array_binary(1) = 0;
return
end
matrix = perms_reps([0 1], [n-k, k]);
array_binar... |
function [I,P1out,P2out] = CRPmakeI(f1,f2,p1,p2,r1,r2,phi1,phi2,M,t)
% f1 = rotation frequency of the polarizer, in Hz
% f2 = rotation frequency of the analyzer, in Hz
% p1 = phase (initial angle) of the polarizer, in rad
% p2 = phase (initial angle) of the analyzer, in rad
% r1 = degree of linear polarization in the i... |
clc
clear
import pkg.*
path = 'data\';
file = 'data2.csv';
filename = strcat(path, file);
load = 0;
run = 1;
n = 1;
i = 1;
z = 1;
fileID = fopen(filename);
C = textscan(fileID, '%s %f %f %f', 'Delimiter', [',' '\n']);
M = [C{2},C{3},C{4}];
V = C{1};
[x, y] = size(M);
while i<=(x-3)
dimension(n) = CMMdataset([])... |
A = [0,0,1,1,0;
0,0,0,0,1;
1,0,0,0,0;
1,0,0,0,0;
0,1,1,1,0];
max_iter = 250;
N = size(A,1);
pi = ones(N,1)/N;
d = 0.85;
w = PageRank(A,pi,d,max_iter) |
function plot_IT2MFs_new( center_input_MF, std_dev_UMF, std_dev_LMF )
%UNTITLED4 plots membership functions of interval typ-2 FS
% input:
% center_input_MF: cell array. contains center of guassian MFs on each input. Centers
% for one inpu variable is expected in one element of cell, For example, if there
% is 3... |
function process_fista_clust(filename)
% Cluster the events with isosplit5 algorithm, also make sure the labels
% will follow them after events are separated into different files.
S=load(filename);
fista=S.fista;
data_s=smooth(S.data_pad);
fista.X1_max=fista.X1_max(fista.X1_max>5&fista.X1_max<(length(f... |
%
% RECON MOVIE - Make and display movies of dynamic image series
%
%
%
GRAY_VALUES = 256;
GRAY_RANGE = 96;
GRAY_CENTER = 128;
x_matrix = data_des.X_resolution;
y_matrix = data_des.Y_resolution;
sum_image = zeros(y_matrix,x_matrix);
for D = 1:Ndyn
sum_image = sum_image + squeeze(abs(pic(D,:... |
% Copyright is with the following author(s):
%
% (c) 2012 Juraj Oravec, Slovak University of Technology in Bratislava,
% juraj.oravec@stuba.sk
% (c) 2012 Monika Bakosova, Slovak University of Technology in Bratislava,
% monika.bakosova@stuba.sk
% ------------------------------------------------------------------------... |
Screen('TextSize', window, fontSizeBig);
DrawFormattedText(window, experimenterInput,...
'center', 'center', white);
Screen('Flip', window);
keyIsDown = 0;
while ~keyIsDown
[keyIsDown, secs, keyCode] = KbCheck(experimenterKeyboard); %all devices
if keyCode(experimenterKey) == 1 % when pressed, co... |
function [Channel_1ToChannel_2, Channel_2ToChannel_1,coef_1, coef_2, ...
GCSpectraChannel_1To_Channel_2, GCSpectraChannel_2To_Channel_1, ...
PDCChannel_1ToChannel_2, PDCChannel_2ToChannel_1 ...
RPCChannel_1ToChannel_2, RPCChannel_2ToChannel_1] = ...
newFrequencyCausality(inChannel_1, inChannel_2, Fs, order... |
q1;
hold on;
|
function [ output_args ] = bcih1d_get_cursor(Features)
%BCIH1D_GET_CURSOR : Evaluate cursor position based on Features
% and Normalization
end
|
% One step of clustering using Expectation Maximization Algorithm
% Needs initilisation: vqinit + initrbf
% variables needing init are:
% delta : learning rate
% m : unit positions (by initrbf)
% sigma2 : unit variances (by initrbf)
%
% The algorithm works in a competetive way
%
i=rows(data);
dims=cols(m);
oldm=m;
... |
function [out]=butterlp(im,d,n)
out=1-butterhp(im,d,n);
end
% a=imread('cameraman.tif');
% lp=butterlp(a,15,1);
% af=fftshift(fft2(a));
% aflp=af.*lp;
% aflpi=ifft2(aflp);
% fftshow(aflpi) |
classdef RangeScaledArray < LazyArray
% RANGESCALEDARRAY Lazily transforms the output range and datatype of
% an array.
%
% Author: Vivek Venkatachalam (vivekv2@gmail.com)
properties (SetAccess = immutable)
% This is the range of values to be placed in the full output
% range.
... |
function [ Result_cell ] = AnalyseGC_ELIF( Result_cell, varargin )
%
% Detailed explanation goes here
disp('AnalyseGC...');
tic;
% choices
re_arrange = 0;
get_corrcoef = 0;
for i = 1:(length(varargin)/2)
eval([varargin{i*2-1}, '=', num2str(varargin{i*2}) ]);
end
Result_num = length(Result_cell);
for r_num = ... |
clc
%For Straight Body Arrangement
qLR=[0,0,0,0,90,0]; %Right Leg Joint Angles
qT=0; %Torso Joint Angles
qLL=[60,60,0,0,90,0]; %Left Leg Joint Angles
qAR=[0,90,-90,0,0,-90,0]; %Right Arm Joint Angles
qAL=[0,90,-90,0,0,-90,0]; %Left Arm Joint Angles
qN=[0,-90]; %Neck Joint Angles
LW=10;
% %For Running
%
... |
function this = parseStates(this)
[dd, ~] = getInterpData(this.dataset, 0, 'spline');
d = getDataStruct(this.dataset);
for comp = this.states
if isa(comp.initExpr, 'char')
dataCompName = comp.initExpr;
comp.init = dd(d.d.(dataCompName));
end
end
this.result.xinit = [this.states.init];
th... |
%% ===== WHITE KEYS Keyboard Mask Detection ====== %
% 1) color filtering: white pixels will be enlightened
BW = imbinarize(front_video.background, 0.74);
BW = all(BW, 3);
BW = bwareaopen(BW, 50);
BW = imfill(BW, 'holes');
% ----- 'Control Board Plastic' removal ----- %
%{
'Control Board Plastic' region... |
function PCriteria_ED_prs(obj, evt)
hndl = get(gcf, 'Userdata');
tmpV = round(str2double(get(obj, 'String')));
if tmpV > 6
else
hndl.setting.criteria.NCriteria = tmpV;
set(hndl.postreviewFig, 'Userdata', hndl);
set(hndl.uicontrol.control.NUI_ED(1:tmpV, :), 'Visible', 'on');
if tmpV < 6... |
%% fn_meshinv
%% Syntax
% mesh = fn_meshinv({vertices,faces})
% faces = fn_meshinv(faces)
%% Source
% Thomas Deneux
%
% Copyright 2005-2012
%
|
function colors = rwb(n)
colors = [
1 0 0
1 1 1
0 0 1
];
colors = flipdim(colors,1);
colors_up = zeros(n,3);
for k = 1:3
colors_up(:,k) = interp1(colors(:,k),linspace(1,length(colors),n));
end
colors = colors_up;
|
function metrics=For_1_Images_tceed(iRef)
load('C:\Users\Abdul Rehman\Desktop\Internship\Code\Code_Gao_and_my_version\vgg_and_ceed_val-06-Jun-2020-11-30-16-Epoch-5');
% load('C:\Users\Abdul Rehman\Desktop\Internship\New_m\brisque19-Jun-2020-16-36-59.mat');
score=zeros(6,1);
score1=zeros(6,1);
%% READ A REFERENCE I... |
function logi=isdir2(s)
% Function: judge any input, not just char as isdir
% Modify History:
% 2013-06-15, Sat, Writing the function
%
% See also: isdir
if ischar(s)
if isdir(s)
logi=~isempty(regexp(s,filesep, 'once'));
else
logi=1<0;
end
else
logi=1<0;
end
end |
function [x_c,y_c] = DetectCircles(accum, r, thres)
x_c=[];
y_c=[];
R = r(1):r(2); % range of the radius
for i = 1:length(R)
localaccum = accum(:,:,i);
% compute local maxima matrix
localmax_idx = imregionalmax(localaccum);
localmax = localaccum.*localmax_idx;
localmax(localmax<thres)=0... |
function c =fastexp(a,b,n)
expon=b;
c=ones(size(a));
fact=a;
while(expon>0)
if(mod(expon,2)==1)
c=mod(c.*fact,n);
end
expon=floor(expon/2);
fact=mod(fact.*fact,n);
end
end |
% draw different batch in different color
%
% INPUT:
% iscore -- PCA score matrix,
% ibatch -- batch labels, column vectors. assume two batches only
% itumor -- tumor labels, column vectors. 1/0
%
% OUTPUT:
% none;
function h = draw_batch_two(iscore,ibatch,itumor)
first_batch_id = ibatch(1);
figure;
hold on;
... |
clear all; close all; clc;
% Calculate parameters of LM317
% Given
R1 = 240;
Vref = 1.25;
% Wanted
Vo = 5;
%% Calculation
R2 = R1*((Vo/Vref - 1)) |
%MEDIAN_KMEANS_INF performs local median filtering only in pixels labeled
%as Inf, in each iteration the local median is calculated only with
%values from the same cluster K as the center pixel
function D=Median_Kmeans_Inf(ddpp,p,L)
ddpp(ddpp==0 | isnan(ddpp))=-Inf;
ddpp = padarray(ddpp,[ceil(3*p/2) ceil(3*p/2)],'... |
%% --------
% QC_01_09_CrossSections(MeasCat)
% Displays sum of all sections with predefined parameters
% Input: MeasCat - Measured catalogue
function QC_01_09b_CrossSectionsAll(MeasCat, InLineDistance, SelectionDepth, Limits, varargin)
close all
if ~isnumeric(MeasCat)
error('Load catagoue in the correct forma... |
% vim: set nospell nowrap textwidth=0 wrapmargin=0 formatoptions-=t:
function [overall_XZ_residual_vector, flag, new_data] = batchChemReactorModel_IDA(t,XZ,XZp,ida_user_data_struct) % x_tot contains both x (differential states), z (algebraic variables) and derivates of states
% This function aims to return the resi... |
% Movie
N_expand = 29;
n = (1:N_expand)';
a = 1/(sqrt(2)*pi).*(1./(n./2-1).*sin((n./2-1)*pi)-1./(n./2+1).*sin((n./2+1)*pi));
a(2) = 1/sqrt(2);
for k = 4:2:N_expand-1
a(k)= 0;
end
h = 6.636e-34; % [m^2*kg/s)]
mass = 9.11e-31; % [kg]
L = 1e-10; % [m]
N_frame = 100;
x = 0:0.01:1;
omega = h/(2*pi)*pi^2*n... |
function [start, stop] = NavioTrigger(data)
temp = data{:,51};
ind = 1:length(temp);
trigger = ind(temp > 50);
start = min(trigger);
stop = max(trigger);
end |
%% Add the approprate folders to the path
%Path of the SOSpikingModel repository
repopath = '/Users/dlevenstein/Project Repos/SOSpikingModel';
%repopath = '/Users/jonathangornet/Documents/GitHub/SOSpikingModel';
addpath(genpath(repopath))
figfolder = [repopath,'/Figures'];
%% Example Neuron Properties
clear all
%... |
aa=[];bb=[];
figure,
for j=1:6
for i=1:64
aa(j,i,:)=Fp{1,i}{4}(:,j);
bb(j,i,:)=Fp{5,i}{4}(:,j);
cc(j,i,:)=Fp{10,i}{4}(:,j);
end
subplot(2,3,j),hold on, if j<6; title(['period ' num2str(j)]); end;
plot(squeeze(mean(aa(j,:,:),2)),'b'),
plot(squeeze(mean(bb(j,:,:),2)),'r'),
plot(squeeze(mean(cc(j,:,:)... |
function [resX , resA] = Batch_CoefROMP(D , X , Gamma , G , param)
% Run Matching Pursuit
%
% Inputs :
% D : dictionary (normalized columns)
% X : set of vectors to run on (each column is one signal)
% Gamma : set of initial coefficients (each column corresponds to a signal)
% param : stopping condition, conta... |
De onderstaande code laat een figure zien met 2
horizontale subplots.
======= Code =======
n = 10;
t = -n:0.1:n;
Y1 = t.^2;
subplot(2,1,1);
plot(Y1);
subplot(2,1,2);
plot(t,Y1);
======= Code ======= |
function [newPoint] = Rotate(oldPoint, rotStep)
xRot = [1 0 0;0 cos(rotStep(1)) -sin(rotStep(1));0 sin(rotStep(1)) cos(rotStep(1))]; %rotation around x axis
yRot = [cos(rotStep(2)) 0 sin(rotStep(2));0 1 0;-sin(rotStep(2)) 0 cos(rotStep(2))]; %rotation around y axis
zRot = [cos(rotStep(3)) -sin(rotStep(3... |
function d = split_operators(model,model_data)
d=model_data;
mu = model.get_mu(model);
epsilon = model.base_model.varepsilon;
model.decomp_mode = 1;
[A,r] = model.operators(model,model_data);
gamma_dofs1 = [1;model_data.gamma_dofs{2}];
gamma_dofs2 = model_data.gamma_dofs{1};
Lgamma = model_data.gamma_inner_product... |
function [theta0,theta1] = gradient_descent(training_set,learn_rate,theta0_curr,theta1_curr)
m = size(training_set,1);
% loop over training set
for i = 1:m
x = training_set(i,1);
y = training_set(i,2);
% pick one x,y pair and calculate thetas
theta0_step = theta0_curr - learn_rate * (theta0_curr ... |
%Composite Rigid Body Algorithm for calculating the Joint-space inertia
%matrix
function M = MassMatrix_CompositeRigidBody(RobotLinks,RobotParam,q)
NB = RobotParam.NB;
n = RobotParam.n;
M = zeros(n,n);
%initiate matrices
i_X_pi = zeros(6,6,NB); pi_X_i = i_X_pi; pi_Xdual_i = i_X_pi; Si = ... |
function []= spaceaxisX2CB;
%spaceaxisX2CB: button-down callback function for VAR space axis
%in spacePicker
global GUI;
spaceaxes = gcbo;
point1 = get(gca,'CurrentPoint'); %drag-select point
finalRect = rbbox;
point2 = get(gca,'CurrentPoint');
point1 = point1(1,1:2); ... |
clc,clear all
%初始化车的参数
Xo=[0 0];%起点位置
k=15;%计算引力需要的增益系数
K=0;%初始化
m=16;%计算斥力的增益系数,都是自己设定的。
Po=15;%障碍影响距离,当障碍和车的距离大于这个距离时,斥力为0,即不受该障碍的影响。也是自己设定。
%d_goal = 80;%引力场影响距离的一个阈值,这里设置一个引力场的阈值是为了防止当车辆距离目标点较远时引力过大,导致车辆撞上障碍物
d_goal = 50;%引力场影响距离的一个阈值,这里设置一个引力场的阈值是为了防止当车辆距离目标点较远时引力过大,导致车辆撞上障碍物
b_goal = 15;%克服目标点振荡
n=15;%障碍个数
a=4;%... |
function [xOut] = propNoisySig(X,s,W,noise,T)
% Computes the propagation of a network over T timesteps
if size(noise,3)~=T
disp('Temporal dims mismatch in propNoisySig');
end
M = size(X,1);
N= size(X,2);
xOut = zeros(M,N,T);
prop1=@pNS1T;
xOut(:,:,1)=X;
for t =2:T
xOut(:,:,t)=prop1(xOut(:,:,t-1),s,W,noise(... |
function [ f2 ] = F2( P, T, R, b , v, a )
%
tc = 647;
pc = 221;
UD = -470000;
ac = (0.42748 .* R .* R .* tc ) ./ pc;
f = @(t) (b .* UD - 2 .* b .* R .* t) ./ (t .* t .* log((v+b)./v));
term1 = gquad(f, 0,tc, 4);
term2 = gquad(f, 0, T, 4);
f2 = (ac - term1 + term2 ) .* T - a ;
end
|
function [ DataSet,Num ] = Step1_InputAndDataSetPreperation(path,Width,Height,Factor)
DataSet=[];
Num=[];
close('all');
VidObject = VideoReader(path);
VidObject.currentTime=0.0;%56
while hasFrame(VidObject)
frame = readFrame(VidObject);
[T, BB]=FaceDetectionVJ(frame);
if T > 0
Index=1;
while... |
%TEST_dynamics_ss.m
%
% This script tests the single stance dynamics
clc; clear;
%%%% Parameters %%%%
p.g = 9.81; % acceleration due to gravity
p.l = 0.96; % leg length (hip joint to foot joint)
p.d = 0.14; % distance between foot joint and virtual center of foot
p.r = 0.2; % radius of circular arc on foot
p.c = 0.15;... |
clc; clear all; close all;
n=0:100;
x=cos(pi*n/4);
k=-300:300;
w=(pi/100)*k;
X=x*(exp(-j*pi/100)).^(n'*k);
magX=abs(X);
figure;
subplot(2,1,1);
stem(n,x);
axis([0 100 -1.5 1.5]);
xlabel('n');
ylabel('x');
title('SINUSOIDAL SIGNAL X(n)');
subplot(2,1,2);
plot(w/pi,magX);
xlabel('FREQUENCY IN pi UNIT');
ylabel('--MAGNITU... |
function [Df, Db, Ifg, Ibg, alpha] = layered_decomposition(I1, D1, sigma_depth, errosion_depth, errosion_fg, errosion_bg)
matting_radius = 1;
matting_sigma = 50;
matting_epsilon = 1e-4;
matting_lambda = 0.1;
depth_thr0 = 1;
depth_thr1 = 2;
[h, w] = size(D1);
HW = h * w;
D = D1;
D(isnan(D)) = 0;
D_hat = recursive_ga... |
function [x, P, weight, J] = CorrMapPrun(map, para)
% 5G mmWave Positioning and Mapping
% (c) Hyowon Kim, 2019 (Ph.D. student at Hanyang Univerisy, Seoul, South Korea, emai: khw870511@hanyang.ac.kr)
% Usage: this code generates pruned and merged map
% After the purning and merging step is performed, to... |
datcom=readtable('datatable.csv')
cm=readtable('cm.csv')
ax1=subplot(3,1,1)
plot(ax1,cm.Var1,cm.cm0,'LineWidth',2)
hold on
plot(ax1,datcom.alpha,datcom.cm0,'LineWidth',2,'Color','r','LineStyle','--')
ylabel(ax1,'C_{m_{0}}')
hold off
leg=legend('estimated value','actual value','Orientation','Horizontal','Position','Nor... |
% exm11_frequency_response_ezplot.m
% 例11,离散系统频响特性,FIR系统表示方法2
% 北京邮电大学,尹霄丽
% 2018年12月
close all;
syms n z;
N=8;
X=1/N;
for n=1:N
X=X+power(z,-n)/N;
XX=subs(X,'z','exp(i*w)');
h=ezplot(abs(XX));
set(h,'linewidth',2)
pause(0.1);
end
|
%% Correct and Smooth initial displacements
function U0 = Init(u,v,Phi,x,y,index)
% in inpaint_nans part, I use Spring Model for u and v initial guesses
uInit = u; vInit = v;
% threshod = 0.5;
% [row, col] = find(Phi>2*(1-threshod));
% uInit(row,col) = NaN; vInit(row,col) = NaN;
%
% uInit = inpaint_nans(uInit,4);
% ... |
a = readtable('../../data/temp/Figure2/output2.txt');
tss = zeros(285,21);
for i = 1:285
b = table2array(a(:,3+(i-1)*3));
tss(i,:) = b';
end;
mtss = mean(tss)';
mm = max(mtss)/min(mtss);
index_tss = zeros(285,2);
for i = 1:285
b= corrcoef(tss(i,:),mtss);
index_tss(i,1) = b(1,2);
if(min(tss(i,:))=... |
function [Potential, it, af] = CalcPotential(r, z, Lr, Lz, S, V, w, epsilon)
% definition of parameters:
% r: vector of discretization in the radial direction
% z: vector of discretization in the longitudinal direction
% Lr: boundary of the computational domain in the radial direction
% Lz: boundary of the com... |
function [ Angle ] = Wrapped_Normal( theta, delta_t, sigma )
Sig = sigma * sqrt(delta_t);
Angle = normrnd(0, Sig);
while (Angle > pi() || Angle <= -pi())
Angle = normrnd(0, Sig);
end
Angle = Angle + theta;
while (Angle > pi())
Angle = Angle-2*pi();
end
while (Angle <= -pi())
Angle = Angle+2*pi();... |
%% Declaration of Authoriship
% This code was written by Jason K. George
% for the purpose of his final year project at Stellenbosch University
% in partial completion for the subject Project (E) 448
%% Code
clc
close all;
clear all;
baseName = 'Jason/ALL00';
Nscan = 1000;
th_scan_deg = linspace(-60,60,Nscan);
degree... |
%This code will be for the first part of the comodulation binding
%experiment collecting only behavioral data on 12 conditions
clear all; close all hidden; clc; %#ok<CLALL>
path = '../CommonExperiment';
p = genpath(path);
addpath(p); %add path to commonly used functions
addpath('Stim_Dev')
subj = input('Please subject ... |
function raiz = integNumericaSimpson38 (LeM, xl, xu, npontos, funcao)
% LeM = Informa se o algoritimo vai lê uma arquivo (MATRIX com as dimensões x)
% 0 = Faz Leitura do arquivo
% xs = mat(:,1);
% 1 = Não Faz Leitura do arquivo e os parâmtros são obrigatorios
% x1 = Ponto Inicial
% xu = Pont... |
%% Cell division with random segregation of mitochondria
function s = cell_division(S)
n_wt=S(1,:); %%% Number of wildtype
n_mut=S(2,:); %%% Number of mutants
s=zeros(2,numel(S));
M1 = sum(n_mut); %%% Total number of wildtypes
W1 = sum(n_wt); ... |
function [tone,thresh] = calibrate_stim
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Computes an individual calibration curve for an acoustic startle stimulus
% based on repetitive exposure to stimuli of different amplitudes and
% subsequent subjective evaluation on a scale from 0 to 10... |
function show_trials_tight(t, datas, n_col, fig_title, colorbar_title, overlap_data, subject_names)
if nargin < 6
overlap_data = [];
end
n_subjects = length(datas);
n_rows = ceil(n_subjects/n_col);
if nargin < 7
subject_names = 1:n_subjects;
end
if n_col > 1
gap = 0.05;
else
gap = 0;
end
ha = tigh... |
function lds_calib_intraural()
% lds calib intraural (Knowles in Owl Ears)
global CALIB_PDR H TDT KNOWLES
% SCREEN DIMENSIONS IN PIXELS
screen = get(0,'ScreenSize'); % screen = [left bottom width height]
left = screen(1);
bottom = screen(2);
width = screen(3)-screen(1);
height = screen(4)-screen(2);
% CREATE NEW FIG... |
a=newfis('AC');
a=addvar(a,'input','temperature',[0 100]);
a=addmf(a,'input',1,'Cold','trapmf', [-5 0 5 10]);
a=addmf(a,'input',1,'Cool','trapmf', [7 13 20 25]);
a=addmf(a,'input',1,'Hot','trapmf', [22 30 35 40]);
a=addmf(a,'input',1,'VH','trapmf', [37 40 50 90]);
a=addvar(a,'output','% opening', [0 100]);
a=add... |
function [h,g] = fun2(x);
h = -x(1)^2 + x(2)^2;
g = -x(1) - x(2)^2 + 2;
|
dat=csvread('../Result/new_records.csv');
I=find(dat>100);
plot(I) |
function myPool = specify_num_workers(w)
% input: w num of workers
% Note: If no input, the program will detect the num of processors defined
% by PBS file as w or use default number 4.
if(nargin==0||isempty(w))
if isempty(getenv('PBS_NP'))
w = 4;
else
w = str2double(getenv('PBS_NP'));
en... |
load dictionary.mat
load grams3.mat
tmpDict = dictionary(1:1500);
L = BuildMat2(tmpDict, grams);
L = BuildLmat2(tmpDict, grams);
LLt0 = LLt;
LLt0(1:n+1:n*n)=0;
rowSets0 = SetBuilder2(LLt0, 30);
card0 = cellfun('length', rowSets0);
max(card0)
LLt = L * L';
LLt0 = LLt;
LLt0(1:n+1:n*n)=0;
rowSets0 = SetBuilder2(LLt0, 30);... |
function [h] = reconstructPath(calcGPS,truthTable,trainedTable)
latC(:) = calcGPS(:,1); longC(:) = calcGPS(:,2);
latT(:) = truthTable(:,3); longT(:) = truthTable(:,4);
latTrain(:) = trainedTable(:,3); longTrain(:) = trainedTable(:,4);
[utmxC,utmyC,utmzone] = deg2utm(latC,longC);
[utmxT,utmyT,utmzone] = deg2utm... |
function [x2,in2,f2,z2,c2,o2,y2,output]=LSTM_step_ff1(input_x11,input_c0,input_xC,Weight,T)
if(size(input_x11,2)==size(input_xC,2))%编码,input_c0为0,input_xC为输入
inputX0=input_xC;
w_k=Weight{end}.w_k;
b_k=Weight{end}.b_k;
for t=1:T
inputX=inputX0(t,:);
for lay_i=1... |
%% Stelling 16
%
% De EN-operator (AND-operator) geeft een 'true' terug als
% de operands allebei 'false' zijn.
%
Antwoord = NaN; % vul hier het juiste antwoord in 1 (WAAR) of 0 (ONWAAR)
|
close all
x = 1:0.1:70;
sigma11 = 3.5;
sigma21 = 2.5;
mu11 = 20;
mu21 = 50;
w11 = (1./(sigma11*sigma11))./((1./(sigma11*sigma11))+(1./(sigma21*sigma21)));
w21 = (1./(sigma21*sigma21))./((1./(sigma11*sigma11))+(1./(sigma21*sigma21)));
mu31 = mu11*w11+mu21*w21;
w31 = ((1./(sigma11*sigma11))+(1./(sigma21... |
function Fs_toe1_d = Fs_toe1_d(in1,th,k,cmax,dmax,us,ud)
%FS_TOE1_D
% FS_TOE1_D = FS_TOE1_D(IN1,TH,K,CMAX,DMAX,US,UD)
% This function was generated by the Symbolic Math Toolbox version 8.4.
% 13-Jun-2020 13:03:29
q1 = in1(:,1);
q2 = in1(:,2);
q3 = in1(:,3);
q4 = in1(:,4);
q5 = in1(:,5);
q6 = in1(:,6);
qd1 = ... |
lat1 = 27.5;
lat2 = 47.5;
lon1 = 25;
lon2 = 30;
boxarea = areaquad(lat1,lon1,lat2,lon2) |
function [energy_in_each_point, point_passed, energy_in_each_point_real] = one_link(transmit, recieve)
point_passed = [];
difference_x = abs(transmit(1) - recieve(1));
difference_y = abs(transmit(2) - recieve(2));
difference_z = abs(transmit(3) - recieve(3));
[~, index] = max([difference_x diff... |
clear all
close all
addpath('/import/pendragon1/snert/Tiphaine/GLINTSouth_DataAnalysis-/DataManipulation/');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% swapChs23 = false; %Set to true to swap the null and anti-null channel
%
% histAxes = [-0.2, 1.2];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
% o history
% Daniel Klawitter
% created 05-12-2009 - 16:45
%
% o summary
% creates G1 spline on the sphere
% input: o
% output: o nice picture
% todo: o
%
% literature: Gfrerrer - On the construction of rational curves on
% hyperquadrics
% Gfrerrer - the kinematic mapping - a tool... |
function [in] = triIntersect(Faces, O)
%% Triangle Intersection
%Moller Trombore Implementation of ray casting. See their paper.
in =0;
buffer = 1e5;
A = Faces.A;
ECross = Faces.ECross;
E1 = Faces.E1;
E2 = Faces.E2;
T = O-A;
numFaces = size(A);
D = ones(numFaces)*-1;... |
function [ alfa, v ] = Formiranje_Trening_para( Udaljenost_Bloka, Udaljenost_Suta )
%FORMIRANJE_TRENING_PARA, odnosno, na osnovu poznatih velicina "Udaljenost
%kosarkasa od bloka", te, "Udaljenost kosarkasa od kosa", odredjujemo
%potreban ugao, i brzinu izbacaja suta, za trening par!
g = 9.81;
%alfa = atan(0.28/(Udalj... |
function [f, distribution_data] = plot_cdf(f, file_path_resolver, file_name_resolver, display_name_resolver, params, plot_properties, reference_params)
if ~exist('plot_properties','var') || isempty(plot_properties)
plot_properties = get_default_plot_properties();
end
for iterator=1:length(params)
param_array ... |
%obtaining plottable values
rrho = [0.01:0.01:1.95];
for i = 1:length(rrho)
g = rrho(i);
[f1d rd qd epd nzd nyd f2d] = fixedvalues(g);
f1f(i) = f1d;
f2f(i) = f2d;
rdf(i) = rd;
qdf(i) = qd;
epdf(i) = epd;
nzdf(i) = nzd;
nydf(i) = nyd;
end |
% analyze_wd_folder.m
% [all_data] = analyze_wd_folder(subjfile)
%
% Purpose: Return % cor for list 1 & 2 for each subject in subjfile.
%
% Input: subjfile (string)
%
% Output: all_data (cell), a collection of %cor for each subject
function [all_data] = analyze_wd_folder(subjfile)
curpath = mfilename('fullp... |
function rhs2d = matEvaluate2dBoundaryStressRHS(obj, mesh3d, fphys, rhs2d)
%> @brief Function used to calculate the contribution to the external mode due to the bottom stress and surface wind stress
%>
%> More detailed description.
%>
%> @param mesh3d The three dimensional mesh object
%> @param fphys The three dimensio... |
function Step1_main(pipe_config_in, t1_1out, pipe_config_out)
% Automatically align an T1-weighted image to AC-PC plane
%
% INPUTS:
% config.t1 - full path to nifti file that needs to be aligned
% config.coords - [0,0,0; 0,-16,0; 0,-8,40]
%
% Copyright 2017 Franco Pestilli, Indiana University, frakkopesto@gmail.com
... |
function clean_stop(mea, stg)
mea.StopDacq();
mea.Disconnect();
fclose(stg);
delete(stg);
end |
function cubeCutout_Synapsin647(outputFileName)
% Only used for matlab testing, not LONI
server = 'openconnecto.me';
token = 'collman15';
channel = 'Synapsin647';
resolution = 0;
xStart = 0;
xStop = 6305;
xSpan = xStop - xStart;
yStart = 0;
yStop = 4517;
ySpan = yStop - yStart;
zStart = 31;
zStop = 58;
zSpan = 27;... |
clear;
imp = importdata('../../data/gold/taps_accel.csv',',',1);
names = imp.textdata(2:end,1);
all_data = [grp2idx(names) imp.data(:,1:end)];
pins = unique(all_data(:,2));
num_folds = 4;
% print the date and time
datestr(clock)
for pin = pins'
pin_data = all_data(all_data(:,2) == pin,:);
inames = unique(pin_d... |
function [sigma] = ComputeCovMatrix(data)
%ComputeCovMatrix Summary of this function goes here
% Detailed explanation goes here
n_data = size(data,2);
mu = mean(data,2);
data = data - repmat(mu,[1,n_data]);
if size(data, 1)<size(data, 2)
sigma = data*(data');
else
sigma = (data'*data);
en... |
function rx = Rxd(q)
rx = [ 0, 0, 0, 0
0, -sin(phi), cos(phi), 0
0, -cos(phi), -sin(phi), 0
0, 0, 0, 0];
end
|
% harness.m
% For more information search for "README:" in harness.cpp.
clear all;
close all;
% Read data from file
%load('rx_data_23.mat'
load('params.mat')
%load('dData.mat')
dataT = data;
nr_OFDM_symbols = 147;
N_samps=49199;
fid1=fopen('received0.dat','r');
x_rec=fread(fid1, 2*N_samps,'short');
fclose(fid1);
r... |
function [degf, degc] = tempconverter( degree, scale )
% [ DEGF, DEGC] = TEMPCONVERTER( DEGREE, SCALE )
% Input: A value representing a temperature and a letter representing the
% scale you are using. Use c for Celsius and f for Fahrenheit.
% Output: The temperature in both Celsius and Farenheit
if( scal... |
function [ best_param, perform_mat] = TuneParam_MTMLa...
( obj_func_str, obj_func_opts, param_set, eval_func_str, higher_better,X,Y,vadratio,XR)
%% INPUT
% data: original data
% obj_func_str: 1-parameter optimization algorithms
% param_set: the set of the parameter. array
% eval_func_str: evaluation ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.