text stringlengths 8 6.12M |
|---|
function S = MSAFinit(w0,mu,N,L,H,F)
% MSAFinit Initialize Parameter Structure for the MSAF Algorithm
% Psuedo-QMF CMFB is Used by Default, H and F are Used Otherwise
%
% Arguments:
% w0 Coefficients of FIR filter at start
% mu Step size
% N Number of subbands
% ... |
function phi = likehood(PDec,PCheby,theta,F)
% The likehood calculation according to given theta values.
%--------------------------------------------------------------------------
% The copyright of the PlatEMO belongs to the BIMK Group. You are free to
% use the PlatEMO for research purposes. All publications which... |
% hold on;
clc;
clear;
yt = load('data.txt');
n = length (yt);
alpha = 0.1;
st0 = mean(yt(1:3));
st1(1) =alpha *yt(1) + (1 - alpha) * st0;
st2(1) =alpha *st1(1) + (1- alpha) * st0;
st3(1) =alpha *st2(1) + (1- alpha) * st0;
for i = 2:n
st1(i) = alpha *yt(i) + (1-alpha)*st1(i-1);
st2(i) = alpha *st1(i) +(1-alpha... |
function yn=yn(h,alph,m)
tmp = 0
tmmp = 0
for i=0:m-1
if i==0
tmp= tmp + fai(i)*(t+n*h+h)^i
else
tmp= tmp + fai(i)*(t+n*h+h)^i/factorial(i)
end
end
for j=0:n:
tmmp = tmmp + a(h,alpha,n+1,j)*f()
end
yn = h^alpha*f()/gamma(alpha+2) + tmp + tmmp/gamma(alpha)
end |
function [Mt] = threshold(Img,t)
Mt = Img;
Mt(Mt <= t) = 0;
end |
function [transformed_pt] = get_pt_wrt_tcp(pts,T_tcp_wrt_F)
% angles values must be radians
transformed_pt = zeros(size(pts,1),6);
for i = 1:size(pts,1)
t_F_wrt_b = [pts(i,1);pts(i,2);pts(i,3)];
r_F_wrt_b = eul2rotm([pts(i,4),pts(i,5),pts(i,6)]);
T_F_wrt_b = [r_F_wrt_b,t_F_wrt_b;0 0 0 1] ;
T_... |
% -------------------------------------------------------------------------
% Classification pipeline for layer-2 text pathway on Flickr
% using binary-binary RBM
%
% dotest (1/0), foldlist (1:5), optgpu (1/0),
% doc_length : minimum length for tags (5)
% numhid : number of latent variables
% numstep_h ... |
clear all
close all
feature('DefaultCharacterSet','UTF8');
%%%% DEFINITION OF FILENAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fileref = 'FCR2_v1.1.xlsx';
filerep = '..\..\..\en0_2912 - FOR GATHER.xml'; % MODIFY FILENAME!!
newfile = ['..\..\..\FCR2_en0_' datestr(date,'ddmm') 'NEW.xml'];
%%%% REA... |
function end_x_pos = end_x_pos(q1,q2,q3,q4,q5,q6)
%END_X_POS
% END_X_POS = END_X_POS(Q1,Q2,Q3,Q4,Q5,Q6)
% This function was generated by the Symbolic Math Toolbox version 8.4.
% 17-May-2020 16:05:47
t2 = q1+q2;
t3 = q3+q4+t2;
t4 = q5+t3;
end_x_pos = cos(q1).*(4.3e+1./1.0e+2)+cos(t2).*(2.0./5.0)+cos(t3).*(2.0... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This CFEM Matlab program computes convergence rates for H1 norm and L2
%norms. It also produces surface plots for u_h, numerical FEM
%approximation. Readers may change different model funtions to test this
%program by choosing differen c (see ex... |
function [ ] = insertVec(obj, vector, nameStr, direction, idx)
% 在matrix2D插入行或列
% [ ] = insertVec(obj, vector, nameStr, direction, idx)
% vector: 要插入的列/行向量,类型须为数据,长度要吻合,如有多列/行只取第一列/行
% nameStr: 要插入的列序列名,比如日期,默认'newCol'或'newRow'
% direction: 1-列向量;2-行向量。默认根据vector自动判定
% idx: 指定插入地点,0表示最后插入,默认0
% -------... |
function delta=MH_stepsize(theta_sd,theta_mle,multiple,j)
% This function compute the step size for Metropolis-Hastings update(proposal distribution)
% based on MLE estimations of Theta and their standard deviation estimates.
% Input:
% theta_sd: standard error.
% theta_mle: MLE estimate.
% multiple... |
clear all;
%image
picture = imread('boy.jpg');
pictureGrayScale = im2double(rgb2gray(picture));
%dct
pictureGrayScaleNorm = pictureGrayScale - mean(pictureGrayScale(:));
dctpicture = dct2(im2double(pictureGrayScaleNorm));
%chunks
thresh = 0.001;
chunkSize = [10 10];
iSize = size(dctpicture,1)/chunkSize(... |
function trainSegmentation(pretrainedCNNModel, pretrainedCNNModelName, precomputeFeat)
%%
%trainDetector Trains a detector to recognize feet.
%
%
% Inputs:
%
% @ pretrainedCNNModel : pretrained CNN Model from which 'fc7' layer is
% extracted to generate features for the detector
%... |
function [xm,ym,xm1,ym1,locx,locy,p01,phy,ampaxy0]=shuju()
length=25e-3;
lam=0.6e-3;
rhom=1000;
cm=1500;
rhoh=1200;
ch=2447;
a=12.5e-3;
NX=128; %%% number of pixels one column
xn=126;yn=126; %%% Íø¸ñµÄÊýÁ¿
delxy=2*a/xn; %%%%size of meshes
dlam=0.2e-3; %%%%size of pixels,smaller than half the wave... |
function parameters()
clear;
beta_GV = 0.2269;
alpha_GV = 1.004;
beta_in = 0.01393;
kmet = 0.01741;
K = 4.2;
EC50 = 420;
beta_lb = 0.2309;
beta_in_lb = 0.00415;
K_lb = 3.569;
alpha_LB = 1.049;
EC50_LB = 598.87;
params = {beta_GV, alpha_GV, beta_in, kmet, K, EC50, ...
beta_lb, beta_in_lb,K_lb,alpha_LB,EC50_LB};
pa... |
clc,clear all,close all;
image = imread('images/lenna.bmp');
image_8bit = image(:, :, 1) / 1;
image_7bit = image(:, :, 1) / 2;
image_6bit = image(:, :, 1) / 4;
image_5bit = image(:, :, 1) / 8;
image_4bit = image(:, :, 1) / 16;
image_3bit = image(:, :, 1) / 32;
image_2bit = image(:, :, 1) / 64;
image_1bit = image(:, :... |
%% Problem Set 3
%% Question 1
%
% (a) equivalent filter
%
% Using the given equation, we can write the filter in spatial form with
% laplacian:g(x,y)=f(x+1,y)+f(x-1,y)+f(x,y+1)+f(x,y-1)-4f(x,y).
%
% Then do the fourier transform:
% G(u,v)=[e^(2i*pi*v/N)+e^(-2i*pi*v/N)+e^(2i*pi*u/M)
% +e^(-2i*pi*u/M)-4]*... |
% legendTitle - add a title to a legend
%
% Add a title to a legend
%
% hTitle = legentTitle ( hLegend, string, argPairs )
%
% hLegent = handle to the legend for the title to be added
% string = text string of title
% argPairs = all valid arg pairs for a title object
%
% example:
... |
th=-0.25;
label_t=sign(th-train_set(:,5));
label_t=label_t-(label_t==0);
model1=svmtrain(label_t,train_set(:,1:4),'-t 0 -c 0.01');
model2=svmtrain(label_t,train_set(:,1:4),'-t 0 -c 1');
%model3=svmtrain(label_t,train_set(:,1:4),'-t 1 -c 0.01 -d 4');
model4=svmtrain(label_t,train_set(:,1:4),'-t 1 -c 0.1 -d 2');
model5=s... |
function organizeExcelSleep
%ORGANIZEEXCEL Organize input data and save to Excel
% Format for Mariana
[inputName, inputPath] = uigetfile('*.mat');
inputFile = fullfile(inputPath,inputName);
load(inputFile);
saveFile = regexprep(inputFile,'\.mat','\.xlsx');
inputData = out;
clear outputData;
%% Determine size of inpu... |
function [X,XX,Y,T] = loadfile(file,T,options,XX_as_list)
% load the file and does some optional preprocessing
if nargin<4, XX_as_list = 0; end
if ~isfield(options,'downsample'), options.downsample = 0; end
if iscell(file) % T needs to be cell too
T = cell2mat(T);
for j=1:length(file)
if ischar(file{j})... |
%% Question 4.1
clc;
clear all;
close all;
% X = double(imread('lenna.gif'));
load gatlin2;
F = X + 3*randn(size(X));
Phi = {@(t) t;
@(t) t.^2./(1+t.^2);
@(t) log(1+t.^2);
@(t) 2*sqrt(1+t.^2)-2;
};
dPhi = {@(t) ones(size(t));
@(t) (2*t.*(1+t.^2)-2*t.^3)./(1+t.^2).^2;
@(t) 2*t./(1+t.^2);
@(t... |
clc
clear all
no_obstacles
start1 = [start,0,0,0];
goal1 = [stop,0,0,0];
setup
disp(['calculating closed form solution']);
rrt = rrtstar(A,B,c,R,1:3,1);
disp(['starting algorithm']);
dyn_obs_func = @(t) [];
state_free = @(state, time_range,base_time)(is_state_free(state, state_limits, obstacles, radius,... |
function f = Prediction2(X)
%w determined by training a linear least squares classifier only on the third feature
%the third feature was chosen because it has big correlation to Y and low correlation to the other features
w = [0.589786834922770; 0.135547968587132];
%choose just the third feature
X_ = X(:,3);
X_ = [X_... |
function CVol = CVHSetup(FlowArea,CVolHeight,TotalHeight)
CVol.Number = TotalHeight/CVolHeight;
CVol.CoarseHeight = ([TotalHeight:-CVolHeight:CVolHeight,0.0,CVolHeight:CVolHeight:TotalHeight])';
CVol.FineDivs = 5;
CVol.IDs = (0:1:(2*CVol.Number))'+1000;
ColdMask = 1:CVol.Number;
HotMask ... |
dir = '/data/vision/billf/shadowImaging/edgeImaging/data/stereoDoor_Feb22/results'
name = 'blue_circlewalking_paperfloor';
left_tracks = double(imread(strcat(dir, '/left_', name, '.png')))./255;
right_tracks = double(imread(strcat(dir, '/right_', name, '.png')))./255;
baseline = 1; % set the size of the baseline. Th... |
function ArmReplay_triggered_spatialprecisiondir(dirs,igroup,savefolder)
cd(dirs.homedir)
d2 = dir('*.mat');
dirlab = {'In';'Out'};
hpALL = []; pfcALL = [];
for idir = 1:2
hp = []; pfc = []; sig = []; tp = []; tpi = [];
for id = 1:size(d2,1)
load(d2(id).name,'other_cells','other_cells_touse'... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% RPI-MATLAB-Simulator
% http://code.google.com/p/rpi-matlab-simulator/
%
function sim = catch_test ()
sim = Simulator(.01);
sim.MAX_STEP = 150;
%sim.H_dynamics = @mLCPdynamics;
sim.H_dynamics = @LCPdynamics;
sim.num_fricdirs = 8;
%sim.FRICTION ... |
function [mvs_x, mvs_y] = extract_demo()
% global rows;
% global cols;
mb_size = [4, 4]; % h x w
%frames_dir = "sintel/training/final/alley_1";
frames_dir = "queen2";
orig_input_file_fmt = sprintf('%s/frame_%%04d.png', frames_dir);
% generate and read ffmpeg mvs
temp_mvs_vid_file = "tmp/mvs.mp4";... |
function [R2 R]=rsa_patternConsistency_crossval(Y,partition,conditionVec,varargin)
% function R_cross=rsa_patternConsistency(Y,partition,conditionVec);
% Caluclates a measure of pattern consistency R2 = SS_between / SS_total
% INPUT:
% Y : Noise-normalized activation patterns, a KR x P matrix
% partiti... |
function fit_exper_wage_growth(saveFigures, gNo, setNo)
% Fit: wage growth and intercept; experience profiles by cohort
cS = const_so1(gNo, setNo);
varS = cS.varNoS;
figS = const_fig_so1;
% loadS = var_load_so1(varS.vCalResults, cS);
% outS = loadS.calDevS;
simS = var_load_so1(varS.vSimResults, cS);
cdS = const_so1... |
addpath("utils/","../EMIO_parallel/","../EMIODist2/");
impathbase='/data/reza/datasets/20200410_cmplx3_SA/average/10Apr2020_';
imlowdef=ReadMRC([impathbase,'208-1.mrc']);
img=permute(imlowdef,[2,1]);
%calcualte background profile on whole micrograph and use it for patches
ps=log(abs(fft2xSmooth(img,'original')));
[psb... |
function [tips] = UP_Finger_tips(frame, KBD_Mask)
%UP_Finger_tips returns an array containing [x,y] (= [col, row])
%coordinates of finger-tips, computed as a "Spike" of each finger
%
% OUTPUTS:
% * finger_tips - vertically stacked [x,y] integer coordinates matrix
%
%
% INPUT:
% * frame - RGB Frame
%
%
% PROCEDURE... |
clc
clear
close all
syms z
z1 = [(-0.5+1j*0.5) (-0.5-1j*0.5)]';
p = 1/4;
k1 = 1;
[num , denum ] = zp2tf(z1,p,k1);
num
denum
|
function [p,dist]=purity(indCluster,classes)
numSample=numel(classes);
uniClass=unique(classes);
numClass=numel(uniClass);
uniCluster=unique(indCluster);
numCluster=numel(uniCluster);
dist=zeros(numCluster,numClass);
for i=1:numCluster
curClu=(indCluster==(uniCluster(i)));
for j=1:numClass
c... |
data = load('errorsamples10000.txt');
[m,n] = size(data);
length = m/5;
%perform innovation bound test.
% get the list of error and their correlations.
error_stack = zeros(length, 4);
cov_stack = zeros(length*4, 4);
j = 1;
k = 1;
for i = 1:5:m
error_stack(j,:) = data(i,:);
cov_stack(k:k+3,1:4) = data(i+1:i+4,1... |
% Accelerator Toolbox
% Version 2.0 AT Collaboration 25-Aug-2017
|
function displayProgress(i,nIterations,titleString)
% displayProgress(i,nIterations,titleString)
%-----------------------------------------------------------------------------------------
% DISPLAYPROGRESS - prints the progress of the iterations in any loop in
% command window. Only one instance of this function should... |
function pose_mat = convertMotionVectorToMatrix(pose_vec)
% convert the motion vector to motion matrix
%
% INPUT:
% pose_vec: a vector as [tx, ty, tz, wx, wy, wz, wq]
%
% OUTPUT:
% pose_mat: a matrix as [R, T; 0, 1]
trans_vec = pose_vec(1:3);
quaternion = [pose_vec(end), pose_vec(4:end-1)];
rot_mat = quat2rotm(qu... |
clear ; close all ; clc ;
%loading data
data = load('data1.txt');
X = data(:,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]);
y = data(:,21);
%% ============ Part 1: Compute Cost and Gradient ============
[m ,n]= size(X);
X = [ones(m,1) X];
initial_theta = zeros((n+1),1);
% Compute a... |
% Plot the results in Problem 2, part 3; use the non-sparse solver here;
HH = figure;
for j = 1:7
N = 25 * (2^j);
W = 2*diag([zeros(N,1);ones(N,1)])-diag(ones(2*N-1,1),1)-diag(ones(2*N-1,1),-1);
e = ones(2*N,1);
x = ldlsolver(W,e);
% Sparse version yields the same result.
%[i,k,s] = find(W); W1 = sparse(i,k,s); x... |
%
% Usage: [W [optim]]=mexFistaPathCoding(Y,X,W0,DAG,param);
%
% Name: mexFistaPathCoding
%
% Description: mexFistaPathCoding solves sparse regularized problems for the
% path coding penalties of http://arxiv.org/abs/1204.4539
% X is a design matrix of size m x p
% X=[x^1,...,x^n]', wh... |
% vars - A [T x 11] matrix where each row is one of T trials and each of 11 columns is a variable:
%
% 1. [1st option] probability to win
% 2. [1st option] reward size
% 3. [1st option] expected value
% 4. [2nd option] probability to win
% 5. [2nd option] reward size
% 6. [2nd option] expected value
% 7. Side o... |
%{
Generates mandelbrot set and plots it next to a diverged pixel vs
iteration graph or a iteration pixel change map. Can optionally save
image of mandelbrot set generated.
Can only generate square images with dimentions specified by
courseGrain.
interval can either be 2 numbers specifiying boun... |
classdef Int < props.Float
%INT Integer prop
% This is a type of %%%ref[props.Prop](props.Prop) that can be used when a %%%ref[props.HasProps](props.HasProps)
% class needs an integer property.
%
% %%%bold[Attributes] - No properties besides those inherited from %%%ref[props.Float](props.Float)
%
% Example:
% ... |
function [b, a, f] = fallingLagLeastSquaresFittingGaussNewton( y, w, N )
y = y(:);
K = length(y);
%initialization
b = logspace( -1, -N, N );
a = logspace( -1, -N, N );
x = [ b(:) ; a(:)];
for itr = 1:10
f = fallingLagResponse( a, b, w, K, N );
r = y - f;
J = fallingLagJacobian( a, b, w, K, N );
... |
% load JA data from multiple participants, train LSTM on joint angle trajectories
clear;
% NN LSTM parameters
inputSize = 35; % number of joints
classType = 'jumpGrade'; % jumpGrade, toeDistToTarg, custom
numClasses = 3; % too short, on target, too long
numHiddenUnits = 100; % hiddeon units of LSTM, EXPERIMENT WITH ... |
function data = get_Data()
global idx params
n = 100;
point = linspace(0, 2*pi,n);
%start position
data.start_center = [params.startState(1) params.startState(2)];
data.start_radius = 0.05;
data.startx = data.start_radius * cos(point) + data.start_center(1);
data.starty = data.start_radius * sin(point) + data.start... |
function visualizeTrajectories(countbesttrajs, clrscurrprev, clrs, eventsStr, prevCurrLUT, labelsLUT, ...
tstampFirst, tstampLast, labels, prevcurlabs, outputPath, generalProperty, projeff, recon,...
eigs, effDim, X, Method, isTaste)
b = fir1(10,.3);
trajSmooth = filter(b,1, projeff, [], 2);
trajSmooth=trajSmo... |
function [x,isterm,dir] = eventfun_V6(t,Y,p)
%% Evaluating size of derivatives
rhss = rhs_function_V6(t,Y,p);
x = norm(rhss) - 1e-7;
% if(p.seasonality)
% if(t(end) > 365) % the mixing event happens every p.mixing_period days
% if(norm(Y(end,:)) - norm(Y(end-365,:)) < 1e-7)
% x = 0;
% e... |
function es = esModel
%ESMODEL 此处显示有关此函数的摘要
% 此处显示详细说明
es.Cpurchase=1010000;
es.uCycles=6000;
es.Ccycle=es.Cpurchase/es.uCycles;
es.cap=9;
es.init=7;
es.Emax=es.cap;
es.Emin=1;
es.Pmax=3.4;
es.Pmin=-1.7;
es.efficiency=0.95;
end
|
% data=load('Js_Interface_spatial_3.000.txt');
% data=load('Js_lowest_micron_final_Interface_spatial_0.350.txt');
data=load('Js_lowest_micron_final_Interface_spatial_10.000.txt');
indz=data(:,4)==2.762742;Ztmp=data(indz,4);
Xtmp=data(indz,2);Ytmp=data(indz,3);
Cint=-data(indz,1);
Ytmpu=unique(Ytmp);
Ytmpu=Ytmpu(Ytmpu<2... |
function [M, Poses] = testMeasurements(vis, mdl, cam)
I1 = [];
C1 = [];
V1 = [];
ExpWorld = vertcat( [4.5, -0.13888, 2 - 0.43603, 1], ...
[4.5, 0.43085, 2 + 0.08427, 1], ...
[4.5, 0.43085, 2 - 0.43603, 1], ...
[4.5, 0.43085, 2 + 0.4... |
% Call to prohev() function, which exports an HEV data file.
% Created by ljl, 23 Nov 1999.
% For electric vehicles.
if (exist('fc_fuel_mass') == 0)
fc_fuel_mass = 0;
fc_fuel_den = 1;
end
% For conventional vehicles.
if exist('ess_module_num') == 0
ess_module_num = 0;
ess_max_ah_cap = 0;
end
prohev(veh_whee... |
function xdot = f(x)
%--------------------------------------------------------------------------
% Matlab M-file Project: HyEQ Toolbox @ Hybrid Systems Laboratory (HSL),
% https://hybrid.soe.ucsc.edu/software
% http://hybridsimulator.wordpress.com/
% Filename: f_ex1_2.m
%----------------------------------------------... |
% from http://pcwww.liv.ac.uk/~awolski/Teaching/Liverpool/PHYS370/AdvancedElectromagnetism-Part8.pdf
circd = @(radius,deg_ang) [radius*cosd(deg_ang); radius*sind(deg_ang)];
lambda = 500;
n0 = 1.0;
n1 = 1.0;
theta = -90; % in degrees
c = 3E+8; %c = 3E+8 m/s x 10+9 nm/m x 10-9 ns/s = 3E+8 nm/ns;
k0 = 2*pi*n0/lambda... |
function [X,k]=SOR_Matrix(A,b,w,P,N,delta)
%Input -A n*n非奇异矩阵
% -b n*1矩阵
% -w 松弛因子
% -P n*1矩阵,初始值
% -N 最大迭代次数
% -delta 精确度
%Output -X n*1使用SOR矩阵形式方法得到的方程组AX=b的解
% -k 迭代次数
if (w<=0 || w>=2)
error('松弛因子w不合法.')
end
%求维数
n=length(b);
%初始化X
X=zeros(n,1);
%分别得到A的下三角矩阵L,上三角矩阵U,对角线矩... |
function class = class_5_final(sig1)
X = [real(sig1(1:100)), imag(sig1(1:100))];
E = evalclusters(X,'linkage','silhouette','KList',[4,16,64]);
%plot(E)
if E.OptimalK==4
class = 1;
elseif E.OptimalK==16
class=7;
elseif E.OptimalK==64
cent = [];
for d = 1:E.OptimalK
cent = [cent mean(sig1(find(E.... |
function Cnb = a2matBatch(att)
% Convert Euler angles to direction cosine matrix(DCM) in batch processing.
%
% Prototype: Cnb = a2matBatch(att)
% Input: att - =[pitch, roll, yaw, t]
% Output: Cnb - =[C11, C12, C13, C21, C22, C23, C31, C32, C33, t]
%
% See also a2mat.
% Copyright(c) 2009-2021, by Gongmin Yan, All righ... |
varScreenSize = get(0,'ScreenSize');
MENUE_HIGH = varScreenSize(:,3);
MENUE_WIDTH = varScreenSize(4)/8*5; |
function MaW = entrenar(Batch)
b=zeros(1,7);%BIAS
teta=1;
MaW=zeros(63,7);%MATRIZ DE PESOS EN CERO
target=(eye(7)*2)-1;%MATRIZ INDETIDAD BIPOLAR
y=zeros(1,7);
mBatch=xlsread(Batch);
x=zeros(35,63);
k=1;
for i=1:5
for j=1:7
x(k,:)=reshape(mBatch(9*i-8:9*... |
function outImg = myRichardsonLucy(Img,PSF,iter)
%Richardson Lucy algorithm:
[R,C]=size(PSF);
PSF_flip=zeros(R,C);
for i=1:R
for j=1:C
PSF_flip(i,j)=PSF(R+1-i,C+1-j);
end
end
ut1=double(Img);
ut2=double(zeros(size(Img)));
%Iterative implementation:
for i=1:iter
convolution1=conv2(ut1,PSF,'same')... |
% Filename : octavesToDecades.m
% Date : 07.03.2017
% Author : Manuel C. Kohl
function decades = octavesToDecades(octaves)
decades = factorToDecades(octavesToFactor(octaves));
end
|
function out = ekbf(model,obser,data,time,R,Q,x0,P0,q,fdad,options)
% Brett Matzuka, NCSU, May 2009
%
% Thanks to Adam Attarian for help in the update
% Thanks to Hien Tran for overseeing and his patience
%
%EKBF Extended Kalman Bucy Filter
%
% this implements a continuous-discrete extended kalman filter
% using Au... |
function [alpha, beta, gamma, loglik, xi_summed, gamma2] = fwdback(init_state_distrib, ...
transmat, obslik, varargin)
% FWDBACK Compute the posterior probs. in an HMM using the forwards backwards algo.
% toolbox from Kevin Murphy
if 0 % nargout >= 5
warning('this now returns sum_t xi(i,j,t) not xi(i,j,t)')
end
... |
%
% Invertion of activation function (see f_function).
%
function potential = function_s(frequency)
y12 = 0.245;
z12 = 2.6 * 120 * (1 - y12)^2 * logsig((y12 - 0.1935) .* 120.0) * (1.0 - logsig((y12 - 0.1935) .* 120.0));
k12 = 2.6 .* logsig((y12 - 0.1935) .* 120.0) - z12 ./ (1.0 - y12);
u01 = 2.6 * logsig(0.1935 * -120... |
lat_rv = zeros(1,100)
lon_rv = zeros(1,100)
for i=1:100
lat_rv(1,i) = random('norm', 0, 0.12)
lon_rv(1,i) = random('norm', 0, 0.12)
end
% plot(lat_rv(1,1:100),lon_rv(1,1:100),'k.','MarkerSize',5);
% hold on
x = [21.08772,19.31870,21.77925,20.81878,20.24228,19.48133,21.62899,52.15906,50.29829,52.94230];
y = [3... |
%% Control Functions
function [u,errInteg_DCM,errInteg_Hip,xopt,rVRP,hd_des] = ...
SimFun_Control_Hip(q,dq,DCM_des,dDCM_des,Hip_des,dHip_des,P,mTot,fc,errInteg_DCM,errInteg_Hip,qlow_lim,qhigh_lim,ulim,RobotLinks,RobotParam,iiii)
RobotFrame = DynFun_Frame_calc(RobotLinks,RobotParam,q);
D = ... |
%{
This function finds the aspect ratio of connected regions. If the aspect
ratio is approxiamtely (1), i.e the connected region is an ellipse
Inputs:
darkPixels: coordinates that are part of connected reggions
A: processed Image
D = matrix containing coordinates of the connected region... |
function [x,w,ll] = bpf(y,u,theta,param,par,prior,seed)
if nargin < 7
seed = sum(100*clock);
end
rng(seed);
% Unpack Parameters
n = par.n;
N = par.N;
M = par.M;
x = zeros(par.n,M,N+1);
w = zeros(M,N);
Q = param.Q;
R = param.R;
% Define estimation variables
theta(1) = par.theta(1);
theta(2) = par.theta(2);
th... |
function [modelNN] = bestModel(images_shuffle,labels_shuffle)
% use HOG and KNN k=5
%% Feature Extraction
imageSize = size(images_shuffle,1);
features_shuffle = [];
for i=1:imageSize
im = reshape(images_shuffle(i,:),160,96);
feature = hog_feature_vector(im);
features_shuffle = [features_shuffle; feature];
... |
%Travis Morrison
%LAI Plots
clear; close all; clc;
<<<<<<< HEAD
load('/Users/travismorrison/Local_Data/MATERHORN/data/tower_data/Playa_tower_averaged /playaSpring30minLinDetUTESpac3.mat');
=======
%%
%load('/Users/travismorrison/Local_Data/MATERHORN/data/tower_data/Playa_tower_averaged /playaSpring30minLinDetUTESpac3... |
clear;
load('Statistics.mat');
mean = Statistics(:,4);
fid = fopen('perceptronData.txt');
b = [];
tline = fgetl(fid);
%Input reading
while ischar(tline)
%disp(tline);
ind = find(tline == ' ');
ind = [0 ind size(tline,2)+1];
a = [];
for i=1:size(ind, 2)-1
a = cat(2, a, sscanf(tline(ind(i)+1:ind(i+1)-1), '%... |
<!-- ....................................................................... -->
<!-- XHTML Basic Table Module ............................................. -->
<!-- file: xhtml-basic-table-1.mod
This is XHTML Basic, a proper subset of XHTML.
Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
... |
function Rz=RRz(By,Bz,ky,kz,n)
Rz=sum(n.*(kz-1)./(1+By.*(ky-1)+Bz.*(kz-1))); |
% f1<-mnorm<-function(x){
% y<-0.3135405*dnorm(x,8.359357,10.93816)+0.3278223*dnorm(x, 19.685839,36.93783)
% +0.3586372*dnorm(x,31.938943 ,101.40636)}
clear clc;
close all
figure
hold on
x=0:0.1:100;
plot(x,f(x), '-', 'LineWidth', 2)
plot(x,normpdf(x,8.32,sqrt(10.8)))
plot(x,normpdf(x,19.65 ,sqrt(37.9))... |
%% Split video to images
vid = VideoReader(video_name);
numFrames = vid.NumberOfFrames;
n = numFrames;
%n = 10;
mkdir Video2Images;
currentFolder = pwd;
for i = 1:5:n
frames = read(vid, i);
imwrite(frames,[currentFolder '/Video2Images/image' int2str(i), '.jpeg']);
im(i) = image(frames);
end |
function lines = findEdges(image_bw)
% input: a binary image of intereted region
% output: 20 solid lines expressed in polar and cartesian coordinates.
% This function is to detect the gridlines by finding peaks in the parameter
% space. The peaks in the function indicate the potential straight lines with
% the m... |
clear all;
N=4;
x1 = [1 2 2 1];
x2 = [1 -1 -1 4];
y = zeros(1,N);
for n=0:N-1
m=0:N-1
n1 = mod(n-m, N);
xs2 = x2(n1+1);
x12 = x1.*xs2;
y(n+1) = sum(x12);
end
n=0:N-1;
subplot(1,3,1);
stem(n,x1,'filled');
xlabel('n');
title('x1(n)');
subplot(1,3,2);
stem(n,x2,'filled');
xlabel('n');
title('x1(n)'... |
function [nXk] = GD(xk)
%IGD Summary of this function goes here
% Detailed explanation goes here
m = 10;
n = 2;
eta = 1;
[A, b] = generate_Ab(m, n, eta);
gradient = @(x) gradient_f(A, b, x);
nXk = [];
x = [0.043050527109744; 0.485640581896102];
y = 1;
L = 100;
a = 2/(y+L);
for k = 0:499
nXk = [nXk; log(norm(xk... |
clc; clear all;
input_image = imread('../asset/image/numbers/4.png');
input_image = im2bw(input_image);
[m,n] = size(input_image);
I = clear_boundary(input_image);
subplot(1,2,1);imshow(input_image);
subplot(1,2,2);imshow(I);
p = pblack(I);
display(p)
% 分割为最小外接
% digitOutput = my_operator(input_image);
digitOutput ... |
function varargout = controlador(varargin)
% CONTROLADOR MATLAB code for controlador.fig
% CONTROLADOR, by itself, creates a new CONTROLADOR or raises the existing
% singleton*.
%
% H = CONTROLADOR returns the handle to a new CONTROLADOR or the handle to
% the existing singleton*.
%
% CONTROLAD... |
clear all;
format long
iset=0;
gset=0;
rng(92923932)
ave_psi=0;
global_psi=[];
load matlab;
%%%%%%%%%%%%%%%%%%%%%%% input parameter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dt=0.005;
max_time=1.5;
dx=0.5;
fskip=10;
nu=1;
L0=5;
r=0.683;
e0=1;
ndim=3;
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% for... |
%set_indepvar
if(get(hregressia,'Value'))
set(hregressif,'Value',0);
end |
function dets = ScanImageOverScale(Cparams,im,min_s,max_s,step_s)
dets = [];
S = min_s:step_s:max_s;
for i=1:size(S)
dets = [dets;ScanImageFixedSize(Cparams,imresize(im,S(i)))/S(i)];
end
end
|
deelpunten = 3; |
classdef BoltzmannMachine < Ugm & LatentVarModel
%#NotYetImplemented
properties
ndimsLatent;
end
methods
function model = BoltzmannMachine(varargin)
%
end
function computeMapLatent(model,varargin)
%
notYetImplemented('BoltzmannMachine.computeMapLatent()');
end
function inferLatent(model... |
function H=LaplacianAnySize(Size, Sigma)
p2=[Size, Size];
p3=Sigma;
siz = (p2-1)/2;
std2 = p3^2;
[x,y] = meshgrid(-siz(2):siz(2),-siz(1):siz(1));
arg = -(x.*x + y.*y)/(2*std2);
h = exp(arg);
h(h<eps*max(h(:))) = 0;
sumh = sum(h(:));
if sumh ~= 0,
h = h/sumh;
end;
%Remove gaussian... |
%% Script to extract the features and generate table
% change:
% File name -> line 19
% File size -> line 12
% Threshold -> line 14 Quantization Threshold
% Mode -> line 95 Either TxRx or Advertising
% Profile -> line 96 Either Handsfree, Headset, Or Sensor
% Table Name -> line 102 & 103
%% intializat... |
function [ distancesMatrix ] = calculateDistances( pointsMatrix,image,isDeley)
%it's almost always found 70 points, i need to check the length from some arbitary points(todo)
%if the array is empty or it length is different then 68 (not accurate recognize the face)
if(isempty(pointsMatrix))
errordlg('The user fac... |
function joints = load_mocap(filename)
% Load experiment data.
mocap = load(filename);
% Number of frames in experiment.
num_frames = length(mocap.all_points);
% Number of points in experiment.
num_joints = length(mocap.segment_order);
% Extract joints into one big matrix.
joints = zeros(num_frames, n... |
classdef MixMvnGibbsFitEng < FitEng
properties
diagnostics;
verbose;
thin;
Nburnin;
Nsamples;
fixlatent;
method;
model;
end
methods
function eng = MixMvnGibbsFitEng(varargin)
... |
%% This function finds nearest neighbour of a query from a time series
%% Uses MASS_V2 or UCR_DTW algorithm to find the nearest neighbor
function [nearestNeighborIndex, nearestNeighborDistance] = getNearestNeighbor(timeSeries, queryPosition, queryLength, useMASS, bsf)
% Param r is used in UCR_DTW. Currently it's ... |
function [convexHull, slope, dx] = grahamScan(xy)
%convexHull = grahamScan(xy)
%
%this function takes the xy coords of a graph and returns the points that
%would form a convex hull.
%
%This function also returns the slope of each edge of the convex hull
%(going counter-clockwise) and the change in x.
warning ... |
dat = load('2019-11-19_11:30_20_newmodel_100epochs_400size.mat');
figure,
hold on;
title("Large variance");
xlabel("Epochs");
ylabel("Accuracy");
xlim([0 100]);
plot(dat.accuracy,'lineWidth',1.5);
plot(dat.val_accuracy,'lineWidth',1.5);
legend({'Train','Test'},'Location','northEast');
set(findall(gcf,'-property','Fon... |
function [ LABver] = getLAB( RGBimg )
% Returns LAB version of RGB image and its 3 separate channels
R = RGBimg(:,:,1);
G = RGBimg(:,:,2);
B = RGBimg(:,:,3);
[Lchan, achan, bchan] = rgb2lab(RGBimg);
LABver = cat(3, Lchan, achan, bchan);
end
|
function varargout = test_gui(varargin)
% TEST_GUI MATLAB code for test_gui.fig
% TEST_GUI, by itself, creates a new TEST_GUI or raises the existing
% singleton*.
%
% H = TEST_GUI returns the handle to a new TEST_GUI or the handle to
% the existing singleton*.
%
% TEST_GUI('CALLBACK',hObject,ev... |
function varargout = arrayGui(varargin)
% ARRAYGUI MATLAB code for arrayGui.fig
% ARRAYGUI, by itself, creates a new ARRAYGUI or raises the existing
% singleton*.
%
% H = ARRAYGUI returns the handle to a new ARRAYGUI or the handle to
% the existing singleton*.
%
% ARRAYGUI('CALLBACK',hObject,ev... |
rtpset='full49ch'
data_path='/asl/data/cris/sdr60';
src='_noaa_ops';
data_str='_full49ch';
rtp_core
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.