text stringlengths 8 6.12M |
|---|
function imu = TrimIMU(start_time, end_time, imu_in)
imu.utime = TrimTimes(start_time, end_time, imu_in.logtime, imu_in.utime);
imu.device_time = TrimTimes(start_time, end_time, imu_in.logtime, imu_in.device_time);
imu.gyro.x = TrimTimes(start_time, end_time, imu_in.logtime, imu_in.gyro.x);
imu.gyro.y = Tri... |
function r = pmf_PB(p)
%r = pmf_PB(p) returns the pmf of the sum of mutually independent bernoulli
% random variables whose inidivual expected values are given
% in the vector p
%
% Input:
% - p [n-vector]: non-zero probabilities of success of each of n
% individual,in... |
classdef SalesRecord
% SalesRecord Record of sale info.
properties
barcode uint64;
quantity
price
cost
time
end
methods
function obj = SalesRecord(barcode,quantity,price,cost,time)
obj.barcode = barcode;
obj.quantity = qua... |
function randomSeq = randdnaseq(N)
% returns a random dna sequence of length N
num_seq = randi([1,4],1,N);
bases = ['A','T','G','C'];
randomSeq = bases(num_seq);
end |
function [t_pulse,value]=WaitForPulseZero(port)
%[t_pulse,value]=WaitForPulseZero(port,n)
value = [];
t_now = GetSecs;%this is the time this function is called, we require that the pulse
%which is detected to arrive later than this time.
t_pulse = t_now;%if n=0, that is no wait for pulse, than pulse ar... |
% function save2database(s,fs,centroid,speaker_id,row,name)
% load("database.dat","-mat");
% load ('code_luan.mat');
row = 2;
word_id = 1;
centroid =32;
name = ["KHONG";"MOT";"HAI";"BA";"BON";"NAM";"SAU";"BAY";"TAM";"CHIN";
"KHONG";"MOT";"HAI";"BA";"BON";"NAM";"SAU";"BAY";"TAM";"CHIN"];
% s(s==0)=[];
% mfcc ... |
function sell_once_equal(obj, volume, offset, rangbu)
% 等量期权的sell_once
% sell_once_equal(obj, volume, offset, rangbu)
% 吴云峰 20161124
if ~exist('volume','var'), volume = 1; end
if ~exist('offset', 'var'), offset = '1'; end
if ~exist('rangbu', 'var'), rangbu = 1; end
call = obj.call;
put = obj.put;
if isempty(call... |
function movie_ana
animalid = '180330';
block = 5;
rfblock = 3;
electrodes = [16];
penangle = [25];
lcol = 'r';
onlymod = 0;
sfc = 0;
basepath = ['C:\Users\Julia\work\data\' animalid '\'];
supath = [basepath 'singleunits\'];
basename = [animalid '_block' int2str(block) '_tet'];
snbasename = [animalid '_block' int2st... |
%% UNUSED
function loc = sub_pixel_location(metric, loc)
loc = reshape(loc', 2, 1, []);
nLocs = size(loc,3);
patch = zeros([3, 3, nLocs], 'like', metric);
x = loc(1,1,:);
y = loc(2,1,:);
xm1 = x-1;
xp1 = x+1;
ym1 = y-1;
yp1 = y+1;
xsubs = [xm1, x, xp1;
xm1, x, xp1;
... |
function f_seconde=d_2(f, n, te)
%%Retourne la dérivée seconde de f au point n en différence finie à gauche
%f:vecteur
%n>=1 : indice
n
f_seconde=2*f(n) - 5*delay(f, 1, n) + 4*delay(f, 2, n)-delay(f, 3, n);
f_seconde=f_seconde*(1/(te^2));
end |
function [code, d] = sprintf(this, varargin)
% sprintf Print VAR model as formatted model code.
%
% Syntax
% =======
%
% [c, d] = sprintf(v, ...)
%
%
% Input arguments
% ================
%
% * `v` [ VAR ] - VAR object that will be printed as a formatted model code.
%
%
% Output arguments
% =================
%
% * ... |
function [LaneGPS,Lane_curv] = FindLaneGPS(Current_Lane_Stuct)
Lane_curv = Current_Lane_Stuct.curvature'; % NEED TO VERIFY CURVATURE HERE AS Curvature <> No of Points
seg_samp_num_target = length(Lane_curv);
lane_start_pt = Current_Lane_Stuct.start_end_point(1,:);
lane_end_pt = Current_Lane_Stuct.start_e... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Description: Use threshold method to detect eye movements (blink, frown, wink, gaze) from EOG signal.
%--------------------------------------------------------------------------------------------------------------------------------
% Use: Click "Run Se... |
function [ train_data_C1, train_data_C2, validate_data_C1, validate_data_C2, test_data ] = preprareSynDataMats( )
C1 = importdata('class1.txt');
C2 = importdata('class2.txt');
% plot(C1(:,1),C1(:,2),'ko', 'MarkerFaceColor', 'r');
% hold on;
% plot(C2(:,1),C2(:,2),'ko', 'Marke... |
function [data,numChan,labels,txt,fs,gain,prefiltering,ChanDim] = eeg_read_bdf(filename,SecLoad,reshape)
% this function loads at least "SecLoad" seconds of EEG data from the
% specified bdf-file "filename". If all available data is needed, specify
% 'all' instead of "SecLoad" like this:
% [...] = eeg_read_bdf('test.b... |
function distances = getDistances(A,B)
d1 = sum(A.^2, 2);
d2 = sum(B.^2, 2);
d = -2 * A * B';
d = d + d1 + d2';
distances = sqrt(d);
end |
%% INITIALIZATION FILE FOR JointSpaceControl.mdl
% Initializes PD control parameters and initial conditions
%% Create SerialLink for UR5
qn = zeros(1,6);
dh = DenavitHartenberg(qn);
UR5 = SerialLink(dh); % dh = [theta, d, a, alpha]
%% PD control parameters
% Natural frequency omega.
% Could be e.... |
%% FLASH sequence inplementation
% minimum TE is 10 and Minimum TR is 20
% TR<<T2
% INPUT parameters TR,TE and Alpha
%FLASH implemented here is based on the gradient echo imaging using spoiled
%steady-state imaging
%% Path preferences
% cd('C:\Users\arush\Desktop\MR_INDIA_CODE\pulseq-master_All\matlab');
% addpath(g... |
function tres = nicotransloc(stn, nsn)
% Nicotransloc quantifies the translocation of a stain into the nucleus.
% The TF (translocation factor) is a unitless value that is normalized such that
% a cell with total translocation has a value of one while a cell without any translocation
% has a value of zero.
%
% The tran... |
function showcell(id)
DRUG = 'etazolate';
lat = 40;
winsize = 100;
db = loaddb;
ix = find(strcmp(db.cell, id) & ...
strcmp(db.drug, DRUG) & ...
strcmp(db.condition, 'steady-state'))';
n = 1;
for k = ix(end:-1:1);
f = [db.cell{k} '.' lower(db.file{k})];
figure(n); n = n + 1;
sm = pspotmap(... |
clear, clc, close all,
%% Generate Gaussian data (4.2a):
% Add code below:
R1 = mvnrnd([2;2],0.02*eye(2),50);
R2 = mvnrnd([-2;2],0.05*eye(2),50);
R3 = mvnrnd([0;-3.25],0.07*eye(2),50);
scatter(R1(:,1),R1(:,2),'r');
xlabel('Feature 1');
ylabel('Feature 2');
title('Scatter of 3 Clusters of Dataset');
ho... |
function [WCL,Irrigation,ET_simu,S,runoff] = getWaterTable(policy,ET,Precipitation)
WCL = zeros(84,1);
WCL(1) = 540;
Irrigation = zeros(84,1);
policy(4) = 1;
policy(8) = 1;
policy(12)= 1;
S = zeros(84,1);
Actions = [0,555,565,575];
ET(84:88,1)= 0;
ET_simu = ET;
runoff = zeros(84,1);
Precipitation = [0;Precipitation];... |
[ndcells,frcells] = ProcessDirs(ndcells,'Object','firingrate');
gpeak = heterogeneity(frcells,'NoSingles');
% sort the correlation coefficients within each site so the
% plot is more readable
% save the indices so we can use it later to mark the
% insignificant values
[gsdata,gsdi] = sort(gpeak,'descend');
... |
function [text,T,p,s,t,ST] = anova1_autoresults(x,group,varargin)
%% setting
displayopt = 'off';
%% process varargin
vararginProcessor
%% means
[gn,sd,se]= grpstats(x,group,{'gname','std','sem'});
%% anova
[p,t,s] = anova1(x,group,displayopt);
text = anova_textresult(t);
%%
a = t(2:end,2:end);
a(cellfun(@isempty,a... |
function [t_out, y_out] = euler( f, t_rng, y0, n )
t0 = t_rng(1);
tf = t_rng(2);
t_out = linspace(t0,tf,n);
h = (tf - t0)/(n - 1);
y_out = zeros(1,n);
y_out(1) = y0;
for k = 1:(n - 1)
y_out(k + 1) = y_out(k) + h*f(t_out(k), y_out(k));
end
end
|
G.ll=17;
G.prevLL = [17 17 17 17 17];
G.vSize = 30;
G.intruderAct = .002;
G.openSet = 1; % are prev lists permutations of items from current list?
G.recTime = 30;
G.nruns = 5000; %run many sims to get reliable slopes on time function
G.lastProb = .9;
G.firstCue = .2;
G.totOmmT = 4;
tcount=1;
... |
%% Matlab version
% Elapsed time is 2.3 seconds.
tic;
for ii = 1:1e4
g = qes.waveform.gaussian(40);
end
toc
%% java version
% Elapsed time is 0.122 seconds
tic;
for ii = 1:1e4
g = qes.waveform.gaussian(40,1);
end
toc |
clc;
clear all;
close all;
wp=20;
ws=30;
tw=10;
ws=100;
fc=(ws+wp)/2;
wc=2*pi*(fc/ws);
AlphaS=44;
AlphaA=0.1;
D=(AlphaS-7.95)./14.36;
Gamma=((0.5842*(AlphaS-21)^0.4)+0.07886*(AlphaS-21));
N=ceil(ws.*(D/tw)+1);
alpha=(N-1)/2;
n=0:1:N-1;
hd=sin((n-alpha).*wc)/(pi.*(n-alpha));
Wk=kaiser(N,Gamma);
W=hd.*W... |
clear all;
initiate;
Xtrue=load('V Phasor PMU.txt');
Strue=[Xtrue(:,4);Xtrue(:,3)];
trials=100;
vs=zeros(trials,4);
Jmin=zeros(trials,4);
IND1=zeros(trials,4);
IND2=zeros(trials,4);
for mc=1:trials
measurements;
clear States
estimator; % Constrained
for mcj=1:length(x)
vs(mc... |
% A = meshgrid(linspace(0, 2*pi, 40), linspace(0, 2*pi, 40)) ;
%
% X = .3 .* cos(A);
% Y = .3 .* sin(A);
%
% Z = meshgrid(linspace(-.3, .3, 40), linspace(-.3, .3, 40))';
%
% surf(Z, Y, X), axis equal
ax = axes('XLim',[-2 1],'YLim',[-2 1],'ZLim',[-1 1]);
view(3); grid on; axis equal
[x y z] = cylinder([.3 0]);
h(1)... |
function [ L,acc ] = loss_accuracy( Yhat , Y )
Yhat_log = arrayfun(@log,Yhat)
L = -Y.*Yhat_log
L = sum(sum(L,2),1)
%accuracy (TP + TN)/TOTAL
[max_Yhat, argmax_Yhat] = max(Yhat,[],2)
[max_Y, argmax_Y] = max(Y,[],2)
acc = argmax_Yhat - argmax_Y
acc = sum(acc(:)==0)/size(acc,1)
en... |
clear;clc
a=[10 21 30 41]
ind=my_funct_8(a) |
% Ryan Winkelmaier
% Math 254L
% Midterm
% monte - Do a plain monte carlo intergration for a sphere of radius one.
% Arguments
% npoints - Number of samples to take
% type - Type of sphere to evaluate
% 1 - Circle in 2 dimensions
% 2 - Sphere in 3 dimensions
% 3 - Hypersphere in 4 dimensions
% ... |
% Messwerte einlesen
load Fertigung.mat;
% Grafische Darstellung der Fertigungsdaten als zweidimensionales Säulendiagramm
figure(1);
bar(Z,0.25,'stacked'); |
A = logspace(1,4,100);
anon_RV = @(R, C, L, V) (abs(R*((-V.^2)*L*C))/sqrt((R-R*(V.^2)*L*C).^2 + (V.*L).^2));
%f = anon_RV(100, 160e-6, 45, A);
R = 500; C = 160e-6; L = 45; V = A;
plot(A, anon_RV(R, C, L, A)); |
function t = multiNodeMultilateration(t)
%t = multiNodeMultilateration(t)
%
%This function ignores all distances except those to anchor nodes and, if
%there are enough, will create a system of equations to JOINTLY solve for the unique xy
%coordinates of all mobile nodes.
%this function doesn't work yet.... it h... |
barh([2007:2010],[2.626360, 3.037157, 3.188168, 3.342893],0.4,'r');
xlabel('number of images in millions');
set(gca, 'YDir', 'reverse') |
function [Lm_poly1,Lm]=moment_arm(q)
global muscle_data
%----------------------
%Obtain Muscle Lengths
%----------------------
%Polynomial Coefficients from Muscle Data
Lm_poly=[muscle_data.L0 muscle_data.dRhip muscle_data.dRknee muscle_data.dRankle];
Lm_poly1=Lm_poly(:,3:4);
%Apply Walking... |
function [file_format, file_type, H_i, direction_matrix,...
frq_axis, n_directions, n_channels, n_lines,...
first_frq, last_frq]=mtlrt11(filename, index);
% MTLRT11 reads file of type 11
% [file_format, file_type, H_i, direction_matrix,...
% frq_axis n_directions, m_channels, ... |
function sarta_core(input_glob, yyyymmdd, model, emis)
% function sarta_core(input_glob, yyyymmdd, model, emis)
%
% input_glob = "glob" for intput files
% yyyymmdd = date associated with the "glob" selection
% String or Matlab datenum.
% MAKE SURE THEY MATCH WITH THE GLOB
% model ... |
function [center_pseudo,center_fit_byTF]= calculate_center_according_to_voltage(um,q,mass,Vrf,V_dcsegement,xr,yr,zr,num_total_electrode,points,potential_basis,V,pseudo_C,center_pseudo_ini)
%calculate the center point of all pseudo potential field by RF voltage and
% DC segement voltage.
%% define the voltage
V... |
function vel_sim_06
%
% Version uses the hyperbolic secant and tanget sweeps for robustness to
% off-resonance
%
% simulate an adiabatic pulse broken into chunks
% RF-bipolar-Rf-bipolar ...
% freqeuency of RF pulses sweeps from +deltaF to -deltaF
%
% This is the version with the sinc excitation and rect acceleration
% ... |
function equalized_signal = generic_equalizer(RxSignal, channel, start_point, end_point)
% RxSignal: received Signal,
% channel: the channel estimate,
% l1: the filter(s) length
lag = end_point - start_point +1;
sig_out_size = lag; sig_in_size = lag;
C = zeros(sig_out_size, sig_in_size);
% Add some zeros in ... |
function[textComponents, componentBboxes] = filterComponents(strokeWidthImg, components)
% This function performs some fairly flexible tests based on some fairly general rules
% on connected components of swt image.
%
% Usage:
% textComponents = filterComponents(strokeWidthImg, components)
%
... |
function cubehelix_demo
% Interesting Cubehelix colorschemes are shown in a <cubehelix_view> slideshow.
%
% (c) 2013 Stephen Cobeldick
%
% See also CUBEHELIX CUBEHELIX_VIEW CUBEHELIX_FIND BREWERMAP RGBPLOT3 RGBPLOT COLORMAP
V = {0.5, 0.0,1,1, 1, 0:0.1:2.99;... % Vary start ( 0 rotations).
0.5,-1.0,1,1, ... |
function uid = dicom_generate_uid(uid_type)
%DICOM_GENERATE_UID Create a globally unique ID.
% UID = DICOM_GENERATE_UID(TYPE) creates a unique identifier (UID) of
% the specified type. TYPE must be one of the following:
%
% 'instance' - A UID for any arbitrary DICOM object
% 'instance_part' -... |
function y = logitfxn(x)
y = log(x ./ (1-x)); |
function [dummy]=dene(input,adimsayi,tsample)
A=double(input);
C=uint8(input);
[row,column]=size(A);
tsize=max([row column]);
tsize=tsize*1.415;
tsize=ceil(tsize);
a=pi/adimsayi;
theta=a;
t=-tsize/2;
b=tsize/tsample;
k=1;
y=zeros(tsample,column,adimsayi);
while theta<pi
i=1;
t=tsize/tsample;
... |
%
% Nov. 3, 2018, He Zhang, hzhang8@vcu.edu
%
% plot the trajectories of result in comp_d6 folder
%
addpath('../../');
addpath('.');
tr1 = dlmread('./comp_d4/d4_vins_mono.csv');
tr2 = dlmread('./comp_d4/d4_vins_rgbd_f230.csv');
tr3 = dlmread('./comp_d4/d4_dvio_no_ini.csv');
tr4 = dlmread('./comp_d4/d4_dvio_w_i... |
%% 按中文描述字段将5分制或2分制统一转化为百分制
function [out_cell_array] = ConvertScale(in_cell_array)
out_cell_array = in_cell_array;
out_cell_array(find(strcmp(in_cell_array, '优秀'))) = {'95'};
out_cell_array(find(strcmp(in_cell_array, '良好'))) = {'85'};
out_cell_array(find(strcmp(in_cell_array, '中等'))) = {'75'};
... |
names = cell(1449,1);
for name=1:1449
%randomIntegers = randi([1,1449]);
ss = ['0000' num2str(name)];
%ss = ['0000' num2str(randomIntegers)];
while(length(ss) < 8)
ss = strcat('0',ss);
end
names{name} = [ss];
end
|
function [cell,edge,vtx,tie]=CellDivision2DMonolayer(cid,cell,edge,vtx,prm,INIT_VER,tie)
% vtx.position
vl1=edge.vtx(cell.edge(cid,1),:)';
vl2=edge.vtx(cell.edge(cid,3),:)';
vpos1=vtx.pos(vl1,:); % apical
vpos2=vtx.pos(vl2,:); % basal
% noise
ns1 = 0.005*(rand(1,2)-0.5);
ns2 = 0.005*(rand(1,2)-0.5);
vtx.pos(vtx.numb+... |
%% MULTIFRAME MOTION COUPLING FOR VIDEO SUPER RESOLUTION
%
%
% Be sure to initialize the submodules and to compile them
% following their instructions
%
%
% This test file shows how to use the MultiframeMotionCoupling class
% and how to change parameters, if needed.
%
%
% Please change the dataFolder and datasetName ... |
labeledTest = imread('H:\RGBBACKGROUND_2020-04-27_006_gt.png'); |
function [ vars ] = comp_Uc_nommx_L2( vars, params )
%COMP_UC_NOMMX_L2 Computes the optimal Ur with squared Frob. penalty
%
% Mehdi Bahri - Imperial College London
% April, 2016
S = vars.S;
T = vars.T;
Ur = vars.Ur;
mu = params.mu;
Ucn = zeros(params.n, params.r);
Ucd = zeros(params.r, params.r);
if params.PARALLEL... |
%利用PID来控制低压转速回路
clearvars;clc;
A=[-2.01 2.06;-0.0044 -2.92];
B=[0.84 1.2;0.53 0.29];
C=[1 0;-0.86 5.08];
D=[0 0;-0.21 0.56];
[b,a]=ss2tf(A,B,C,D,1);
clearvars -regexp [A-Z]
engine=tf(b(2),a);
stepplot(engine)
C = pidtune(engine,'PI');
pidTuner(engine,C) |
function im_seg = CS6640_ac(M,vidObj)
% CS6640_ac - use active contours to improve segmentation
% On input:
% M (Matlab movie struct): segmentation movie (binary)
% vidObj (video struct): created by readVideo
% On output:
% im_seg (MxNxF binary array): improved segmentation provided as
% sequence of F ima... |
function fn_showcolormap(cmap,varargin)
% function fn_showcolormap(cmap[,clip][,ha])
%---
% opens a new figure and display in it the colormap at the given clipping
% value
% Thomas Deneux
% Copyright 2011-2012
if nargin==0, help fn_showcolormap, return, end
% input
if ischar(cmap), cmap = feval(cmap,256); end
defcli... |
function [Srx,phi0] = CPE_BPS_Simplified(Srx,Stx,nSpS,C,CPE)
% Last Update: 29/03/2018
%% Input Parser
if ~isfield(CPE,'decision')
CPE.decision = 'DD';
end
if any(strcmp(CPE.decision,{'DA','data-aided','genie-aided'}))
dataAided = true;
else
dataAided = false;
end
%% Input Parameters
[nPol,nSamples] = s... |
function inti(){Point pt1 = {1,1}
Point pt2 = {5,2}
Line l = pt1 + pt2;
function shapeWithParams(Line l1) -> Polygon{
Polygon triangle = l1 * 3;
return triangle
}
}
function render(){
draw(shapeWithParams(l));
}
|
function [ tanstruct_scaled, vmr_ratio ] = scale_ace_with_pratmo_vmrs( tanstruct_in, ratios_in, lst_in )
%A function to scale ACE VMR profiles to a given local solar time using
%VMRs calculated using a chemical box model (like PRATMO). PRATMO VMRs can
%be calculated with 'make_ace_gas_vmrs_with_pratmo.m'. When there a... |
function [Gxx_avg,f_Gxx] = MyAvgGxx_Overlap(xn,NSTFT,overlap,fs)
% [Gxx_avg,f_Gxx] = MyAvgGxx_Overlap(xn,NSTFT,overlap,fs)
% Inputs:
% xn = Input Vector Time Array
% NSTFT = Length of each record desired
% overlap = Overlap percentage
% fs = Sampling Rate
% Outputs:
% Gxx_Avg = Averag... |
function [pose, Z] = llh2xyz(imu_pose) % Convert lat, long, height in WGS84 to ECEF X,Y,Z
% lat and long given in decimal degrees.
% altitude should be given in meters
long = imu_pose(1);
lat = imu_pose(2);
att = imu_pose(3);
yaw = imu_pose(4);
lat = lat/180*pi; %converting to radians
long = long/18... |
function [q_eta_hat,q_hat] = pruning_algorithm(q,Tr)
% function q_eta_hat = pruning_algorithm(I_attack)
% Description:
% This function is to implement pruning algorithm based on
% uncertain oracle
% 1. oracle is generated by Bernulli model
% 2. prunning based o... |
r = zeros(1, 32); %建立一个数组,使用zeros初始化为0
for n = 1: 1: 32; %使用for循环
r(n) = rank(magic(n)); %对魔术矩阵进行求秩操作
end %结束for循环
bar(r); %使用直方图的形式将一维矩阵表示出来 |
board_im = imread('board_sample4.jpg');
swtMap = swt(board_im,-1);
[swtLabel numCC] = swtlabel(swtMap);
% figure,imshow(swtLabel)
feature_img = medfilt2(swtLabel);
CC = bwconncomp(feature_img);
numPixels = cellfun(@numel,CC.PixelIdxList);
[biggest,idx] = find(numPixels>50);
new_im = zeros(size(board_im,1),size(board_i... |
function outHex = GF256Mult(n1Hex,n2Hex)
% outHex = GF256Mult(n1Hex,n2Hex)
% Input: Two hexadecimal 2 digit strings, n1Hex,n2Hex, representing elements of the field
% GF(256)
% Output: outHex, the corresponding hexadecimal representation of their
% product in GF(256)
%Convert inputted hex symbols to binary vectors... |
function mask = create_mask(bucket, init, imgIn)
% use saved x and y positions to mark blocks considered copied.
% the mask is one in those areas and zero elsewhere
[rows, cols, ~] = size(imgIn);
mask = zeros(rows, cols);
x = [];
y = [];
for n=1:numel(bucket);
x = [x, bucket{n}.x];
y = [y, bucket{n}.y];
end
XY ... |
% ****************************************************************************
% Projet :
% Filename : cordic.m
% Description :
% Author :
% Data : 09/06/2020
% **********... |
function D3a=test_one_SNR_significance_val(tau, BGR, seg_center_vals, N_pulses, N_chan, roughness, N_per_pulse_0, Htot, WF)
%fprintf(1,'starting test_SNR_significance with BGR=%3.3d MHz, roughness=%3.2d\n', BGR/1e6, roughness); tic
tic
DOPLOT=false;
LS_fit_options=struct( 'Nsigma', 3, 'Hwin_min', 3, 'restrict_fit_to... |
function C = internals_build(C, varargin)
%
% NAME
%
% function C = internals_build(C)
%
% ARGUMENTS
% INPUT
% C class curvature_analyze class
%
% OPTIONAL
%
% OUTPUT
% C class curvature_analyze class
%
%
% DESCRIPTION
%
% This function creates the core internal data 'dictionary'-type
% structure that... |
function yy=vuCubicBSplineLine(c,xx)
% Cubic B-Spline line
% Adapted for vuTools : April 7, 2008 by: Kevin Wilson
% Based on work by Biomedical Imaging Group at EPA
%
% Given coefficients (c) of a cubic B-spline calculate values (y) at
% locations (x)
%
% INPUT :
% c : Cubic B-Spline coeffiecients
% xx : Values to ... |
clc;close all;clear;
No=[2,3,5];
GL=[7,1,5];
ipt=[1;8;13;17;20;24];
plotvariable;
i1=2;
range=1e4:2e4;
%
% load(strcat('..\data\',num2str(No(i1)),'\data_labeled.mat'));
% load(strcat('..\data\',num2str(No(i1)),'\sv.mat'));
load(strcat('../data/',num2str(No(i1)),'/data_labeled.mat'));
load(strcat('../data/',num2str(No... |
classdef HomogeneousVector
% HomogeneousVector - class for calculations with Homogeneous
% Vectors
%
% o history
% Daniel Klawitter
% created 21-10-2009 - 12:27
%
% o summary
% functions to handle homogeneous vectors and export them to dual
% quaternions representin... |
function V = func_Phi(X, M, P0, THETA, beta)
%推移確率行列
F0 = func_transition_prob(M, THETA, 0);
F1 = func_transition_prob( M, THETA, 1);
%効用関数
u0 = -0.001*THETA(2)*X;
u1 = -THETA(1)*ones(M, 1);
P1 = 1 - P0;
%P0*F0, P1*F1の計算
PF = zeros(M, M);
for i = 1:M
PF(i, :) = P0(i).*F0(i, :);
end
P0F0 = PF;
PF = zeros(M, M);... |
function [idx] = SG_exclude()
%idx = [9 63 66]; % Lionel'
idx = [9 54 63]; % failure |
classdef al_HamburgIntegrationTest < matlab.unittest.TestCase
% This function runs an integration test for the Hamburg version
% To run the test, put run(al_HamburgIntegrationTest) in command window
% Test methods
methods (Test)
function testTaskOutput(testCase)
... |
% load reconstruction parameters
load 'temp.mat';
geom = loadProjectionGeometryCT( p );
% geom.detSize(2) = 256;
% geom.reconSize(3) = 256;
% geom.reconOffset(3) = 0;
spectrum = loadSpectraCT(p, geom, 2e6);
my_dir = 'D:\TabletopScannerData\Dec_14_2015_Study\Air\';
%% load air scan data
% dataPathAir = [my_dir 'ai... |
function out_map = consolidate_maps(map_cell, range)
%map_cell is a cell thatc ontains all the maps that we need, we will only
%be using the one for the first index right now
%first we need to normalize each of th maps so they are ina comparabel
%dimension
cell_numb = size(map_cell, 2);%get the number of cells
cell_num... |
data = sin(1:1000)';
M = length(data);
K=2^11;
omegas = (2*pi / K) * (0:(K-1));
A = exp(omegas'*1j*(0:(M-1)))';
%initialise initial estimate
P = diag(abs(fft(data,K)).^2);
R = A * P * A' + var(data) * eye(M);
alphas = zeros(K,1);
for i=1:1
for k=1:(K)
alphas(k) = ( A(:,k)' * inv(R) * data) / ( A(:,k)'*... |
function [ mznew,spnew ] = watersAnalyteFile(file,data)
%watersAnalyteFile - import the txt analyte file
% Create a waitbar
wb = waitbar(0.25,'Importing Analyte File');
% Read in unless provided
if ~isempty(file) && isempty(data)
data = dlmread(file);
end
% Change
waitbar(0.75,wb,'Processing Analyte File... |
% Generated through Matlab
% Author: Killian Keller
% E-Mail: killian.keller@ief.ee.ethz.ch
% Organization: ETHZ ITET IEF
function [model, refr] = DispersionRelation(model, varargin)
% Function Creates the Parameters for the Dispersion Relation and gives them
% to the Comsol model. Can be given... |
function prefix = get_remoteprefix()
def_prefix = 'T:/';
% Get existing prefix, or default
if ispref('FACET_data', 'prefix')
prefix = getpref('FACET_data', 'prefix');
else
setpref('FACET_data', 'prefix', def_prefix);
prefix = def_prefix;
end
datapath = fullfile(prefix, 'nas', 'nas-li20-pm00');
if ... |
%%% Autor: Francisco Rossi
%%% Materia: 86.54 - Redes Neuronales, Facultad de Ingeniería (U.B.A)
%%% +-+-+-+-+ +-+ +-+ +-+-+-+-+-+-+-+-+-+ +-+
%%% |G|U|I|A| |1| |-| |E|J|E|R|C|I|C|I|O| |3a|
%%% +-+-+-+-+ +-+ +-+ +-+-+-+-+-+-+-+-+-+ +-+
%%% Error de la red de Hopfield (82') en funcion del % sinapsis eliminadas (82')
%%... |
function imp = ijreadtiff(pathname);
%IJREADTIFF Reads TIFF file and returns ImageJ ImagePlus object
% imp = ijreadtiff(pathname);
%
% Reads tif file and returns ImagePlus object
%
% by Vincent Bonin based on original code by Aaron Kerlin
%
% 3/14/08 histed: support unix-style paths
%$Id: ijreadtiff.m 204 2008... |
clear
C.Zsdd = 0;
C.Zs = 0;
C.sprung_vel = 0;
C.sprung_disp = 0;
C.Faero = 0;
Simulink.Bus.createObject(C);
C = slBus1; clearvars slBus1
U.Cs = 0;
U.damperVel = 0;
U.Fn = 0;
U.Zu = 0;
U.Zud = 0;
U.Zr = 0;
U.Zrd = 0;
U.gc = 0;
U.dt = 0;
U.Fcu = 0;
U.Fku = 0;
U.Fcs = 0;
U.Fks = 0;
U.ZuZr = 0;
U.ZsZu = 0;
U.ZudZrd = 0;
... |
function success = uq_Reliability_test_print_and_display( level )
% SUCCESS = UQ_RELIABILITY_TEST_RELIABILITY_PRINT_AND_DISPLAY(LEVEL):
% Testing the fuctionality of uq_print and uq_display in the context of
% reliability analyses
%
% See also UQ_SELFTEST_UQ_RELIABILITY
%% Start test:
uqlab('-nosplash');
close... |
% Christopher Brant ENGR 1410-625 1/20/2016
%% Section 1: Patient Information
% Problem Statement: Creating arrays in which patient names are stored.
clear
clc
% Variables are all patient name strings
P1F = 'Ima';
P1L = 'Tiger';
P2F = 'Preston';
P2L = 'Holtzendorff';
P3F = 'Thomas';
P3L = 'Clem... |
function E = rms_er(a, b, c)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
load('salmon.mat');
sal_pred = exp(a*t.^2 + b*t + c);
E = sqrt(sum((sal_pred - salmon).^2) / length(salmon));
end
|
%#eml
function [mirror_vect] = mirror_vector1_wrt_vector2(v1,v2)
[v_forw,v_sidew] = Jojo_proj_vect_to_forw_sidew_vects_v1_onto_v2(v1,v2);
mirror_vect = v_forw - v_sidew; %v_sidew - v_forw; |
function Out = GeneralRemoveChar(In,varargin)
LocOut = In;
for k = 1:length(varargin)
TargetCharacter = char(varargin(k));
LocOut = RemoveCharCore(LocOut,TargetCharacter);
end
Out = LocOut;
end |
function result = PCA_Saliency(I_RGB)
if (~exist('vl_slic.m','file'))
fprintf('\nConfiguring vl_slic & IM2COLSTEP\n');
bindir = mexext;
if (~strcmp(mexext,'mexw64'))
fprintf('Note: You are not using Windows 64 bit: Fast im2colstep diabled\n');
end;
if strcmp(bindir, 'dll'), bindir = 'mexw32... |
function [tuning, respmat,mm] = pspotmapyst(file, lat, winsize, varargin)
%function tuning = pspotmap(file, lat, winsize, varargin)
%
% PSPOTMAP process and plots spotmap data
%
% tuning = pspotmap(file, lat, winsize, [options])
%
% INPUT
% file - spotmap python file (see gratrev.py) (or p2m PF struct)
% ... |
%Test Visualizer Image capabilities
clear vis
vis = rlVisualizer('vis',640,480);
vis.add3DModel('C:\aslab\projects\vjoukov\SLAM\3dScene\MRPTScene\MRPTScene\tree1_3ds\Tree1.3ds',[0 0 0 0 0 pi/2]);
tic;
for i=1:100
vis.update();
img = vis.takeImage();
imgrbg = img;imgrbg(:,:,1) = img(:,:,3);imgrbg(:,:,3) = ... |
clear all
close all
% Program reads the data from the mme files interpolates and writes the output file for sosa
Avog = 6.0223E23; % molecules / mol
RG = 8.314; % J / mol / K
MAir = 28.97; % mole mass of air
MH2O = 18.0153; % mole mass of H2O
Avog = 6.0223E23... |
clear;
% fileID = fopen('mNewR.txt');
% r= fread(fileID,'uint32');
% r=r';
% fclose(fileID);
%
% fileID = fopen('mNewNc.txt');
% nc= fread(fileID,'uint32');
% nc=nc';
% fclose(fileID);
clear;
fileID = fopen('newR.txt');
r= fread(fileID,'uint32');
r=r';
fclose(fileID);
bin=en_zone_sub2(r,[]);
fid=fopen('mbin.txt... |
% exercise: condensation tracker
load('..\data\params.mat');
% video1
videoName = 'video1';
params.draw_plots = 1;
params.hist_bin = 16 % smalle hist bins
params.alpha = 1; % alpha=1 is better
params.sigma_observe = 3; % sigma of observe noise equal to 3 is better
params.model = 0;
params.sigma_velocity = 1;
params.nu... |
function [] = CondAdLIF_STDP_FI_Function_LogWeightMuGamma(index)
%% Add the approprate folders to the path
%Path of the SOSpikingModel repository
repopath = '/scratch/jmg1030/FIcurve/SOSpikingModel';
addpath(genpath(repopath))
%%
names = ["logWeight_m_01.mat","logWeight_m_1.mat","logWeight_m_10.mat"];
weightNames =... |
function prob=concave_den_cdf(ref_Y, ref_phi, ref_beta, Delta_vec, T, x)
% this function calculates the cdf of semi-parametric distribution
upper = (sqrt(T) - sqrt(x)) / sqrt(x);
if upper > ref_Y(end)
prob = 1;
elseif upper <= ref_Y(1)
prob = 0;
else
phi_temp = linear_phi_inter(ref_Y, ref_phi, upper);
... |
rng('default')
old = cd(fileparts(mfilename('fullpath')));
n = 80;
P = [1 0.8 0; 0.8 1 -0.4; 0 -0.4 1];
w = precSim(0.8*P,n);
b = [0.5 -0.25 0; 0 0.25 0.125];
intercept = [2 2 2];
feature1_vals = {'included', 'excluded'}';
feature2_vals = {'black', 'white'}';
f2 = feature2_vals( round(rand(n,1)) + 1);
onames = strtri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.