text stringlengths 8 6.12M |
|---|
function [St,Ht,Gt,coef,xout,ju,coefint]=s_tide_m2(xin,IDP1,IDP2,IDP3,tides,ntides,n1,dt)
%Haidong Pan(Ocean University of China) 2020/01/14
%email:1027128116@qq.com
% s_tide主程序的修改版本
% A modified version of s_tide
%前n1个分潮使用IDP2个独立点方案,其余分潮使用IDP3个独立点
%The first n1 tidal constituents use IDP2 independent points whil... |
%% INITIALIZE MATLAB
clear all;
clc;
close all;
format long;
%% DASHBOARD
% Initial parameters; defined by paper
Pe = 10579.5; % psia
P_AF = 8856.2;
Pw = 7998.9;
r_AF = 5.9; % ft
re = 626.1; % ft
Tr = 250; % degrees F
rw = 0.583; % ft
phi = .3;
k = .25; % darcy
PI = 3.1; % bbl/psi
Pb = 4000; % psi
... |
function [L, S, numIter] = pgrpca_2(M)
% Parametros
% M - m x n imagen en matriz
%
% Parametros intrinsecos del algoritmo
% tol - tolerancia para parar el algoritmo
% maxIter - numero maximo de iteraciones
% mu - parametro de relajacion
%lambda - peso
%
% Salida:
% [L, S] - estimadores de la matriz de rango bajo y de ... |
v=input('enter the veciloty in Hertz\n');
a=input('enter the gravity\n');
r=(340*v)^(2)/(9.81*a) |
function h=ftran(x)
h=20*log10(sqrt((1+x)*exp(-x)))+100;
|
classdef ProfileMatrix %<AbstractTsMatrix
%PROFILEMATRIX 截面矩阵,N*p, 是某个特定时间上的截面
%纵轴:assets,N个
%横轴:properties, p个
%时间:标量
properties (SetAccess = 'public', GetAccess = 'public', Hidden = false)
% dataname %single data name
des %description
datatype = 'v... |
function featnew=randomsets(featau,featcasia)
%get random samples from combined sets
N=921;%random select 921 authentic images
idx=randperm(921+800);
featnew=[featau;featcasia];
featnew=featnew(idx(1:921),:);
selection=idx(1:921);
numau=sum(selection<=921);
numcasia=sum(selection>921);
fprintf('number of ori... |
function mat = gauss2d(mat, sigma, center)
gsize = size(mat);
[R,C] = ndgrid(1:gsize(1), 1:gsize(2));
mat = gaussC(R,C, sigma, center);
function val = gaussC(x, y, sigma, center)
xc = center(1);
yc = center(2);
exponent = ((x-xc).^2 + (y-yc).^2)./(2*sigma);
val = (exp(-exponent));
end
end |
%% Testing flow:
% (1) pick 100 sepsis patients as training set
% (2) perform cross validation for hyper parameter picking
% (3) pick another 100 sepsis patients as testing set
% (4) perform "on-line" testing and calculate the score (both MSE and correlation)
load('/memex/lifangc/COS597D_Project/share/raw_data_5000_pa... |
function y = phi(i, x, a, h)
% Phi: a base function for third degree
% polynominal interpolation
% y = phi(i, x, a, h)
% ` calculate the value of base function
% INPUTS:
% i - number of base function
% x - input of function
% a - beginning of interpolated range
% h - step size
% OUTPUTS:
% y - value described by... |
function[dispersion] = calculo_dispersion_pendiente(x, y)
% esto está pensado para descartar perfiles que en uno de sus lados no
% tienen pocos puntos, pero lo que ven es ruido. Si es un perfil espero que
% la pendiente esté bastante bien definida
paso_x = diff(x);
paso_y = diff(y);
... |
function [GMI, MI] = qam_gmi(C, SNR, Pk)
%QAM_GMI Compute MI and GMI for QAM
% Use this function to compute MI and GMI for M-QAM
% constellations in an AWGN channel using Gauss-Hermite quadrature.
%
% Usage: [gmi,mi] = qam_gmi_mex(C, SNR, Pk)
% C := Complex constellation in Gray-mapping order
% SNR := Vect... |
function [nv, nf, tris, sibhes, v2he] = split_face_surf(fid, nv, nf, ...
tris, sibhes, v2he) %#codegen
%SPLIT_FACE_SURF Split a face and insert a new vertex into it.
% SPLIT_FACE_SURF(FID, NV, NF, TRIS, SIBHES, V2HE) splits triangle FID into
% three triangles by inserting a vertex into it and updates the co... |
%
% EXTRACT_COAST: Driver to extract coastline data
%
% This is a user modifiable script that can be used to extract coastline
% data from the GSHHS database at the specified coordinates.
%
% svn $Id: extract_coast.m 586 2012-01-03 20:19:25Z arango $
%===============================================================... |
fig_path = fileparts(mfilename('fullpath'));
load([fig_path, '/' 'window_rep_total_power.mat'])
%% normalize powers by the original mean power
base_factor = tot_orig;
tot_erp_n = tot_erp./base_factor;
tot_orig_n = tot_orig./base_factor;
tot_sub_n = tot_sub./base_factor;
tot_diff_n = tot_diff./base_factor;
clear H
f... |
function J = calc_diff_num(x, param, diffType, calcMode, extraParam)
% diffType = 'symmetrical'; % forward backward central symmetrical
switch diffType
case 'forward'
h_offset1 = +1;
h_offset2 = 0;
case 'backward'
h_offset1 = 0;
... |
% Determinacao de A para MTD2
%% Base de dados Ninapro
ninaproList = ls('database/ninapro2/S*_E1*');
numberOfSubjects = length(ninaproList);
numberOfChannels = 12; % 17 movimentos * 6 repeticoes
A_value = zeros(numberOfSubjects, numberOfChannels);
for currentSubject = 1:numberOfSubjects
fprintf('currentSub... |
clear all
close all
%% Operating Initializations for: Keyboard responses, Sounds, IOPort, Screen %%
%Setting up basic operations for MATLAB EEG Experiment
%Coded by Alex Tran, PhD, (c) 2018
%Questions? 9trana@gmail.com, a_tran@hotmail.com
%****Keyboard****%
%Sets the default numerical codes for each key ... |
% calculate the median absolute error (MAE) for the ID-replication curve,
% for full set fit, LOOCV 1-shot and LOOCV 2-shot.
%% parameters:
n_case = 6; % num of GAN curves
% an array of all the dataset ID values:
x_tmp = [22.02, 24.70, 27.41, 28.99, 30.34,...
11.90, 15.97, 17.30, 21.34, 23.29,...
14.... |
function [trials, runningVals, quitKeyPressed] = RunNextTrial(obj, trials, settings, runningVals)
% RUNNEXTTRIAL - Run the next trial in the session, based on the current
% trial number (runningVals.currentTrial) and the data in the 'trials'
% struct array. Returns updated copies of 'trials' and 'runningVals'. This
% f... |
run ~/3rd_party_libs/vlfeat-0.9.19/toolbox/vl_setup
run ~/3rd_party_libs/matconvnet/matlab/vl_setupnn
epflDatasetPath = '~/data/epfl-gims08/tripod-seq/';
Pascal3D = '~/data/PASCAL3D+_release1.1/';
VOCDevkitPath = '~/data/VOCdevkit';
featType = 'hog'; % one of 'imgrad', 'hog', 'cnn'
imScale = 0.8; % scale ... |
% setupDaqMux( rootPath, type )
% rootPath - sysgen root path
% type - type of data to take 'debug' 'adc' or 'dac'
%
% setupDaqMux( rootPath, type, channel )
% rootPath - sysgen root path
% type - type of data to take 'debug' 'adc' or 'dac'
% channel - adc/dac chann... |
function [x,y,xc,yc]=Trim(x,y,xc,yc)
n=size(x,2);
for times=1:15
conv=length(find(xc));
for j=1:n
if length(find(xc(j,:)))+length(find(xc(:,j)))-(xc(j,j)~=0)<=1
xc(j,:)=0;
xc(:,j)=0;
yc(j,:)=0;
yc(:,j)=0;
end
end
if conv==length(find(xc))
... |
% Sample 11
Domain.InputVertex = [ 0 0
5 0
5 5
0 5];
Domain.Boundary.Values = [1 2 3 4] ;
Domain.Holes.Hole = [];
Domain.Segments.Segment = [];
BC.Values = 1;
BC.Boundary.Values = [1 1 1 1];
BC.Holes.Hole = [];
BC.Segments.Segment = [];
BC.InputVertexValues = [1 1 1 1];
RefiningOptions... |
I = imread_ncut('../data/test/256_OC/ak47_1.jpg', 224, 224);
figure(1);clf; imagesc(I);colormap(gray);axis off;
nbSegments = 5;
tic;
[SegLabel,NcutDiscrete,NcutEigenvectors,NcutEigenvalues,W,imageEdges]= NcutImage(I,nbSegments);
% figure(2);clf; imagesc(imageEdges); axis off;
% figure(3);clf
% bw = edge(SegLabel,0.01);... |
%% Generate best fit function
start_vy = [-0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8];
target_vy = [0];
start_vx = 0.0;%[-0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4];
target_vx = [0];
T = 0.4;
subfolder_name = 'library4';
if ~exist(fullfile('local', subfolder_name, 'transition_fitting'), 'dir')
mkdir(fullfile(... |
function [mm ds_x s1]=makematchmatrix(ds_seeds,x,c,d,f,type)
s1=loadseason(x);
sx = ds_seeds(ds_seeds.season==x,:);
sortx = sortrows(sx,{'team'});
sxcomb = combnk(sortx.team,2);
% generate all combinations of team1 vs team2, naturally lower ID is first
sxnames = strcat(x,'_',num2str(sxcomb(:,1)),'_',num2str(sxcomb(:,2... |
%% Counter / Stim Session Setup
%imRef = randn(512);
nFrame = 30;
scanRate = 30;
frameCount = [zeros(nFrame-1,1);1];
hFrameCounter = daq.createSession('ni');
addDigitalChannel(hFrameCounter,'ExtGalvo','Port0/Line3','OutputOnly');
hFrameCounter.IsContinuous = 1;
addClockConnection(hFrameCounter,'External','ExtGalvo/PFI... |
%implementation of the Matern-3/2 kernel
classdef matern32 < kernel
properties
ls;
var;
noise;
end
methods
%constructor
function obj = matern32(ls,var,noise)
obj.ls = ls;
obj.var = var;
obj.noise = noise;
end
... |
% ======================================================================
% DECENTRALIZED LOAD FREQUENCY CONTROL FOR A POWER SYSTEM WITH HIGH
% PENETRATION OF WIND AND SOLAR PHOTOVOLTAIC GENERATION
% ======================================================================
clc
clear
close all
% Simulation time
Ts = 50e-3... |
function qubit = oracle(qubit)
qubit(1) = -qubit(1);
end |
% Pentagonal numbers are generated by the formula, Pn=n(3n?1)/2. The first
% ten pentagonal numbers are:
%
% 1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...
%
% It can be seen that P4 + P7 = 22 + 70 = 92 = P8. However, their
% difference, 70 ? 22 = 48, is not pentagonal.
%
% Find the pair of pentagonal numbers, Pj and P... |
function obj = setDimension(obj, dim)
% Sets the dimension of the NLP variable vector
%
% Parameters:
% dim: the dimension of the vector @type double
assert(isscalar(dim) && dim >=0, 'The dimension must be a scalar positive value.');
obj.Dimension = dim;
end |
function [r,az,el,x,y,z,full_vector_set]= difference_analysis(obj,datafolder)
% Creates figures that show the projections of difference vectors onto the
% dominant eigenvectors of the lead matrices. Also takes projections of
% difference vectors onto the dominant difference eigenvectors.
% INPUT:
% obj: ... |
function fig = cometKinematicTrial(P,marker,iTrial)
%COMETFILTER Make comet tail for kinematic marker
%
% fig = preview.cometFilter(wp,marker,iTrial);
%
% Inputs
% P - Table of kinematic data, after cleaning step
%
% Output
% fig - Figure handle
%
% See also: cpl
if ~strcmp(P.Properties.UserData.status,'clean')
... |
%
% Overdrive example simple call of DAFX symclip function
close all;
clear all;
filename='acoustic.wav';
% read the sample waveform
[x,Fs,bits] = wavread(filename);
y = symclip(x);
% write output
wavwrite(y,Fs,bits,'out_overdrive.wav');
figure(1);
hold on
plot(y,'r');
plot(x,'b');
ti... |
function [Yis,Ytis,Mis,Mislack_Vr,Mislack_Vq] = buildYMmats(mpc)
define_constants;
[Y,~] = makeYbus(mpc);
n = size(mpc.bus,1);
idxslack = find(mpc.bus(:,BUS_TYPE) == REF);
alleis = eye(n);
Yis = cell(n,1);
Ytis = cell(n,1);
for i = 1:n
ei = alleis(:,i);
Yi = ei*ei.'*Y;
Yis{i} = 0.5*[real(Yi+Yi.') imag(Yi.... |
function [timeout,dataout] = mm_filt(timein,datain,impulsein,orig_step)
%MM_FILT Function for filtering time series with missing or NaN data
% This function used standard convolution for filtering. However, the
% input time series is filtered piecewise in case missing data or NaN
% exist in the input data
%
%
% ... |
start = tic;
[y, res, I ] = powerRank(B', 0.85, 10e-9);
ends = toc(start)
|
close all; clear all;
f=fopen('test14_45w.dat','rb');
D=fread(f,[4, inf],'int16');
fclose(f);
T = D.';
data = T(:,4);
signal = data(1:4000);
aquisitionFrequency = 500;
cutFrequency = 40;
centralFrequency = 60;
Tempo1=0:(1/aquisitionFrequency):((length(signal)-1)/aquisitionFrequency);
[px1, w1] = pwelch(s... |
function bin=binStruct2bin(binStruct)
counter = 1;
for i = 1:length(binStruct)
for j = 1:length(binStruct{1,i})
counter = counter+1;
end
end
h = waitbar(0,'Prepare the aligned spectra...');
dummy = 1;
% Initialise the bin that holds the alignment results
field1 = 'mz'; value1 = zeros(1,10);
field2 = 's... |
function [T,Recycle,Product,Area] = StrippingSingleCompressor(Feed,nS,alpha,phi,theta,Pi)
% Create Feed Stream
F_Stripping = Stream.create_table(nS+1);
F_Stripping(1) = Feed;
% Create the Side Stream
R_Stripping = Stream.create_table(nS);
% Create Enriching Stage Membrane
for i = 1:nS
Membrane_stripping... |
function [topo, t_start, t_stop, f_start, f_stop] = my_tftopo(tf, times, freqs, timerange, freqrange, chanlocs, makeplot, plotoptions)
% [topo, t_start, t_stop, f_start, f_stop] = my_tftopo(tf, times, freqs, timerange, freqrange, chanlocs, makeplot, plotoptions)
%
% Computes a topography for a time-frequency window:
% ... |
function ex1(rrr)
% Clear the command prompt, close all windows and clear the workspace
clc; close all; clear;
w = [0.6,-0.2]; % The connections weights. Initialized by random weights.
bias = 0.9; % The output neuron threshold
learningRate = 0.2; % The learning rate
% Maximum iteration... |
function result = bwdSub( matrix, rhs_vector )
problem_dim = size(matrix,1);
result = zeros(problem_dim, 1);
for r = problem_dim:-1:1
res_element = rhs_vector(r);
for c = r+1:problem_dim
res_element = res_element - matrix(r,c) * result(c);
end
res_element = (1./matrix(r,r)) * res_element;
... |
function [ strout ] = labeltoletter( label)
%把标签转化成字符
cout=1;
for i=1:size(label,2)
if label(i)>=1&&label(i)<=10
strout{cout}=num2str(label(i)+47);
cout=cout+1;
fprintf('%c',label(i)+47)
elseif label(i)>10&&label(i)<=36
strout{cout}=num2str(label(i)+54);
cout=cout+1;
... |
function [pairs,pairs2] = Group3DPoints(p,d,zxr)
% Group3DPoints( p, d )
pos=p;
gn=0;
pairs2=[];
tmppair=[];
while ~isempty(pos)
%creat new group
if isempty(tmppair)
tmppair=pos(1,:);
pos=pos(2:end,:);
gn=gn+1;
pointer=1;
end
addpair=[];
addind=ones(siz... |
%Joseph Young jryoun23 1210653766
% function to create a vocabulary from multiple text files under folders
function feat_vec = cse408_bow(filepath, voc)
intVector = zeros(size(voc));
docVoc = cell(0,1);
stopword = {'ourselves', 'hers', 'between', 'yourself', 'but', 'again', 'there', ...
'about', 'once', 'during'... |
function CC_init_gui(varargin)
handles=varargin{1};
handles=guidata(handles.figure1);
var1=handles.var1;
var2=handles.var2;
spikeData=handles.spikeData;
spikeMatrix=handles.spikeMatrix;
ClusterAllocation=handles.ClusterAllocation;
cluster_vector=unique(ClusterAllocation);
cluster_vector(cluster_vector==0)=... |
function res = face_db_align_patch(face_dir, ffp_dir, ec_mc_y, ec_y, img_size, patch_size, save_dir)
% center of eyes (ec), center of l&r mouth(mc), rotate and resize
% ec_mc_y: y_mc-y_ec, diff of height of ec & mc, to scale the image.
% ec_y: top of ec, to crop the face.
crop_size = img_size;
% fid_log = fopen('log... |
%% Engine Thrust Estimation
%% Variables
RO_SS=1.225;%density in sea level at standard condition
T_SS=288.16;%temperature in sea level at standard condition
g=9.81;%garvitrsal air const
E=0.75;%propellor efficiency
R=287;%universall const of air
a1=-6.5*10^(-3);%slope in Troposphere
s=56.36;%area of wing
w=21000*g;%pl... |
function [id_extend] = Ind_extend(id, numscale)
% Generate the new index in the sequence of new samples
id_extend = zeros(1, length(id)*numscale);
for i = 1:length(id)
range = (id(i)-1)*numscale+1: id(i)*numscale;
id_extend((i-1)*numscale+1:i*numscale) =range;
end
end |
function plot_granger( G, fitted, freqs, ids, C )
G_mean = mean( G, 4 );
inv_func = fitted.inverse_function;
func_name = func2str( inv_func );
params = fitted.data;
p_value = 0.001;
n_freqs = numel( freqs );
inv_p = 1 - p_value;
n_combs = size( C, 1 );
conf_level = zeros( n_combs, n_freqs );
NC = size( C, 1 );
z_sc... |
%Script to run all granger_stim analyses
binsize = 0.002;
nK_lfp = 20;
files = dir('../data/*_traces.mat');
%Run on all files with different preprocessing steps
%Set this to true to plot the results that have been previously save
plotting = false;
%plotting = true;
%only downsample
%Generate from scratch
pf = @(mf,... |
% Rozdělení bodů pomocí Bayesova klasifikátoru
function [ ] = bayes( tridy2, stredy )
% tridy = rozdělení bodů do shluků
% stredy = středy shluků
data_size = size(tridy2);
[pocet_shluku,~] = size(stredy); % počet shluků
velikost_shluku = zeros(1, pocet_shluku); % počet bodů v jednotlivých shlucích
% zjištění počtu b... |
function [cann] = WoW(obj,mu_ann,qpr_ann,ann)
%WoW Summary of this function goes here
% Detailed explanation goes here
cann = zeros(size(ann));
for i = 1:obj.rf.n_vert
tx = qpr_ann(i,1);
ty = qpr_ann(i,2);
this_tri = obj.sorted_tri{i};
v = zeros(length(this_tri),2);
... |
function ShowSturm()
% function ShowSturm()
% Illustrates the Sturm sequence property
% GVL4: Section 8.4.2
n = 20;
% Generate an nxn symmetric tridiagonal matrix...
A = randn(n,n); A = A+A'; T = hess(A);
% Use Sturm to compute every single eigenvalue...
lambda = [];
for k=1:n
lambda = [lambda;Sturm(T,k)... |
function [sigma_points, w_m, w_c] = compute_sigma_points(mu, sigma, lambda, alpha, beta)
% This function samples 2n+1 sigma points from the distribution given by mu and sigma
% according to the unscented transform, where n is the dimensionality of mu.
% Each column of sigma_points should represent one sigma point
% i.e... |
function rhs = rhs_bellman(z0,x0,x1)
% Purpose: returns the rhs of the bellman equation rf(z0,x0,x1)+beta*pmat[z0,.]'v1[x1,.]'
%
%
% Input: z0 := scalar integer, the index of the current shock in the vector _VI_zvec;
% x0 := scalar, the current value of the endogenous state variable
% ... |
function [V, M, A, MI, P, SF] = imageprops_SF(L, I, pxlsize)
% function [V, M, A, MI, P, SF] = imageprops_SF(L, I, pxlsize)
% function to return volume, mass and area of regions L in image I
% inputs: L, the label image *can also be BW mask image. should be nonzero
% in regions where the image will be analyzed; I, ... |
function [res P stats]= god_imnet_ms_slr_gen_training(D_tr,D_te,visfeat,visfeat_test,pp,P,P_te,suffix)
%
%
%% Set parameters:
P.script_name = mfilename;
P.date_time = datestr(now,'yyyy-mm-dd HH:MM:SS');
%% ----------------------------------------------------------------------------
%% Reordering
% original order i... |
% aere362hw4
%load previous converged numbers
aere362hw3
% get new converged numbers with 5% increased in parameters
% find local sensitivities
% Fr from different inputs
m1=m*1.05;
Fr1=60*P/(pi*m1*z*npg)*tand(20);
senFm=(Fr1-Fr)/(m1-m)
z1=z*1.05;
Fr1=60*P/(pi*m*z1*npg)*tand(20);
senFz=(Fr1-Fr)/(z1-z)
npg1=npg*1.05;... |
%% Analitical solution
clear all;
cr = 2.5;
a = @(vx,vy) vx.^2+vy.^2;
b = @(px,vx,py,vy) 2*px.*vx+2*py.*vy;
c = @(px,py) px.^2+py.^2-cr.^2;
t1 = @(px,vx,py,vy) (-b(px,vx,py,vy)-...
sqrt(b(px,vx,py,vy).^2-4*a(vx,vy).*c(px,py))) ...
./(2*a(vx,vy));
t2 = @(px,vx,py,vy) (-b(px,vx,py,vy)+...
sqrt(b(px,vx,py,vy).... |
conf = dsp2.config.load();
epoch = 'reward';
date_dir = dsp2.process.format.get_date_dir();
kind = 'pro_v_anti_drug';
save_path = fullfile( conf.PATHS.plots, 'mua', 'psth', date_dir, kind );
do_normalize = false;
bin_size = 25;
do_save = true;
% load_path = fullfile( conf.PATHS.analyses, '081617', 'spikes' );
% % ... |
function b=tree2block4bandC(a,tanTheta)
sz=size(a);
nbk=sz/4; %nbk: the number of blocks,which is also the size of the 3rd level band
tbk=2*nbk; fbk=4*nbk; hbk=nbk/2; qbk=nbk/4; hq=nbk/8; qq=hq/2;
b=a;
%reconstruction of the DC band: ----------------------
%b(1:hq(1),1:hq(2))=ib44int(a(1:qq(1),1:qq(2)),a(1:qq(1),q... |
%Input data
%Enter the name of your CRIS.py results csv file.
CSV_file = 'Your_CRIS.py_results.csv';
%Enter the name of your CRIS.py results txt file.
TXT_file = 'results_counter Your_CRIS.py_results.txt';
%Minimun percentage to assume a pure clone. Allele1 percentage must be
%greater than this value to be classif... |
%% Ensemble + Spect:
% Tow-level-refined CM based Ensemble combines with path-based
% transformation
% Caiming Zhong, 2014/05/08
function EnsembleSpect_C
clc;
addpath([cd '/Datasets']);
addpath([cd '/Ncut']);
warning('off', 'all');
filename = char('pathbased','spiral','jain','flame','... |
%%
%==================
%Comparison of the space-time plots over a 50 second time interval -- Will
%do up to 5 plots per figure
%==================
close all
clear all
%The user should only have to change the following lines. The path
%specifies where the data is. mytitles is a cell array where entries MUST
%match the t... |
function [ VolumeIntegralX ] = matVolumeIntegral( obj, mesh, VariableX )
%> @brief Function to calculate the volume integral in y direction
%> @details Function to calculate the volume integral in y direction
%> @param[in] mesh the mesh object
%> @param[in] Variable variable used to calculate the volume integral
%> @p... |
% *************************************************************************
% MULTISCALE PROGRAM - MAIN FILE
% *************************************************************************
clear all; close all
main_example_path = '/home/javiermro/Projects/Examples';
first_mode=1; nmode = 1; Macro0 = cell(nmode,1);
TE... |
%#author John D'Errico
%#url http://www.mathworks.com/matlabcentral/fileexchange/13490
|
%hvdifferential - issue 1.3 (11/03/10) - HVLab HRV Toolbox
%---------------------------------------------------------
%[differential] = hvdifferential (timedata, nsections)
% Computes the single or double differential of time history data
%
% differential = name of new HVLab data structure containing the time in... |
function [x,num_its] = bisect2(a0,b0,f,p,n,tol)
%f(k,n,p)
% Implements the method of bisection for solving f(x) = 0 for x.
%
% Given an initial interval [a0,b0], iteratively uses the helper function
% get_new_interval to solve approximately f(x) = 0 for x to the specified
% tolerance.
%
% Variables:
%
% input: a0 - ... |
function [Am,Bm,Cm,Dm,Av,Bv,Cv,Dv] = dmpfact(A,B,C,D,tol)
%DMPFACT Minimum-Phase/All-Pass Factorization of Discrete Systems
%
% [Am,Bm,Cm,Dm,Av,Bv,Cv,Dv] = dmpfact(A,B,C,D)
%
% calculates a minimum-phase/all-pass factorization for a
% detectable system (A,B,C,D) with transfer function matrix
%... |
clear all
clc
format long
options = odeset('RelTol', 1e-6, 'AbsTol', 1e-6);
%a se papper
L = 2.7;
tspan = [0 8];
u0 = [2*pi/7 0.7];
f = @(t,u) fun(t,u,L);
[tt uu] = ode45(f, tspan, u0);
u1 = uu(:,1); %vinkel
u2 = uu(:,2); %vinkelhastighet
subplot(3,1,1)
plot(tt, u1); grid on;
xlabel('tiden');
yla... |
function [resampledPoints] = stickmanResample(points, sampleSize)
indices = randperm(size(points, 1));
resampledPoints = zeros(sampleSize, size(points, 2));
for i = 1:sampleSize
resampledPoints(i, :) = points(indices(i), :);
end |
function plot_x(Xout,Vstop,TT)
T = 1:size(Xout,2);
t = 1:size(Xout,2);
% --------------------- POSITION ----------------------------
figure;
cmap = colorcube(400);
colors = cmap([171 233 80 135 30 200 111],:);
subplot(3,1,1)
plot(t,Xout(1,:),'Color',colors(1,:),'linewidth',2);
grid on;
hold on;
plot(t(TT),Xout(1,TT)... |
function y = GAObjective(x, v, No_of_Edges, CV, D)
% pi = x(1:v)';
% qij = x(v+1:v+No_of_Edges)';
% rij = x(v+No_of_Edges+1:v+2*No_of_Edges)';
pi = x';
qij = zeros(No_of_Edges,1);
rij = zeros(No_of_Edges,1);
qij(:,1) = pi(D(:,1),1) | pi(D(:,2),1);
rij(:,1) = pi(D(:,1),1) & pi(D(:... |
function oofOFA = vesselness_OofOFA_wrapper(imageStackIn, scales)
oofOFA = zeros(size(imageStackIn));
fprintf(' OOF-OFA Slice: ')
for i = 1 : size(imageStackIn,3)
fprintf('%d ', i)
oofOFA(:,:,i) = oofofa2(imageStackIn(:,:,i), scales(1):scales(end));
end
fprintf('\n ') |
function X=Contract(tensors,contractions)
numcont=max(cell2mat(contractions));
% fprintf('numcont is %d\n', numcont);
table=zeros(numcont,2);
for k=1:length(contractions)
c=contractions{k};
for i=c(c>0)
if table(i,1)==0
table(i,1)=k;
... |
% Plot FRF for all tests in Exp 3 where k was varied while c and m were
% constant.
function rot_q10()
%% PRIOR KNOWNS:
xunits = "rad";
Jdisk = 0.0031; % [kgm^2] Mean of Disk Inertia Determined in Lab 1
k1 = mean([3.69 2.81]); % [Nm/rad] Mean First Spring Stiffness Determined in Lab 1
c1 = mean... |
%Rakete bearbeiten
breakout = 0;
%welche Rakete
dict = 1;
raketenlister %schreibt alle vorhandenen Raketen in das Array 'liste'
while(breakout == 0)
disp(liste)
prompt = 'welche Rakete soll bearbeitet werden? ';
raketenname = input(prompt, 's');
%save('vergleich','raketenname','liste');
string = raket... |
function IntSpikeInput = alpha_fun_int(t , y , spike_time , neuron_delay)
global net
% setting parameters
if ischar(net.Synapses.Internal.IntPSPFunParam)
switch lower(net.Synapses.Internal.IntPSPFunParam)
case 'def'
tau = 10;
otherwise
error('Unknown synapse mod... |
function [PC_back,cycle_back]=JZrel(PC,cycle,intmem,promem)
ACC=intmem(225,1);
rel=promem(PC+1,1);
if(ACC==0)
PC_back=PC+2+rel;
if(rel>127)
PC_back=PC_back-256;
end
else
PC_back=PC+2;
end
%cycle count
cycle_back=cycle+3;
end |
function qImage = ApplyVectorQuantizer(image, clusters, bsize)
% Function Name : ApplyVectorQuantizer.m
% Input : image (Original Image)
% clusters (Quantization Representatives)
% bsize (Block Size)
% Output : qImage (Quantized Image)
% transform image i... |
function TS = GetTorsionalStiffness(FrameData)
[~,V,~] = DirectStiffnessSolver(FrameData);
% Compute angle of twist
frontLower = rad2deg(asin(V(3,7)/((FrameData.Coord(2,8)-FrameData.Coord(2,7))/2)));
frontUpper = rad2deg(asin(V(3,5)/((FrameData.Coord(2,6)-FrameData.Coord(2,5))/2)));
averageTwist = (frontLower+frontUp... |
function ret = l_function_df_19oct12(currDir, workDir, hp_freq, downsample_freq)
% function ret = l_function_df_19oct12(currDir,workDir,hp_freq_downsample_freq)
% Leo: basic preprocessing (HP-filter, downsample) of raw converted spm8 file
cd(workDir)
fprintf('\nexecuting l_function_df_19oct12(currDir=s%,workDir=%s,... |
% %% Initiate
% rosshutdown
%
% % !!! REMEMBER TO CHANGE IP BASED ON HOST !!!
% setenv('ROS_MASTER_URI','http://192.168.87.107:11311')
% setenv('ROS_IP','192.168.87.106')
% rosinit('http://192.168.87.107:11311','NodeHost','192.168.87.106');
%
% %% Subscribe to Laser
% laser = rossubscriber('/scan');
% % Load scan, t... |
function [comp,comp_r] = filedtrip_BSS(b,target_data,config,no_of_time)
%% [Step 3:1] ICA and BSS-CCA two times
cfg = [];
cfg.channel = b';
cfg.method = 'fastica'; % fastica bsscca
comp = ft_componentanalysis(cfg, target_data);
% check the components
% average the components timelocked to the QRS-complex
cfg ... |
% håkansson resuspension 2008 & 2003
% This script calculates the resuspension from erosion-transport (ET) areas
% according to the formulations in articles
% " A Dynamic Mass-balance Model for Phosphorus in Lakes with a Focus on Criteria for Applicability and Boundary Conditions" (2008)
% " A Dynamic Model to Predict... |
function [ output_args ] = draw_circle (x,y,r,state)
%Use circles to represent real time robot
%
if(nargin==3)
color='-k';
end
if(state==1)
color='-k';
line=1;
elseif (state==2)
color='g';
line=2;
elseif (state==3)
color='r';
line=1;
elseif(state==4)
color='b';
lin... |
clc
load(strcat("mints_4_",strrep(string(dt)," ","_"),"_Chuncks.mat"));
% %% As Is Graphs
mintsCT = mints;
mintsCT.dateTime.TimeZone = 'local';
[weekDayNum,weekDayName] = weekday(mintsCT.dateTime);
hourIn= hour(mintsCT.dateTime);
mintsCT = addvars(mintsCT,weekDayNum,weekDayName,hourIn);
byDayMints = varfun(@... |
function [ data ] = GenerateData(choice, N, k, maxk, mut, muw, minc, maxc, t1, t2)
% switch choice
% case 1 % undirected and unweighted
% flagstring = ['-N' ' ' num2str(N) ' ' '-k' ' ' num2str(k) ' ' '-maxk' ' ' num2str(maxk) ' ' '-mu' ' ' num2str(mut) ' ' '-minc' ' ' num2str(minc) ' ' '-maxc' ' ' num2str(... |
function varargout = pca(varargin)
%PCA Principal components analysis.
% PCA uses sigular value decomposition on a data matrix (X) and
% returns scores (T) and loadings (P) which describe the data matrix
% X = TP'+E
%
% INPUTS:
% x = X-block (2-way array class "double" or "dataset"), and
% nc... |
clear all; rehash;
a = 1:1:9;
b = [num2str(a(:))];
fq = QuoteFuture;
fq.code = 'IH1603';
fq.futureName = 'IH1603';
mp = containers.Map('KeyType', 'char', 'ValueType', 'any');
mp(fq.code) = fq;
|
r1=4; r2=38; c1=23; c2=60;
Nbin = (r2-r1+1)*(c2-c1+1); % number of bins
NR = r2-r1+1;
NC = c2-c1+1;
indx = zeros(NR*NC, 2);
res = zeros(NR*NC, 21);
c=1;
for i=r1:r2
for j=c1:c2
indx(c,1:2) = [i j];
for n=22:56
res(c,n) = AllData{n, 3}(i,j);
end... |
close all;
clear all;
clc;
%% Data Import
global N
global dt
global angPos
global filtered_angPos
global gyro_angVel
global t
measurement_number = input('Which measurement do you want to import?');
filename = strcat('../Measurements/measurementWithFilter_',num2str(measurement_number),'.csv');
display(filename, 'Opene... |
function snapshot = EDB2makesnapshot(firstirfile,xvec,yvec,timestep,filtir,maxvalue,viewpoint,...
outlinecorners,noutlinepoints,sourcepoint,typeofir,windowsize,ampexp)
% EDB2makesnapshot - Makes a snapshot of a sound field based on IRs.
%
% Input parameters:
% firstirfile The first of the IR files
% xvec, y... |
function [JacObj,Jach, JacRes, JacRegObj, JacRegRes] = AMIGO_PEJac( theta,inputs,results,privstruct )
% AMIGO_PEJac calculates the Jacobian of the objective function.
%
% SYNTAX:
% [JacObj,Jach, JacRes, JacRegObj, JacRegRes] = AMIGO_PEJac( theta,inputs,results,privstruct )
%
%*****************************************... |
one_zero_train_label = cell(1,12);
mst_result = mst_data_preparation(cats,32,12000,0.9,12,0.05,6);
mst_test_32 = mst_result{1,2};
mst_train_32 = mst_result{1,1};
mst_label = double(train_label);
%create mst labels
first_second_label = creating_zero_one_label(12000,0.9,12);
%create network param
stage_num = 3;
neur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.