text stringlengths 8 6.12M |
|---|
classdef InverseDynamics
properties
FAnkleX_Array
FAnkleY_Array
MAnkleZ_Array
FKneeX_Array
FKneeY_Array
MKneeZ_Array
FHipX_Array
FHipY_Array
MHipZ_Array
end
methods
function obj = InverseDynamics(anthropome... |
plot(tableNums, saveIndexTimes/1000, '*k-');
axis([16,96,0,8]);
set(gca,'XTick',[16:16:96]);
xlabel('Code Length');
ylabel('Saving Index Time Consuming(s)');
box on;
|
function [b,fit,Y]=linFit(Y,X)
%Remove nans from this
[inda] = ~isnan(X);
ind = sum(inda,2) == 0;
ind2 = ~isnan(Y);
Y = Y(ind&ind2);
X = X(ind&ind2,:);
[b,bint,r,rint] = regress(Y,X);
fit = b(1);
for o = 1:length(b)-1,
fit = fit + b(o+1)*X(:,o+1);
end
|
function arrayGv = gv(x, img)
[sizeX, sizeY] = size(img);
arrayGv =1/sizeY * sum(img(x, 1:sizeY));
|
function shapesbd(varargin)
%EXPERIMENT.SHAPESBD Blind deconvolution on the shapes problem.
ip = inputParser;
ip.addParameter('verbosity', 0);
ip.addParameter('iterations', 1000);
ip.addParameter('test', false);
ip.addParameter('parallel', false);
ip.addParameter('plot', false);
ip.parse(varargin{:});
% Experimental ... |
% Get processed data
cfg_data.paperSessions = 1;
data_paths = getTmazeDataPath(cfg_data);
restrictionLabels = get_restriction_types(data_paths);
cfg.use_matched_trials = 1;
Q = cell(1, length(data_paths));
for p_i = 1:length(data_paths)
Q{p_i} = get_processed_Q(cfg, data_paths{p_i});
end
% Average across all left... |
clc
close all
clear all
%Select test
test = 1;
%Select subtest
subtest = 3;
%Select index
index = [1 2 3];
for i = 1:length(index)
load(sprintf('test%s.mat',num2str(test*100+subtest*10+index(i))));
motor_vol = csvread(sprintf('%s.%s/Run%sVolume.csv',num2str(test),num2str(subtest),num2str(i)));
motor_time = motor_vol(... |
function [data, Fs] = load_data(filename)
[data_all, Fs] = audioread(filename);
data = data_all(:, 1);
end
|
function k = K(x,y,tau) %gaussian kernel [can be used as covariance function]
gk = @(x,y,tau) exp(-1/2*(tau^2) * norm(x-y)^2);
k = zeros(length(x),length(y));
for i=1:length(x)
for j=1:length(y)
k(i,j) = gk(x(i),y(j),tau);
end
end
|
function [] = errorOfEachNet(vid_no)
str_prob = '';
start_sec = [30, 49, 69, 89, 109, 129, 154, 174, 194, 214, 234, 254, 275, 295];
fid = fopen('experterr.txt', 'wt');
for expert = 1:8
load(strcat('expert', int2str(expert), '.net'),'mix','-mat');
expert_file = dlmread(strcat('AnaesExpert... |
function this = replace(this, data, start, comment)
% replace Safely replace tseries object properties.
%
% Backend IRIS function.
% No help provided.
% -IRIS Macroeconomic Modeling Toolbox.
% -Copyright (c) 2007-2017 IRIS Solutions Team.
%--------------------------------------------------------------------... |
function test_costfunction_reg_minimal ()
% basically the same test as test_costfunction_minimal, but with
% varying values for the lambda, and theta cannot be 0 (there would be
% nothing to penalize), and the x0 (ones) vector has been added
X = [1 1 1;
1 2 2]; % minimal 2D feature matrix
y = [0 ... |
%Mc2Source: the GUI for Mc2Source tests
% presents two Dean & McAlpine-like stimuli
%*******************************************************************************
% The Graphical User Interface
%*******************************************************************************
GUI.locations1 = [];
GUI.loca... |
clear all; clc; close all;
L = 25; % Longitud del cauce [km]
L_g = 18.2; % Longitud desde el centroide de la cuenca hasta el punto de control [km]
S = 0.192; % Pendiente media de la cuenca
tc = 1.75; % Tiempo de retención
tp = 0.323*(L*L_g/sqrt(S))^0.422; % [hr]
tB = 5.377*tp^0.805; % [hr]
qp... |
%Pía Contreras Guerrero
%P2 parte b
%Abrimos la imagen original de acuerdo al hint de la tarea
I = imread('cameraman.jpg');
%Hacemos convolucion 2D como indica el enunciado
C = double(I(:,:,1));
%Extendemos hacia afuera las filas como indica el enunciado
C1 = [C(:,1),C(:,1),C(:,1),C,C(:,512),C(:,512),C(:,512)];
... |
function [bestH] = ransacH(matches, locs1, locs2, nIter, tol)
% INPUTS
% locs1 and locs2 - matrices specifying point locations in each of the images
% matches - matrix specifying matches between these two sets of point locations
% nIter - number of iterations to run RANSAC
% tol - tolerance value for considering a poin... |
function Tswi=tswi_calc(lat,water_depth)
% SWIT % Hantschel&Kauerauf, pg. 128
Tf = -1.90-7.64*10^-4*(water_depth*0.3048);
a = 4.63+8.84*10^-4*lat-7.24*10^-4*lat^2;
b = -0.32+1.04*10^-4*lat-7.08*10^-5*lat^2;
Tswi=Tf+exp(a+b*log(water_depth*0.3048));% in 0C
Tswi=Tswi*(9/5)+32; % in 0F
end |
function names = getBusSignalNamesFromInport(bInport)
% Retrieve names of bus signals connected to inport
%
% names = getBusSignalNamesFromInport(bInport)
%
% Retrieve the names of all signals found within a bus connected to the inport
% block bInport.
%
% WARNING: This is occasionally unreliable, better to call
% g... |
function [index,clusters] = mykmeans(x,k)
storek = zeros(k,2);
myNewX = zeros(length(x),3);
% for i=1:k
% storek(i,1) = randi([0 120]);
% storek(i,2) = randi([0 160]);
% end
for n=1:5000
for h=1:k
i1 = find ( myNewX(:,3) == h);
if isempty(i1)
storek(h,1) = randi([0 120])... |
clear;
clc;
for n=1:20
f(n)=1000*n;
end
for j=1:20
for n=2000:11000
seno(j,n)=sin(n*f(j));
end
end
SumatoriaSin=zeros(1,11000);
for n=2000:11000
for j=1: 20
SumatoriaSin(n) = seno(j,n)+SumatoriaSin(n);
end
end
length(SumatoriaSin)
plot(SumatoriaSin)
for n=3000:4500
if(SumatoriaSin(n)>... |
%ABSTRACT
% Library function for SDCM. Computes sign(X).*|X|.^exponent.
function X = signedPower(X,exponent)
if(exponent==1)
return; %performance.
else
X = sign(X).*abs(X).^exponent;
end
end
|
clc; clear;
nBasesMax = 120;
fontSize = 15;
origImage=imread('Golden-Gate-Bridge.jpg'); % [n1 x n2 x 3] For portrait images n1 < n2
unrollImage=[origImage(:,:,1), origImage(:,:,2), origImage(:,:,3)]; % [3n2 x n1]
origMemory = numel(origImage) / 1024;
fprintf('Size of the orignal image is %d x %d x %d\n', size(o... |
function [ yMean, yStdErr, yVar, yN] = windowAverageUnevenData( xOrig,yOrig,xNew,windowSize )
%windowAverageUnevenSampled Applies averaging window to uneven data.
%[ yMean, yStdErr, yVar, yN] = windowAverageUnevenSampled( xOrig,yOrig,xNew,windowSize )
%
%This function is used to calcluate a windowed average for data t... |
clc
clear all
%h = fspecial('gaussian',[3,3], 1.00)
fname='D:\pub\bin\iris\detect\S2001L01.BMP';
fname='D:\pub\bin\iris\test1pic\S2271L04.jpg';
img=imread(fname);
img_gray=img;
% m_o=[-1 -1 -1
% -1 8 -1a
% -1 -1 -1];
% [M N]=size(img_gray);
% ddd=conv2(img_gray,m_o);
% R=zeros(M,N);
% for i=30:M-30
% for j=... |
function[dropped_list] = init_dropped(dropped_list,max_conn)
dropped_list.id = max_conn;
dropped_list.type = 'testo';
dropped_list.size = 1.5e10;
dropped_list.t_ist = max_conn;
dropped_list.t_event = max_conn;
dropped_list.onu_dest = max_conn;
dropped_list.src = max_conn;
dropped_list.flow_req = max_conn;
dropped_lis... |
function Xdot=ode_adaptconlearn(t,X)
global K1 K2 alpha gamma tprevious qdotprevious Y1Y1_sum Y1T1_sum flagcon prevcheck mineigvec tvec
%Assigning states from the input arguments to other variables
q1=X(1); q2=X(2); q1dot=X(3); q2dot=X(4);
p1hat=X(5); p2hat=X(6); p3hat=X(7); fd1hat=X(8); fd2hat=X(9);
q=[q1;q2];... |
function [J ] = objFunction(theta, X, y)
m = length(y); % number of training examples
h = sigmoid(X * theta);
J = - sum( (y .* log(h+eps)) + ((1 - y) .* log(1 - h+eps)) );
end |
function [D1,D2] = stereoMatchWindowCensus_adptive(I1, I2, window_radius, max_d)
%Image allignment
max_window = 8;
min_window = 2;
[~,cols,~] = size(I1);
[rows,cols2,~] = size(I2);
if cols > cols2
I2(:,end+1:cols,:) = 0;
elseif cols2 > cols
cols = cols2;
I1(:,end+1:cols2,:) = 0;
end
%Census Transform
% IC1 ... |
clc;close all;clear all;
addpath(genpath('manopt_cur'));
addpath(genpath('test_slate'));
addpath(genpath('image_experiment_focm'));
patch_size = 8;
Basis = cell(3,1);
Image = cell(3,1);
D = dir(fullfile('test_slate', '*.pgm'));
indx = [7,8,10];
for k = 1:3
img = imread(D(indx(k)).name);
Image{k} ... |
function transInfo = batchTransChannels(imageDatastore, numOfChannels)
% delete not qualifying images (channel~=3)
% operated directly to file directory
transInfo = [];
for i = 1:length(imageDatastore.Files)
I = readimage(imageDatastore, i);
[~, ~, channel] = size(I.original);
disp(channel);
if ... |
function gama= Gama( NL )
%UNIFORM Summary of this function goes here
% a= uniform( NL )
[N,M]=size(NL);
gama=zeros(1,N);
for i=1:N
nk=sum(NL(:,i));
if nk==1
gama(1,i)=0;
else
gama(1,i)=1/(nk-1);
end
end
end
|
for P = [0:0.3:4]
Disp = 10.00
%P = 1.5
transit = 0;
dt = 0.01;
ttmp = linspace(0,5, 5/dt)';
art_kernel = (ttmp-transit).^(Disp*P) .* exp(-Disp *(ttmp-transit));
art_kernel(art_kernel<0)=0;
art_kernel = art_kernel / sum(art_kernel); %normalize the mass in the dispersion
plot(art_kernel)
hold on
end |
function [sum_pose] = poseAdd(p_j , p_i)
% pose_add = (p_j , p_i) the second is the delta pose to be added
% returns the planar roto-translation that compose pj and pi
if length(p_j(:,1))==1
p_j = p_j';
end
if length(p_i(:,1))==1
p_i = p_i';
end
rho_i = p_i(1:2);
rho_j = p_j(1:2);
th_i = p_i(3);
th_j = p... |
classdef WaveformSelector < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
Figure matlab.ui.Figure
AxTime matlab.graphics.axis.Axes
AxEnergy ... |
function [posN,t] = MyOrbitWithAnomaly(t,mu,a,e,h,incl,RAAN,ArgPer,anomaly)
%% Function Description
% This function is responsible for taking orbit parameters (including actual
% anomaly) as inputs, and outputting a position vector at each time interval t
% from the center of the attracting body to the object of inte... |
x = [-5:0.01:5];
y = x;
plot(x, y);
% 使用句柄设置刻度
set(gca, 'Xtick', [pi / 2, pi]);
set(gca, 'XTickLabel', {'-pi/2', 'pi'});
grid on;
|
classdef Location < handle
properties
ID;
Name;
Type;
Xmin;
Xmax;
Ymin;
Ymax;
Perimeter
end
methods
function l = Location(id, name, type, xmin, xmax, ymin, ymax)
l.ID = cell2mat(id);
l.Name = cell2mat(name);
l.Type = cell2mat(type)... |
function Im_align=Stack_volumealign(path, fmark, nread, fsave, nstart)
% 1. Adapted from the function Stack_driftalign. For every two adjacent
% images, the first image is used as the reference of the next. Common
% feature between two images would be necessary to ensure the
% reliability of the correct... |
%%
function [categoryClassifier,class] = ImageCategoryClassificationFunction(imgSets,learningRate)
{ imgSets.Description } % display all labels on one line
[imgSets.Count] % show the corresponding count of images
%% Prepare Training and Validation Image Sets
minSetCount = min([imgSets.Count]); % determine the s... |
clear;
clc;
runtime=50;
pointer=0;
for j=[1,3,5,7,9]
j
pointer=pointer+1;
filename=['/Users/Desktop/graphdata/synthetic/1000nodes_20attributes_varying_ratio/' num2str(j) '/label.txt'];
label=importdata(filename);
filename=['/Users/Desktop/graphdata/synthetic/1000nodes_20attributes_varying_ratio... |
function xxxEnforceLayoutChange(fig,mode,option)
%xxxEnforceLayoutChange
% Need to provide a good input
if ~strcmp(option,'on') && ~strcmp(option,'off')
return
end
% Determine current state
cus = get(fig.tb.layout,'State');
% Then the function will do nothing as it is as requested already
if strcmp(cus,option) ... |
function h = addSolenoidToAxes(ax,T,params,varargin)
%ADDSOLENOIDTOAXES Add indicator of solenoid strike to axes
%
% h = utils.addSolenoidToAxes(ax,T,params);
% h = utils.addSolenoidToAxes(ax,T,params,'Name',value,...);
%
% Inputs
% ax - Axes handle
% T - Main database table
% params - Parameters st... |
% Generated through Matlab
% Author: Killian Keller
% E-Mail: killian.keller@ief.ee.ethz.ch
% Organization: ETHZ ITET IEF
function [x, y] = plot1D(x, y)
% Summary Here
% Detailed Summary Here
options = struct(...
'filename', '', ...
'xlabel', '', ...
... |
%Written by Patrick Strassmann
function [means, sems] = tbtMeansAndErrorsFromStack(stack)
stack = trimStack(stack);
means = nan(1,size(stack,1));
sems = nan(1,size(stack,1));
for i = 1:size(stack,1)
singleTrial = stack(i,:);
singleTrial(singleTrial==0)=[];
means(i) = mean(singleTrial);
sems(i... |
clc;
clear;
close all;
global s12 s13 datatr1 datatr2 datats1 datats2
%s12,s13 is used to define the rows of the training and checking data
s12=0;
s13=0;
qt1=0:1*pi/180:90*pi/180 ; % change from 30 to 60 for faster training
qt2=0:1*pi/180:90*pi/180; % range changed from (-180 to 180) to (0 to 9... |
function [anovastats_both] = anovastats_both_TT(cellname, atleast_nntrials) %#ok<STOUT>
%
% this function makes the anovastats
% author: camillo, september 2004.
% revisions january 2005, 07, 08, 09, 10
% april 2013 adapted for RM
% December 2016 adapted for SO
% October 2018 adapted... |
function [Mat] = simp_Mat(Mat,theta,d, a, alfa)
%UNTITLED4 Summary of this function goes here
% Esta función devuelve una matriz simplificada
sym_theta=isa(theta, 'sym');
sym_alfa=isa(alfa, 'sym');
if sym_theta
theta_r=theta-symvar(theta);
theta=theta-theta_r;
if theta_r... |
% Draws the matrix as a column/row sorted square dot-matrix pattern
% INPUTs: adj - adjacency matrix representation of the graph
% OUTPUTs: plot
% Note: Change colors and marker types in lines 41, 48, 55 and 62
% Other routines used: degrees.m, sort_nodes_by_max_neighbor_degree.m,
% eigencentrality... |
function class = tree_traversal(tree, example)
if (isempty(tree.class))
nodeValue = example(tree.op);
leftChild = tree.kids{1};
rightChild = tree.kids{2};
if (nodeValue == 0)
class= tree_traversal(leftChild, example);
else
class = tree_traversal (rightChild, example);
end
else
... |
%Soluciones numericas de sistemas de Ecua no lineales
%x^(k)=G(x^(k-1)), k>=1
%|x^(k)-x^(k-1)|<€
%Despejar x1,x2
%Ver evaluacion en cada formula
%Si el sistema solo es de 2 ecuaciones nada mas asignar cero en:
%Introduzca la función fx3: 0
%Introduzca el valor de x3: 0
clear all;
clc
fprintf('SOLUCION NUMERICA DE SIST... |
%{
tp.FreqMap (imported) # responses to directions of full-field drifting gratings
-> tp.Sync
-> tp.CaOpt
-----
fm_cov : longblob # regressor covariance matrix, nConds x nConds
fm_bmap : longblob # regression coefficients, width x height x nConds
fm_r2map : longblob # pixelwise r-squared after gaussin... |
%Tracking Temporal Response Function (TRF) of the brain using weighted gaussian Kernels
function [theta_hat,b_u,c] = RealTimeTRFTracking( varargin )
% Real-time TRF estimation with confidence interval
%Outputs:
% 1) theta_hat : Biased estimation of the TRF via SPARLS (the first and second half of the
% array repres... |
function trace = CS5320_const_vel(x0,y0,vx0,vy0,del_t,max_t,R)
% CS5320_const_vel - constant velocity forward simulation
% On input:
% x0 (float): initial x location
% y0 (float): initial y location
% vx0 (float): x speed
% vy0 (float): y speed
% del_t (float): time step
% ma... |
function obj = vec2skew(vec)
k = vec;
kx = [0 -k(3) k(2) ; k(3) 0 -k(1) ; -k(2) k(1) 0]
obj = kx;
end |
function csvText = id2csv(S, id, name, t, delimiter, strName, strDate)
%% Write the found sequences to a csv text
% Final csv file in excel should look as follows:
% 1 | Sequence 1 | | | ...
% 2 | strName: | name1 | name2 | ...
% 3 | strDate: | date1 | date2 | ...
% 4 | strDate: | date2 | ... |
function save_video(frame,filename)
video = VideoWriter(filename);
open(video);
writeVideo(video,frame);
close(video);
end |
function pic = monopic(pic0)
% converts a given 8bit picture to a monochromatic single precison pciture
mono = round((3 - length(size(pic0)))/2);
if mono
pic = double(pic0);
else
pic = double(pic0(:,:,1));
end;
|
function out = ShermanIteration(l,u,p,x,y,b,rank)
%% ~~SPARSE VERSION~~
% ShermanIteration() solves the equation
% (A^-1 + A^-1X(I + Y^TA^-1X)^-1U^tA^-1)b = out
% Where the LU factorization of A^-1 is already given
% PA^-1 = LU
% and rank is the size of x and y
temp = l\p*b;
invAb = u\temp;
... |
function nwires = preprocess_wires(wires)
%PREPROCESS_WIRES Summary of this function goes here
% Detailed explanation goes here
wcount = size(wires,1);
threshold = 5;
% sort wires to smaller end first
for i=1:1:wcount
if abs(wires(i,2)-wires(i,4)) < threshold % horizontal
if (w... |
function [net, varargout] = train(net,input, trainmaterial, learningparameter, beta, nIterations)
% Trainingsfunktion die mit gewünschter Traingsmethode das gewählte Netz trainiert.
% learningparameter entspricht der Lernrate in der BB. beta bestimmt den
% Momentumsfaktor in der BB
input=input(:); % forme INp... |
function [ ac_v, ac_a, ac_s, ac_va, ac_as, ac_vs, ac_vas ] = evaluate_all( features, Pu, Zu, labels, semantic,ClassLabels, D1, D2, gamma)
image_v = features;
image_a = learn_coefficients_noise(D1, image_v, gamma);
image_s = D2 * image_a;
class_s = semantic;
class_a = learn_coefficients_noise(D2, class_s, gamma);... |
clear; close all;
addpath('/home/istin/g2o_simulator_data/');
h_plain_full = load('h_PLAIN_full.txt');
h_plain_reduced = load('h_PLAIN_reduced.txt');
% h_plain_CS = load('h_PLAIN_CSFORMAT.txt');
h_amd = load('h_AMD.txt');
ch_l_amd = load('chol_lower_AMD.txt');
ch_u_amd = load('chol_upper_AMD.txt');
perm = amd(h_plain_... |
%% test_sys_helical.m
% This test script is mainly for testing the helical system geometry,
% helical reconstruction, and cone-beam artifacts
%
% Meng Wu at Stanford University
% 2013 - 2014
%% Load simulation parameters and datas
load 'temp.mat';
% load phantom
[phan, map] = loadXCATPhantom(p);
turns = 8;
% feel ... |
clear all;close all;clc;addpath(genpath('.'));
% 待定参数
load I.mat
scale = 1.5;
l1 = 0.45/scale;
l2 = 1.0/scale;
l3 = 1.31228/scale;
l4 = 0.28445/scale;
l5 = 0.4/scale;% 连杆长度mm
m = [205.811,102.832,267.675,25.069,10.895,3.354]; % 质量
r = [-209.222,130.066,-63.899;
-546.723,46.512,-305.326;
-1.664,73.29... |
% nTest = size(XTest, 1);
X = XTrain;
y = yTrain;
% m = mean(XTrain);
% s = std(XTrain);
% X = [bsxfun(@rdivide, bsxfun(@minus, XTrain, m), s)];
% y = yTrain;
% W = [bsxfun(@rdivide, bsxfun(@minus, W, m), s)];
[nTrain,f] = size(XTrain);
class = unique(y);
nClass = size(class, 1);
intervals = 1 : floor(nTrain/10) ... |
%
% BINARY MASK
%
% Provides a binary mask for image magnitude signal for either 2D or 3D
% images.
%
% The method is based on Parseval's Theorem that states that sums of the
% squares of all the image pixels is equal to the sums of the squares of
% all its kspace pixels.
%
% The inverse FFT used to create t... |
pkg load control;
pkg load signal;
pkg load image;
fs = 8000;
f0 = 120;
t = 0:1/fs:0.5;
a = [1.0000,1.1117,0.9060, 0.0457, -0.4558, -1.0525, -1.3063 , -1.2087 , -1.0577 , -0.2966 0.1814 ,0.9909 , 1.1484 , 1.3449 , 1.0874 , 0.5880 , 0.0675 , -0.7861 , -1.1866 , -1.1015;];
dur = 1024;
... |
function [] = drawROCCurve()
%% 加载统计表
load('table.mat');
%% 绘制ROC曲线
[p, ~, mu] = polyfit(FalsePositivesNum_Array, DetectionRate_Array, 3);
FalsePositivesNum_Array1 = 0: 0.1: 70;
f = polyval(p,FalsePositivesNum_Array1, [], mu);
figure('Name', 'ROC curve for face detection', 'NumberTitle', 'off');
plot(FalsePositives... |
%-- 2014/10/4 上午 10:28 --%
version
memory
cd
dir
1+2+3
i*i
sin(pi)
4^2
clear all
x=2;
pw_D=i
pi
format long g
pi
inf
g='star'
g+1
str(g+1)
string
string(g+1)
num = '30'
str2num(num)
str2num(num)+1
whos
why
fuck
why
fuck
how
fuck
suck
clc
what
clear x
lookfor QR
bb=[1 2 3
4 6 7
8 9 10]
inv(bb)
ans*bb
eye(100)
magic(2)
m... |
clear dev;
fc = 95e6;
fs = 5e6;
dev = limeSDR();
dev.rx0.frequency = fc;
dev.rx0.samplerate = fs;
dev.rx0.bandwidth = fs;
dev.rx0.enable;
dev.start();
%% Loop capture
capture_duration = 10e-3;
DISP_TIME_SEC = 2;
figure;
xlabel('Frequency (MHz)');
title('Absolute value');
N = fs * capture_duration;
dt = 1 / fs;
df = 1... |
function [A,B]=calculateAB(clus,fc)
class=unique(clus);
kk=length(class);
A=cell(1,kk);
B=cell(1,kk);
for i=1:kk
A{i}=find(clus==i);
B{i}=find(fc==i);
end
|
function ClosestWPs = RecognizeWPkdTree( WPTContour, kdTreeFilePath, FeatureType, closest )
%RECOGNIZEWPKDTREE Return the k-NN of the given contour (WPTContour) in the
%given kdTree structure (kdTreeFilePath).
%The kdTree file contains the kdTree structure of the embedded vectors of the
%Lexicon with FT FeatureTyp... |
nSl = 9;
for i = 1:nSl
fileName = strcat('F:\CMUlab\breath detect\trainData\sl',num2str(i),'.wav');
w = wavread(fileName);
w = w(:,1);
e = dot(w,w)/length(w);
esl(i) = log(e);
end
figure
plot(esl,'b.');
hold on;
nExhale = 22;
for i = 1:nExhale
fileName = strcat('F:\CMUlab\breath detect\trainDa... |
% matlab script to copy every Nth file from one folder to another folder
% This function samples the Input data so that openMVG need not be run on
% consecutive frame where same features are observed in a relatively less
% displacement
function[sampledFolder] = sampleInputTango(folder, sampleRate)
imgFiles =... |
function [env, rms_level_band, rms_level_signal] = extractEnvelope(s,Fs,fl,fu,f_cutoff_lp)
% extract the envelope using bandpass-filtering (for channel, or 20-2000 Hz
% hearing range), half-wave rectifying, and low-pass filtering
% bandpass filter: 6-th order Butterworth
% lowpass filter: 3-rd order Butterworth
... |
%analysis through all time steps
%nota bene: does not include artifacts of cell movement
%clearing parametres from "analize"
clear avint k intt
%nuclins;
% number of iterations
mt = max(t)-1;
def = [1:mt];
for i = 1 : naio %iterating for each time point
% ESTIMATION OF BACKGROUND FOR SUBTRACTION
... |
function VOLWrite(address)
% clc;
% clear all;
% close all;
path = 'voldata.vol';
fid = fopen(path);
visu=1;
%--------------------------------------------------------------------------
% File header read
header.Version = fread( fid, 12, '*int8' );
header.SizeX = fread( fid, 1, '*int32' );
header.NumBScans = fread... |
function f_morph(iFile,emotion,method,durRate,f0Rate,spRate,workDir)
%F_MORPH Summary of this function goes here
% Detailed explanation goes here
addpath('/home/lixian/speech/MatlabCode/STRAIGHT/TandemSTRAIGHTmonolithicPackage002Test');
prjdir=[pwd '/..'];
% iFile=201;
% emotion='sad';
% method='twotier';
% durRat... |
function initTESTBED(addr)
global TESTBED
if nargin<1 | isempty(addr) addr='all'; end
TESTBED.retry=3;
%TESTBED.anchorNodes=[10 12 16 18];
xy = TESTBED.xy(:,1) +TESTBED.xy(:,2)*1i;
[X1,X2]=meshgrid(xy);
TESTBED.distanceMatrix=round(abs(X1-X2));
TESTBED.bx = [min(0, min(TESTBED.xy(:,1))) max(TESTBED.xy(:,2)) min(0, min... |
clear; clc; setup; config_re_los;
%% ! R-E region for IRS-aided NLoS and LoS channels
reNlosSample = cell(nChannels, 1);
reLosSample = cell(nChannels, 1);
reNlosSolution = cell(nChannels, 1);
reLosSolution = cell(nChannels, 1);
for iChannel = 1 : nChannels
% * Generate tap gains and delays
[directNlosTapGain... |
function yVectorsToPlot = getErrorVectors(results_vector,numMolecs_vector)
%
% Created by Isabel Llorente-Garcia, July 2012.
% If you use this code please acknowledge Isabel Llorente-Garcia in your
% publications.
%
% Group results and plot mean errors.
%
% INPUTS:
% - results_vector: vector such as [r11 r12 r13], whe... |
clear all
para_id='D020';
config_io;
for i=1:10
outp(hex2dec(para_id),i);
WaitSecs(1);
outp(hex2dec(para_id),0);
end |
n = 3;
xlist = 0:0.01:1;
xs = 0.5*(1-cos(((0:n)+0.5)*pi./(n+1))); %chebyshev
fs = exp(xs);
fvals = exp(xlist);
dd = divdif(xs,fs);
ls = 0.996294+0.997955*xlist+0.536722*xlist.^2+0.176139*xlist.^3;
ps = dd_interp(xs,dd,xlist);
error1 = fvals - ls; %least squares
error2 = fvals - ps; %chebyshev
plot(xlis... |
clear;
disp('please inpute 3 numbers (0-10)');
b = round (rand(1,3).*10);
for i = 1 : 3
Number(i) = input (sprintf('please input the %d number: ',i));
end
while (sum (b==Number)) ~=3
dd=(b==Number);
for j = 1:3
if dd(j)==1
fprintf('The %d place number is correct!\n',j);
end
... |
function FinalS = ComputeSaliencyMap(RGB,s)
% Compute Saliency Map
% [RETURNS]
% FinalS : Saliency Map
%
% [PARAMETERS]
% RGB : the input image
% s : resize factor
% [HISTORY]
% Jan 19 2010 : created by Hae Jong
FinalS = zeros(size(RGB,1),size(RGB,2));
Lab = im2double(colorspace('Lab<-RGB',RGB));
for c = 1... |
%% Regression analysis
%% Initialising
clc;
clear;
close all;
x1 = [-3 -2 -1 0 1 2 3];
y1 = [0.2774 0.8958 1.5651 3.4565 3.0601 4.8568 3.8982];
x2 = [0.8 1.4 2.7 3.8 4.8 4.9];
y2 = [0.69 1.00 2.00 2.39 2.34 2.83];
poly_features = [1 3 5 7];
len = length(poly_features);
%% Question 1
figure(1);
for i = 1:len
... |
function [AVG, SEGS, REJ] = SegAndAvg ( data, positions, window, varargin)
% SEGANDAVG returns the average (as well as the segmented matrix) of the
% input data segmented over event-windows. The function accepts data of any
% dimension, with segmentation occuring over one defined dimension.
%
% It is also possible to... |
function orthospm5(roi, threshold, onsets, window ,spm_file, anat_file, tseries_path, func_root, cx,cy,cz )
% function result = orthospm5(
% roi_radius,
% threshold ,
% onsets,
% window
% [,spm_fil... |
function sys = plus(sys1,sys2)
%PLUS Add two polysys objects together.
%
% SYS = plus(SYS1,SYS2) connects the inputs and outputs of SYS1 and SYS2
% together to form a system of the same size. Thus, SYS1 and SYS2 must
% have the same dimensions.
%
% See also POLYSYS/MINUS, POLYSYS/UMINUS, POLYSYS/MTIMES, POLYS... |
%
% estraiMessaggio
% Toglie il padding da un messaggio, se presente
%
% Input
% msgPadded : Messaggio con possibile pad
%
% Output
% msg : messaggio senza padding
%
function msg = estraiMessaggio (msgPadded)
% Lunghezza del messaggio
n = length(msgPadded);
% Estraggo l'indice del primo 129 presente nel... |
% Add mexopencv lib
addpath 'D:\Project\Matlab\mexopencv'
% Parameters
% Input
SEQ_NAME = 'motorrolling';
IMG_DIR = sprintf('D:/Dataset/tracking/seq_bench/%s', SEQ_NAME);
GT_FILE_NAME = 'groundtruth_rect.txt';
detector = cv.BRISK();
gt_file_path = sprintf('%s/%s', IMG_DIR, GT_FILE_NAME);
gt_rects = importdata(gt_fil... |
clear
clc
DATA = csvread('transfusion.data');
% - - - - - Zmienne
L_SIZE = 200;
T_SIZE = 50;
% - - - - - Przygotowanie danych
l_data = zeros(L_SIZE,4);
l_data_correct = zeros(L_SIZE,1);
t_data = zeros(T_SIZE,4);
t_data_correct = zeros(T_SIZE,1);
for i = 1:L_SIZE
l_data(i,:) = DATA(i,1:4);
l_data_correct(i... |
% FuseZeroAltitude.m
% Very basic fusion of the Vectornav and Hokuyo sensor data
% It simply ignores the GPS altidude data and replaces it with zeros.
% Remove all Lidar Data before and after the IMU is available
I = or(Lidar_Timestamp < IMU_Timestamp(1), Lidar_Timestamp > IMU_Timestamp(end));
Lidar_ScanIndex(I) =... |
function HCRegionMaker(baseV, baseR, gammaVal, betaVal, maxT, figNum, ...
AirSimDataWanted)
if (AirSimDataWanted)
simName = 'AirSim: ';
else
simName = 'MATLAB sim: ';
end
figure(figNum);
title(['\fontsize{24}' simName 'Homicidal Chauffeur, \gamma = ' ...
num2str... |
function [b,bint,r,rint,stats] = regress(y,X,alpha)
% 多元线性回归 y = b1*x1+b2*x2+…+bp*xp
%[b,bint,r,rint,stats] = regress(y,x,alpha)
% 其中
% y:y的数据n*1向量
% x:x的数据n*p矩阵
% b:b的估计值
% bint:b的置信区间
% r:残差r =Y-X
% rint:r的置信区间
% stats:检验统计量,第一值是回归方程的置信度,
% 第二值是F统计量值,第三值是与F统计量相应的p值,
% F很大而p很... |
% CMPU250 - Professor Eric Aaron
% Final Project - Kyle Patterson
% May 2018
% ####################################################################
% ### ###
% # ... |
function y = orthoproj(vector, orthonormal_vectors)
A = vector;
k =1;
result = 0;
for B = orthonormal_vectors(:,k)
C =(dot(A,B)/norm(B)^2)*B;
result = result +C;
k = k +1;
end
y = result;
end |
function preprocessed_data = fun_preprocessing( data, level, delay, sigma, show_plot )
% PREPROCESSING This MATLAB function returns the signal y which is
% preprocessed by means of the following steps:
% - Removing DC offset ;
% - Removing the peaks ;
% - High-pass filtering ;
% ... |
fun = @(x) 1/sqrt(x + 1);
root = 0;
prevRoot = input('enter initial value: ');
for i = 1:1:100
root = fun(prevRoot);
if abs(fun(root) - fun(prevRoot)) <= 0.0001
break;
else
prevRoot = root;
end
end
fprintf('ans = %f\n iteration: %d\n', root, i); |
function [R,f] = f_k_cls(h_fft,Y_fft,c_fft,alpha)
R = zeros(size(Y_fft,1),size(Y_fft,2));
l = ((abs(h_fft)).^2)+(alpha*((abs(c_fft)).^2));
for i = 1:1:size(Y_fft,1)
for j = 1:1:size(Y_fft,2)
if(abs(l(i,j))~=0)
R(i,j) = conj(h_fft(i,j))/l(i,j);
else
R(i,j) = 0;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.