text stringlengths 8 6.12M |
|---|
A = [x x.^0]
a = A\y
r = A*a-y |
function output = serial2parallel(input,noOfStreams)
% This function assumes that length of input is a multiple of
% noOfStreams
output = reshape(input,noOfStreams,(length(input)/noOfStreams));
end |
function xStar = legRadius(beta,gamma,kC)
xStar = kC.l2+kC.l3*cos(beta)+kC.l4*cos(kC.zeta)+kC.l5*cos(kC.zeta+gamma)-kC.l7;
end |
classdef rlFeatureSet_ioc < rlFeatureSet % < rlModel
properties
% features
time = [];
q = []; % joint angle
dq = [];
ddq = [];
dddq = [];
x = []; % joint position
dx = [];
ddx = [];
dddx = [];
tau = []; % jo... |
Re = Qinf*c/nu; % Reynolds number.
AoA_max = abs(atan2(pi*f*A_c*c,Qinf)...
+ alpha_max)*180/pi; % Maximum angle of attack, degrees.
% Determine time-step
if f == 0
delT = 1/0.001/Nstep; % s
else
delT = 1/f/Nstep; % s
end
% Free-stream velocity
Uinf = Qinf*cos(alpha);
Winf =... |
%% Color + GIST accuracies
load '../../matfiles/colorgist.mat';
addpath('../../utils/libsvm-mat-3.0-1');
addpath('../');
cd ..;
features = colorgist;
acc=zeros(14,18);
p=0.5;
i=1;
for log2c = 5:9,
for log2g = -4:3,
disp(log2c);
disp(log2g);
generateModels(features,log2c,log2g,p);
ans=ca... |
function [] = generate_pitot_eps(basedir, do_parallel, time_limits, spec_length, frange, save_spec, accfilter)
% [] = generate_pitot_eps(basedir, do_parallel, [time_limits, spec_length, frange, save_spec, accfilter])
%
% This function drives the pitot epsilon processing
%
%
% INPUT
% basedir ... |
classdef dumb_exported < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
UIAxes matlab.ui.control.UIAxes
usr_poly
btn matlab.ui.control.Button
chunkie_handle
chnkr
cpara... |
close all; clear all; clc
tic
% Training and testing...640 control and 640 osteoporotic images for
% training, and 18 control and 18 osteoporotic images for testing..
% Training iterations for adaboost: 50
% No. of trees for Random Forest ensemble method: 30
% The SVM kernel used is linear - fitcsvm.
% Validatio... |
function [conf] = evaluateRecognitionSystem()
% Evaluates the recognition system for all test-images and returns the confusion matrix
load('vision.mat');
load('../data/traintest.mat');
% TODO Implement your code here
end |
function [z,ptr]=de_z0_r0(bin,len,ptr)
fg=char(bin(ptr:ptr+2)+48); ptr=ptr+3;
switch fg
case '000'
z=bin(ptr:ptr+len-1); ptr=ptr+len;
case '001'
[z,ptr]=decode_block3(bin,len,ptr);
case '010'
[z,ptr]=decode_block5(bin,len,ptr);
case '011'
lastBit=bin(ptr); ptr=ptr+1;
[runs,pt... |
function parsave(fileName, varargin)
assert(mod(length(varargin), 2) == 0, 'Improper number of arguments...');
for i = 1:length(varargin)/2,
varName = varargin{2*i-1};
varVal = varargin{2*i};
assert(isstr(varName), 'Variable name not string');
eval(sprintf('dt.%s = varVal;', varName));
end
save(fileName, '-... |
% *** Implementation of the calCalibrationError function *****
% Function: Test the calbration error of Calibration Results (rotm_P_PTip_I)
% Input: test_data,consist of eul_P_B_ER,eul_P_B_EL and eul_P_I_ITip.
% eul_P_B_ER, The position of the end flange of right hand in base frame % 注意:这里是四元数表示,需要转换成转换矩阵
% ... |
% n = 100;
% As = cell(100,1);
% As{1} = sparse(rand(20,20));
% As{1} = As{1} + (As{1})';
% rhses = cell(100,1);
% rhses{1} = rand(20,1);
% for i = 2:100
% As{i} = sparse(rand(20,20));
% As{i} = As{i} + (As{i})';
% rhses{i} = rand(20,1);
% end
%
% pardiso_info = [];
% bSolverInitialized = 0;
% for i = 1:n... |
function a = polya_moment_match(data)
% DATA is a matrix of count vectors (rows)
sdata = row_sum(data);
p = data ./ repmat(sdata+eps,1,cols(data));
a = dirichlet_moment_match(p);
|
niter= 16;
[Q_matlab, R_matlab] = cordicqr(A,niter);
R_simulation = R_simulation_TS.data;
R_sim=R_simulation(3:6,:);
QT_B_mat = Q_matlab' * B;
QT_B_sim = QT_B.data;
QT_B_sim = QT_B_sim(308,:)';
error_matlab = Q_matlab*R_matlab - A;
|
function value = subsref(sys,index)
%SUBSREF Subscript reference into a POLYSYS model.
switch index(1).type
case '.'
value = sys.(index(1).subs);
case '()'
switch length(index(1).subs)
case 1
error('POLYSYS:subsref:singleIndex', ...
'Single ... |
function Y = predictLRMultiClass(X, w)
res = [];
X = [X ones(size(X,1),1)];
for d = 1:size(w,2)
res(:,d) = (X*w(:,d));
end
[~,Y] = max(res,[],2);
end |
%[s_recon_DWI2] reconstructs IMG with NAV phase correction.
%
%
% See s_recon_DWI2_pct, test_s_recon_time
%
% Last modified
% 2012.01.20
% Reconstruction routine is modified for faster reconstruction. By using
% the routine, recon time reduced by half. This routine is from
% [test_s_recon_DWI__precalc.... |
function makeTexture_OpticFlowG
%stimuli: this is the set described in Graziano et al 1994
% logic:
% - each dot has a limited lifetime (doesn't work otherwise)
% - during the lifetime, each dot moves in a constant direction at a
% constant speed (this way accelaration and path curvature cannot be used
% to distingui... |
function NNIA(Global)
% <algorithm> <H-N>
% Multiobjective Immune Algorithm with Nondominated Neighbor-Based
% Selection
% nA --- 20 --- Size of active population
% nC --- 100 --- Size of clone population
%--------------------------------------------------------------------------
% The copyright of the PlatEMO belong... |
function hFig1 = playVideo(videoFile)
% hFig1 返回用于删除的figure句柄
% videoFile = 'H:\4-mymovies\own\外骨骼渲染.mp4';
video=vision.VideoFileReader(videoFile);
% hFig1 = figure(1
hFig1=figure('name','video','position',[0 0 1200 900]);
hPanel = uipanel('parent',hFig1,'Position',[0 0 1 1],'Units','No... |
clear
recdate='Nov_10_11';
cellnum='A';
trials_control=7;
trials_propofol=0;
conc_propofol='0';
start_current=-55; % Starting current in pA
finish_current=20; % Finishing current in pA
increments=20;
delay=2; % Delay in seconds
pulse_duration=1;
pause_duration=1;
sample_rate=10000; % Sample rate in Hz... |
% 5-D array of size 10x10x10x10x10
A=randn([15,15,21,21,300]);
show(A) % visualize using 4-D tiles
%show(A,'3d') % visualize using 3-D tiles
%scroll(A) % visualize using 2-D tiles
% complex-valued array
% (requires FileExchange submission 20292 "hsl2rgb and rgb2hsl conversion")
%C=randn([10,10,10,10,10]).*exp(2*... |
function v = PL_isparallel(L1, L2)
% check whether the two plucker lines are parallel
v = norm( cross(L1(4:6), L2(4:6)) ) < 10*eps;
end |
function [RA , DE , NOS , NOSI, ME] = Img2RADE(Image_Pro,app,idd)
close all
addpath ..\Photo_Determination\
load(strcat(app.sao_dir.Value,'\SAODATA.mat'));
FOVm = Image_Pro.fov;
cropsize = 40;
intensity = 4;
I = imread(Imag... |
%# load data as in Problem 1a
source problem1a.m;
%# run regression and get residuals
beta_hat = inv(X.'*X)*X.'*Y;
e_hat = Y - X*beta_hat;
%# calculate homoskedastic variance estimator
V_hat = e_hat.'*e_hat/(rows(X) - size(X, 2))*inv(X.'*X);
%# calculate White
V_w = inv((X.'*X))*X.'*diag(e_hat)*X*inv(X.'*X);
%# ca... |
function [names, features] = cgitaFeatures(I, M, S)
% features is a 1xN cell array of scalars
% names is a 1xN cell array of strings
% Arguments are 3D image I and 3D contigous mask M.
% Assumes M is binary, I has integer values.
%--- Check input
if nargin == 2
S = getfield(loadSettings("cgita",[]), "cgit... |
function DirList=GetExportModuleList(DataDir)
DirList=GetDirList(DataDir);
DirList=FilterDirList(DirList, DataDir);
function FinalDirList=FilterDirList(DirList, DataDir)
FinalDirList=[];
if isempty(DirList)
return;
end
for i=1:length(DirList)
DirName=DirList{i};
CurrentDir=[DataDir... |
%%
clear all;
TimeStamps(2) = [];
%%
TimeStamps = [TimeStamps 336]
TimeStamps(1) = TimeStamps(3);
TimeStamps(2) = TimeStamps(22);
TimeStamps(2:17) = [];
%%
n = 'HMM_G4.5_lumin1.mat';
save(n,'Spikes','TimeStamps','a_data','Infos') |
close all;
M = importdata('results.csv');
plot(M(:,3),M(:,4),'.') |
close all;clear all;clc;
load hall hall_gray;
load JpegCoeff QTAB;
[m,n] = size(hall_gray);
img = [hall_gray,repmat(hall_gray(:,n),1,mod(-n,8))];
img = [img;repmat(img(m,:),mod(-m,8),1)];
M = m+mod(-m,8);
N = n+mod(-n,8);
M = round(M/8);
N = round(N/8);
blocks = zeros(8,8*M*N);
for k = 1:M
blocks(:,8*N*(k-1)+1:8*N... |
%Grafica los parámetros en el tiempo y ordenado por correlación. Cada punto
%representa un hamster y cada franja una marca temporal.
clc, clear all ,close all;
%% Parámetros Iniciales.
Grupo='C';%Grupo de Longitudes
numFechas=1:12;%Rango de Fechas
T=1;%Tipo de Leishmaniasis
E=1;%Estado - Criterio de curación
linux=0;... |
s = [1,1,2,2,3,4,5,6];
t = [2,3,5,4,7,6,6,7];
weights = [50,50,20,10,50,20,10,20];
G = digraph(s,t,weights);
T = bfsearch(G,1,'allevents');
plot(G); |
%
% Compare experimental stress-strain data with MTS model
%
function plotTrueSigEps
marker = ['o';'p';'v';'s';'d';'^';'h';'<';'x';'>';'+';'*'];
%color = [[0.15 0.3 0.7];[0.1 0.8 0.3];[0.75 0.25 1.0];...
% [0.25 0.75 1.0];[1.0 0.75 0.25]];
color = [[0.90 0.10 0.10];[0.10 0.90 0.10];[0.10 0.10 0.90];...... |
%% Limpar tela, console e variáveis
clc;
clear all;
close all;
%% Declaração sistema e modelo de referência
t = linspace(0,2.5,2500);
u1 = [zeros(250,1); ones(500,1); zeros(1250,1); ones(500,1)];
u2 = [zeros(1000,1); ones(500,1); zeros(500,1); ones(500,1)];
s = tf('s');
G11 = ((2*s+1)/(s^2 + 2*s +1));
G12 = 1/(s^2 + 2... |
clear all;
clc;
format compact;
%Initial Paramters/Varaiables
R=4.172
km=0.00775
Umax=18
g=9.81
mgl=0.12597;
mbg=mgl
d11=0.0014636
d12=0.0000076
d21=d12
d22=d21
J= (d11*d22-d12*d21)/d12
D=[d11 d12;d21 d22]
Di=inv(D);
di11=Di(1,1)
di12=Di(1,2)
di21=Di(2,1)
di22=Di(2,2)
% State Space Equation Param... |
function BNBGUICB(action,file);
% BNBGUICB Callback function for BNBGUI.
% Do not run this file from the Matlab prompt.
persistent data;
if nargin<1, help bnbguicb; action=''; end;
switch action
case('init')
data.id='BNBGUI10 BNB18';
data.fun='';
data.x0=[];
data.xstatus=[];
data.xlb=[... |
% Radial average
function [Zr, R] = radialAvg3D(z,m)
% RADIALAVG Radially averaqe any 3D matrix Z into M bins
% radial distances r over grid of z
N = min(size(z));
[X,Y,Z] = meshgrid(-(N-1)/2:(N-1)/2);
r = sqrt(X.^2+Y.^2+Z.^2);
maxbinval = ... |
function energyCrossCorrFigHandles = plotCrossCorr(corrInputClasses, frequencyVector, normalized, visible)
f = frequencyVector;
regularPlot = 0;
normalizedPlot = 0;
corr_limit = corrInputClasses.correlationLimit;
switch normalized
case 0
regularPlot = 1;
R_sp_ = corrInputClasses.energy.SP;
... |
function A = create_regression_matrix(X, order)
% CREATE_REGRESSION_MATRIX Creates a regression matrix of a certain order,
% including all cross-terms.
%
% Inputs:
% - X: state vector, shape (N_states, N)
% - order: order of the polynomial
%
% Outputs:
% - A: regression matrix
%
% M.J. Mollema (adapted from: Jesse Ha... |
function [evalf] = eval_trifunc(xfit, an, bn,M)
% evaluate trigonometric polynomial
evalf = (an(1)+bn(1))/2;
for k = 1:M
evalf = evalf + an(k+1).*cos(k.*xfit)+ bn(k+1).*sin(k.*xfit);
end
end |
function [itrfin] = multisvm( T,C,test )
%Inputs: T=Training Matrix, C=Group, test=Testing matrix
%Outputs: itrfin=Resultant class
itrind=size(test,1);
itrfin=[];
Cb=C;
Tb=T;
for tempind=1:itrind
disp('hello');
tst=test(tempind,:);
C=Cb;
T=Tb;
u=unique(C);
N=size(u,1);
disp(N);... |
%»ñÈ¡ÓïÒôÊý¾Ý
clear;
addpath('f:\matlab\common\voicebox');
addpath('f:\workspace\common\');
data_train = 'E:\TIMIT_wav_8k\train';
dataDir1 = 'E:\TIMIT_wav_8k\train\dr1';
dataDir2 = 'E:\TIMIT_wav_8k\train\dr2';
dataDir3 = 'E:\TIMIT_wav_8k\train\dr3';
dataDir4 = 'E:\TIMIT_wav_8k\train\dr4';
% allfiles = char(fin... |
function boundaryIndices = findBoundariesContainNodes(boundaries,nodes)
boundaryNum = size(boundaries, 1);
boundaryIndices = zeros(boundaryNum, 1);
for i = 1 : boundaryNum
checkResult = setdiff(boundaries(i, 1:2), nodes);
if size(checkResult, 2) == 0
boundaryIndices(i) = 1;
... |
function [c] = cortParc_drive(varargin)
%
% NAME
%
% function [] = cortParc_drive()
%
% ARGUMENTS
% INPUT
%
% OPTIONAL
%
% OUTPUTS
% connect the points of the polygon
%
% DESCRIPTION
%
% 'cortParc_drive' "drives" a cortical parcellation process. It provides
% a convenient entry point to starting and initializing a... |
#
#Funcao que desenha os tanques com as cores escolhidas pelos jogadores
#Autor: Lucas Xavier de Morais
# Jun - 2019
#
function tank (x,y,col)
hold on;
axis([0 1000 0 200]);
rectangle('position',[x,y,10,3],'facecolor',col,'edgecolor',col);
hold off;
endfunction
|
clear;
configsSet;
if (thisRadio == 'C')
fprintf('This system is now running as client.\nIt will receive file from server.\n');
client;
elseif (thisRadio == 'S')
fprintf('This system is now running as server.\nIt will send file/s to client.\n');
server;
else
fprintf('Did not understand wh... |
function get_existing_info
% GET_EXISTING_INFO
%
% Extract names, highway tags, and bounding boxes
% from the files tags.mat, nodes.mat and ways.mat,
% and save them in the more convenient files
% way_names.mat and bboxes.mat
%
% Assumes you have already run (for example) the following
% in the current dire... |
function [deformedIm, XX, YY] = vu2DAdaptiveBasesRegistrationWithRadius(fixedIm,movingIm,XX,YY,varargin)
% vu2DAdaptiveBasesRegistrationWithRadius(...) performs a deformable registration
% between input images
%
% SYNTAX:
% [deformedIm, XX, YY] = vu2DAdaptiveBasesRegistrationWithRadius(fixedIm, movingIm, XX, YY... |
function [ min] = NewtonMultiDim(fun,grad,hess,start )
%NEWTONMULTIDIM Summary of this function goes here
% Detailed explanation goes here
xk = start;
nbiter = 0;
prev = xk*2;
itermax = 20000;
while abs(norm(xk-prev)) >(0.0000000001) && nbiter < itermax
prev = xk;
xk = xk - hess(xk)\grad(xk);
nbiter = nbi... |
function [G,dG] = autoGen_centerOfMass(x,y,th0,th1,dx,dy,dth0,dth1,c)
%AUTOGEN_CENTEROFMASS
% [G,DG] = AUTOGEN_CENTEROFMASS(X,Y,TH0,TH1,DX,DY,DTH0,DTH1,C)
% This function was generated by the Symbolic Math Toolbox version 6.3.
% 30-Jan-2016 13:22:38
t2 = cos(th0);
t3 = cos(th1);
t4 = sin(th0);
t5 = sin(th1);... |
function [a]=single_sample_percep_norm (b,n)
class1 = [1 6; 7 2; 8 9; 9 9; 4 8; 8 5];
class2 = [2 1; 3 3; 2 4; 7 1; 1 3; 5 2];
%class1 = [1 7; 6 3; 7 8; 8 9; 4 5; 7 5];
%class2 = [3 1; 4 3; 2 4; 7 1; 1 3; 4 2];
% data points
s = cat(2, ones(1,6), -1*ones(1,6));
data = [s; cat(2,class1',-class2')];
r = size(data,... |
function b = pointbary(P, T)
% Opis:
% pointbary kartezične koordinate (x, y) točke P pretvori v
% baricentrične koordinate (u, v, w) glede na trikotnik T
%
% Definicija:
% b = pointbary(P, T)
%
% Vhodni podatek:
% P točka dimenzije 2
% T trikotnik v obliki matrike dimenzije 3x2, na podlagi
% ... |
%% Read and plot ASD sun-lollipop experiment data in reflectance mode
% The purpose of this experiment was to measure the diffuse component of
% horizontal spectral irradiance as a fraction of the total horizontal
% spectral irradiance.
%
% This experiment was conducted using a pole with an obscuration on the end
% (... |
function [mu, Sigma] = mixgauss_Mstep(w, Y, YY, YTY, varargin)
% toolbox from Kevin Murphy
[cov_type, tied_cov, clamped_cov, clamped_mean, cov_prior, other] = ...
process_options(varargin,...
'cov_type', 'full', 'tied_cov', 0, 'clamped_cov', [], 'clamped_mean', [], ...
'cov_prior', []);
[Y... |
% Email settings
setpref('Internet','E_mail','o.komarov11@imperial.ac.uk');
setpref('Internet','SMTP_Server','smtp.cc.ic.ac.uk')
setpref('Internet','SMTP_Username','ok1011');
if ~ispref('Internet','SMTP_Password')
pwd = inputdlg('Email pwd');
setpref('Internet','SMTP_Password',pwd{:});
end
props = java.lang.Sys... |
close all;clear all;clc;
addpath('/Users/jasoncjs/Documents/MATLAB/QSM/view3dgui');
addpath('/Users/jasoncjs/Documents/MATLAB/QSM/utils');
addpath('/Users/jasoncjs/Documents/MATLAB/QSM/MEDI_toolbox');
N = [64,64,32];
samples = 100;
n = zeros(samples,3);
n(:,1) = randi([10 20], 1, samples);
n(:,2) = randi([10 20], 1, s... |
%% モデルの特定のラベル値の部品だけを取り出す
%
% showComponent(Clutch96001,100)/1000;
%
% figure, imshow(sum(showComponent(Clutch96001,100),3)/2000,[],'InitialMagnification',300), colormap(bone)
%
%%
function parts=showComponent(model,number)
s_m=size(model);
parts=zeros(s_m(1),s_m(2),s_m(3));
for i =1:s_m(1)
for j = 1:s_m(2)
... |
% Load data
warning off all
close all
clear all
load kernelData.mat
[N,d] = size(X);
% Plotting Code
plot(X,y,'b.');hold on
plot(Xtest,ytest,'g.');
xl = xlim;
yl = ylim;
Xvals = [xl(1):.1:xl(2)]';
pause
% Display result of fitting with polynomial kernel
lambda = 1;
bias = 1;
for m = 0:15
%% Train on X, test on X... |
classdef QMS_TEST < handle
% QMS : Quote Management System
% 包装Quote源,定期更新计算行情以及隐含波动率曲面
%--------------------------------
% 朱江 20160308
properties
% h5quote
% internal quote table
regular_timer_ = []; % 定时器,用于定期计算vol surface
callQuotes_@M2TK ; % call quote 矩阵
... |
function [UtilityGain,collectedDataOriginal] = demo(N,x,y,dgr,radius,xpath,ypath)
N=200; %no of sensors1
L=18000; %path length
rs=10; %speed of mobile sink
T=L/rs; %tour time of mobile sink
t=1; %duration of each time slot
n=T/t; %number of time slots
Rmax=200; %maximum tra... |
readFile = 'Data.xlsx';
sheet = 2;
xlRange = 'A1:C20';
[data,class] = xlsread(readFile,sheet,xlRange); %% use ' ~ ' to ignore
temp = class(1,1);
out=temp{1}
if(out=='Ya')
disp('Yappp');
end |
%% Paweł Antkowiak
clear
close all
clc
%% Dane
n=3;
aab=3;
r=2;
k=2;
x0=0.5;
a=0.6;
% n=5;
% aab=2.8;
% r=2.0;
% k=2;
% x0=0.5;
% a=0.38;
%% Obliczenia
%zakladam xd
xd=0.9003;
xw=0:1e-2:1;
yw=xw;
plot1(xw,yw,1,'r');
yw2=aab.*xw./(1+(aab-1).*xw);
plot(xw,yw2,'r')
a1=r/(r+1);
b1=1/(r+1).... |
%PCA
clc;
close all;
clear;
data = importdata('datasets_HW4/data_homework.mat');
X = data.X;
X1 = data.X_1;
X2 = data.X_2;
C_x = cov(X');
[EV,EW] = eig(C_x);
plot3(X1(1,:),X1(2,:),X1(3,:), 'r+');
hold on
plot3(X2(1,:), X2(2,:), X2(3,:), 'bo');
grid
title('Directions of maximum variance');
xlabel('x')
ylabel('... |
function viewer3D(hObj,callbackdata) % Main function of the display
main = figure;
% Initial area
centralPanelData = uipanel('Parent',main,'Title','Initial Data','FontSize',...
12,'Units','Normalized','Position',[.22 0.1 .77 .85]);
... |
function [eeg,parameters] = preprocess_data(eeg,varargin)
% PREPROCESS_DATA process the data using different techniques(CAR,rereferencing,correction EOG,BSS)
% EEG = PREPROCESS_DATA(EEG). EEG is a structure.
% [...] = PREPROCESS_DATA(..., 'PARAM1',VAL1,'PARAM2',VAL2,...) specifies
% additional parameters and t... |
clear
recdate='Sep_30_11';
cellnum='B';
trials_control=1;
trials_propofol=1;
conc_propofol='100';
resting_potential(recdate,cellnum,trials_control,trials_propofol,conc_propofol) |
function trackletMask = getTrackletMask( imageStack, tracklets )
[rows,cols,T] = size(imageStack);
trackletMask = zeros(size(imageStack));
[~,~,N] = size(tracklets);
for t=1:T
for n=1:N
if (tracklets(t,1,n) ~= 0 && tracklets(t,2,n) ~= 0 && tracklets(t,1,n) > 5 && tracklets(t,1,n) < cols-5 && tracklets... |
function [ x_a ] = cross_abs_jvgr( a, freq, e_s_rel )
%CROSS_ABS_JVGR
% Raleigh Absorption Cross Section for a Spherical Particle
% using JVGR definition
%
% Input: a - particle radius (m)
% freq - frequency (Hz)
% e_s_rel - Permittivity of Scattering medium (relative to e0)
% Output: ... |
% do_bst_epoch_avg.m
% 2015 Dec 20 by Takako Fujioka
% 2016 Mar 6 by Takako Fujioka
%% list all the pairs
pair = {'S01','S02'; % list subj#1 subj#2 in the order of the file
'S03','S04';
'S05','S06';
'S07','S08'; % list subj#1 subj#2 in the order of the file
'S09','S10';
'S11','S12';
'S13','S14... |
function Params = stimdefRAM(EXP)
% stimdefRAM - definition of stimulus and GUI for RAM stimulus paradigm
% P=stimdefRAM(EXP) returns the definition for the RAM (Response Area Modulation)
% stimulus paradigm. The definition P is a GUIpiece that can be rendered
% by GUIpiece/draw. Stimulus definition like stimm... |
function [ Pos_Last2Targets ] = Current_Target( Mode_visual, Pos_Targets, Current )
%Current_Target --> return the positions of the target the user just reached
% and the previous target
if Current == 1
if (strcmp(Mode_visual, 'Horizontal') == 1) || (strcmp(Mode_visual, 'Vertical') == 1)
Pos_Last2Targets(1... |
% "Flecktarn"-inspired three-layered digital camouflage image generation script.
% --
% This function generates and composites a series of layer masks of different colours,
% based on a sum of a wave and ripple function in each layer being greater than a threshold.
% All parameters are randomised in this implement... |
cd ../bnt_master
addpath(genpathKPM('../bnt_master'))
cd ../bnet_scripts_incretin
|
possibleFunctions = [];
edges = 8;
map = 4;
cubeVector = zeros(1,edges);
foundPatterns = [];
placeOnes = randperm(edges,map);
runThisMany = 1000;
for iRun = 1:runThisMany
for i = 1:map
cubeVector(placeOnes(i)) = 1;
end
end |
% script for finding 95% confidence intervals by bootstrap for P-TEFb data
% November 2009
% Bootstrap 95% confidence interval yields us with the information about the range of values that the majority of correlation coefficients rely.
% save with upper and lower intervals, able to be plotted as error bars
% subseq... |
Met de volgende code maak je een functie aan:
======= Code =======
function (output)=naamfunctie[input]
end
======= Code ======= |
function success = uq_PCK_test_arbitrary( level )
% This function tests whether arbitrary polynomials work in PC-Kriging. The
% following tests are carried out:
% - Test 1: Based on truncated input marginals, a PC-Kriging model is
% composed. Then, the resulting meta-model should be based on arbitrary
% polynomia... |
function [img, FOV] = removeOutsideFOV( img, geom, FOV )
% function img = removeOutsideFOV( img, geom )
%
% remove image outside the FOV
%
% Meng Wu
% 2013
x = ( (-(geom.reconSize(1)-1)/2 : (geom.reconSize(1)-1)/2 ) + geom.reconOffset(1) ) * geom.reconSpacing(1);
y = ( (-(geom.reconSize(2)-1)/2 : (geom.reconSize(2)-... |
%% whiskerQueue- queues up different directories for tracking assignments
%pause on
whiskerNumber = '1';
pixDen = '0.033';
startDir = '/media/hireslab/AHHD_009/Data/AH0281/160211/cameraMain';
endDir = '/mnt/Data/Video/AHHD_009/AH0281/160211/';
startItFun(startDir, endDir, pixDen, whiskerNumber)
startDir = '/media... |
%% Stelling 1
%
% Een functie kan meerdere inputs hebben.
%
Antwoord = NaN; % vul hier het juiste antwoord in 1 (WAAR) of 0 (ONWAAR)
|
% ******************* Adaptive Matrix Completion **********************
% Input:
% X : (d x n) original matrix
% m : size of the sampling of column
% Output:
% Xopt : recovery matrix
%
% **********************************************************************
% by Jamie Zemin Zhang
% 07/23/... |
function mapGen(tx_sub,tx_sub_AL,Opt_Rot_RGB, Opt_C_RGB, t_subsampled_RGB, C_RGB, t_subsampled_RGB_AL, C_RGB_AL, RGB4Pts_subsampled, RGB4Pts_AL_subsampled)
%% plot output from our approach
fileCount = 1;
R_opt=rotationmat(Opt_Rot_RGB);
for i = 1 : 1:size(Opt_Rot_RGB,1)
if numel(tx_sub{fileCount}) == 0
% disp 'w... |
%% % Confusion matrix %%%
% Get the errror Trials and make a position matrix that gives information
% about position swaps and misidentified errors...
function errTable = confusionMatrix_SPP(cueType,endo,exo,online,subject) % errTable = confusionMatrix_SPP(cueType,adult,endo,exo)
errTable = table;thisRun =[];
if ... |
function [x0, search_hist]=linesearch_q5(f, XR, params)
if ~exist('params','var')
params.xtol=diff(range(XR))/1e4;
end
if length(XR)==2
xx=linspace(XR(1), XR(2), 10);
else
xx=XR;
end
search_hist.x=[]; search_hist.z=[];
count=0;
while diff(range(xx)) > params.xtol || count==0
count=count+1;
yy=f... |
function B=colmove(A,y)
%y>0,обрфy
%y<0,иорфy
[m,n]=size(A);
if y>0
C=A(1:m-y,:);
D=zeros(y,n);
B=cat(1,D,C);
else if y<0
C=A(abs(y)+1:m,:);
D=zeros(abs(y),n);
B=cat(1,C,D);
end
end
end |
function write_default_header (fid, hdrsize, dformat)
% This function is compatible with Octave version 4.4.1
% We're looking to write a header with the following content:
% HDR_VERSION 1.0
% HDR_SIZE 4096
% TELESCOPE Parkes
% SOURCE J0437-4715
% FREQ 1405
% BW 40 or 80
% TSAMP 0.01... |
function saveConstraint(obj, constr, export_path, exclude, varargin)
% save symbolic expression all NLP constraints to files
%
% @note If 'constr' is emtpy, then it will compile all constraints.
%
% Parameters:
% constr: a list of constraints to be compiled @type cellstr
% export_path: the... |
function S = simpson(fx, a, b, m)
% Retorna a integral "fx", de "a" ate "b" com "m" subintervalos,
% pela formula do 1/3 de Simpson: h/3*(y0 + 4y1+ 2y2 +...+4yn-1 + yn)
if mod(m, 2) == 1 % se "m" for par, torna-o impar.
m = m + 1;
end
h = (b - a)/m;
S = fx(a) + fx(b); %extremos y0 e yn
... |
function [j_star,meas_mat] = get_VBJSdata_emd(f_tild)
[N,J] = size(f_tild);
emd_comp = zeros(J,J);
nbins = 10;
for ii = 1:J
for jj = 1:J
[w1, f1] = hist(f_tild(:,ii),nbins);
[w2, f2] = hist(f_tild(:,jj),nbins);
w1 = w1/sum(w1);
w2 = w2/sum(w2);
... |
function A = plotAandScore(TF, timeDur, truth)
score = zeros(1,1000);
for A = 1:1000
th = thresh(TF(1:15), A);
[index, ~] = reliableIslands(TF, th, timeDur);
[tpr, fpr, ~] = roc(truth(1:length(TF)), index);
score(A) = tpr(2) - fpr(2);
end
% figure;
% plot(1:1000, score);
[~,A] = max(score);
... |
T=0:pi/200:8*pi;
uk1_down1=0; %转角起点
uk1_top1=0.820777692661297; %转角终点 角度自变量范围
T=uk1_down1:0.002:uk1_top1;
%% 计算交点区间pT
[deltaY, X, cY, lY] = myfun(T);
Y1 = deltaY(1:end-1);
Y2 = deltaY(2:end);
T1 = T(1:end-1);
T2 = T(2:end);
P = Y1.*Y2<0;
... |
function [AA,T,nn,no,np,err_of_SSD]=zzcssdresch(A,tol)
%SSDRESCH Stability Structural Decomposition for Continus-time Systems
%
% [AA,T,nn,no,np]=zzcssdresch(A[,tol])
%
% puts any square matrix in the following block diagonal form,
%
% | A- 0 0 | nn
% ... |
classdef Variant
properties
Name = NaN
IsActive = true
Quantity
StdCorr
Solution
Expand
IxInit
Eigen
Stability
end
methods
function this = Variant(qty, vec, nExpand, nh, std)
if nargin==0
... |
%% Question 1
%part a
% Determine the matrix form for the following one comp. model w/
% first-order abs
% a bolus dose is injected to compartment X1 with bioavail F at time 0
syms ka kel dose F x1 x2
dx1 = -ka*x1;
dx2 = ka*x1 - kel*x2;
M = jacobian([dx1;dx2],[x1, x2]) %jacobian matrix
%% part b - find e... |
%{
psy.MovieParams (imported) # clips from movies
-> psy.MovieInfo
-----
frame_rate : float # frames per second
frame_width : int # (pixels)
frame_height : int # (pixels)
params : longblob # movie parameters
%}
classdef MovieParams < dj.Relvar & dj.AutoPopulate
properties
popRel = psy.MovieInfo
end... |
function [ u ] = rof_gradient( f, nit, dt, lambda, epsilon )
%ROF_GRADIENT
% Algorithme de Rudin-Osher-Fatemi (descente de gradient)
u = f;
for i=1:nit
u = u + dt*(curvature(u, epsilon)-1/lambda*(u-f));
% Affichage
figure(1); colormap(gray);imagesc(u);axis equal
title(sprintf(... |
%%
% Given a point (x,y) and a radius r, this function will generate a
% circle comprised of n points
%
% Adapted from http://www.mathworks.com/matlabcentral/answers/4633-how-to-draw-a-circle-on-specific-points-in-an-image
% by user "the cyclist"
%
% x = x coordinate of the center
% y = y coordinate of the center
% ... |
function sys = blkdiag(varargin)
%BLKDIAG Group polysys models by appending their inputs and outputs.
%
% This function is the same as append.
%
% See also APPEND.
% Developer Notes:
% 08.21.2007: TJW - Initial coding.
sys = append(varargin{:});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.