text stringlengths 8 6.12M |
|---|
%%% B-SOSE Cellwise DIC budget for Iter 133 (whole SO)
%%% Ariane Verdy, May 2018
%%% edited Ben Taylor, Apr 15 2020
%%% Changing filenames for runs other than Iter133 may be necessary (but changing the folder names should take care of most)
%%% Likewise for other tracers - but again, there shouldn't be too many err... |
function readEditInteger(src,~)
value=get(src,'String');
try
value=sscanf(value,'%d');
assert(isscalar(value),'ERROR');
value=sprintf('%d ',value);
catch
value=get(src,'UserData');
end
set(src,'String',value,'UserData',value);
end |
%% HOM Fitting guess
% Guesses the values of the parameters that fit the
% theoretical curve to the experimental rate.
%% Inputs:
% exptauvals: 1xn vector of delay values from experiment.
% exprate: 1xn vector of the experimental
% coincidence rates correspoding to the delays values in tauvals.
% ... |
% plot optical Q
%%
% close all;
% copied from genLNNB21
thetas = [-90,-67.5,-50,-45,-40,-22.5,0,22.5,40,45,50,67.5,90];
thetas = [thetas flip(thetas(1:end-1)) thetas(2:end)...
flip(thetas(1:end-1)) thetas(2:end) flip(thetas(1:end-1)) thetas(2:end)];
thetas = thetas(1:72);
% h_f = figure;
Qs = [];
Qis = [];
theta... |
% %B02fsgrzbiet1=detectspecifically(B02fsgrzbiet1,16,200, 0);
finalResults=[];
if exist('B01fsgrzbiet1','var')
newSize=size(finalResults,1)+1;
for c=1:6
if B01fsgrzbiet1(c, 8)>0
finalResults(newSize,c)=B01fsgrzbiet1(c, 19)-B01fsgrzbiet1(c, 8);
else
finalResults(ne... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Evaluation tool boxs for "Inf-Net: Automatic COVID-19 Lung Infection Segmentation from CT Scans" submit to Transactions on Medical Imaging2020.
%Author: Deng-Ping Fan, Tao Zhou, Ge-Peng Ji, Yi Zhou, Geng Chen, Huazhu Fu, Jianbing Shen, and L... |
clear all, clc
syms t;
% Generarea matricelor A si B
A=[cos(t),sin(t);-sin(t),cos(t)]
B=[sin(t),cos(t);-cos(t),-sin(t)]
% Calcularea sumei A+B
SumAB=A+B
% Calcularea expresiei A.^2+B.^2 si simplificarea ei
Expr1=A.^2+B.^2
Expr1_simplificat=simplify(Expr1)
% Calcularea expresiei... |
function [stm,Fs] = pa_gentone(N, Freq, NEnvelope, Fs, grph)
% GENerate TONE Stimulus
%
% STM = GENTONE (<N>, <Freq>, <NEnvelope>, <Fs>, <grph>)
%
% Generate a sine-shaped tone, with
% N - number of samples [7500] samples
% Freq - Frequency of tone [2000] Hz
% NEnv... |
load('hillclimbing.mat')
thres=90; %lower bound for sensitivity and specificity
Acc=zeros(0,0,0);
Sen=zeros(0,0,0);
Spe=zeros(0,0,0);
result=zeros(5,13);
c=1;
for i=[1,2,3,4,7,8,9,11,14,15,16,17,18]
for j=1:(i-1)
Acc(j,:,:)=GAccuracy(j,:,:);
Sen(j,:,:)=GSensitivity(j,:,:);
Spe(... |
function [L,D,L_trans] = chol_float(A)
N = length(A);
for i = 1:N
D(i,i) = A(i,i);
if (i~= 1)
for k = 1:i-1
D(i,i) = D(i,i)-(L(i,k)* L(i,k)' * D(k,k));
end
end
for j = i+1:N
L(j,i) = A(j,i);
if (i~= 1)
for k1 = 1:i-1
L(j,i) = L(j,i) - (L(j,k1)*L(i,k1)*D(k1,k1));
end ... |
% blinktst - new script for simulating blinking. I decided to start a new script rather
% than edit "blinkdemo". This script is for testing several ideas and/or answering questions:
% -whether it makes a difference if FT is a power of two or not.
% -whether quenching efficiency of "polaron" affects C(tau)/autocorr/ac... |
function A = sampleIrrelevantForUser(T,u,n)
%SAMPLEIRRELEVANT A = sampleIrrelevantForUser(T,u,n)
%
% Given the observations, sample n irrelevant observations for user u. The
% irrelevant observations have rating 0 and are of course distinctive
% from the observed/rated set.
%
% We are talking about observations bec... |
omega = 32.87;
delta = -20.34;
sigma = 60.25;
theta =acosd(cosd(omega)*cosd(delta)*cosd(sigma)+sind(omega)*sind(delta));
% theta = 78.3380;
alphas = 90 - theta;
% alphas = 11.6620;
|
function [ out_struct_sig ] = My_DWT_pre_filt( in_struct_sig )
% revision: 08.11.2018
tic;
fprintf('\t- prefiltration for Sig\t->');
out_struct_sig.type = in_struct_sig.type;
out_struct_sig.phase = in_struct_sig.phase;
out_struct_sig.size = in_struct_sig.size;
out_struct_si... |
function [ intersection ] = line_intersection( x1, x2, x3, x4, y1, y2, y3, y4)
denom = (y4-y3) * (x2-x1) - (x4-x3) * (y2-y1);
numera = (x4-x3) * (y1-y3) - (y4-y3) * (x1-x3);
numerb = (x2-x1) * (y1-y3) - (y2-y1) * (x1-x3);
% Are the line coincident?
if abs(numera) < eps && abs(numerb) < eps && abs... |
% Author: Justice Amoh
% Description: Function to check whether graph is Eulerian
% ENGS 104 - Optimization: Assignment 3
%% PROBLEM 1
function y = Eulerian(A)
[n,~] = size(A);
isEven = sum(mod(sum(A,2),2)) == 0; % check if all rows sum to even
isConnected = min(min((A+eye(n))^(n-1))) ~= 0; % check if connected
... |
function [p] = ispsd(A)
%ISPSD Check for positive-definiteness.
%
% usage
% ispsd = ISPSD(A)
%
% input
% A = matrix (need not be symmetric,
% remember though that only symmetric part determines
% sign-definiteness, anti-symmetric/symplectic part is
% conservative, i.e., Ha... |
%来源:http://adrianboeing.blogspot.com/2012/05/dynamic-window-algorithm-motion.html
BEGIN DWA(robotPose,robotGoal,robotModel)
laserscan = readScanner()
allowable_v = generateWindow(robotV, robotModel)
allowable_w = generateWindow(robotW, robotModel)
for each v in allowable_v
for each w in allowable_w
... |
function saveGlobalEdgeIdx( p )
%SAVEGLOBALEDGEIDX Saves a new matfile containing the linear index of the
%first edge of the local edge file in the global supervoxel graph edge
%list. The global edge index is saved in the file 'edgeGlobalIdx.mat'.
% INPUT p: A segmentation parameter struct.
% Author: Benedikt Staffler ... |
function Q = implfcns(L, outmf, varargin)
%IMPLFCNS Implication functions for a fuzzy system.
% Q = IMPLFCNS(L, OUTMF, Z1, Z2, ... , ZN) creates a set of
% implication functions from a set of lambda functions L, a set of
% output member functions OUTMF, and a set of fuzzy system inputs
% Z1, Z2, ... , ZN . L is a ... |
function plot_waveform(DATA, FS, COL, WID, FHAND, varargin)
%% DESCRIPTION:
%
% Simple function to plot a time varying waveform in MATLAB.
%
% INPUT:
%
% DATA: NxC matrix, where N is the number of samples and C is the
% number of channels.
%
% Alternatively, DATA can be an N-element cell array... |
%% read csv
M{1}=csvread('../data/runningTimekNN-2-2-sig1.5-DPI100.csv',1,0);
M{2}=csvread('../data/runningTimekNN-2-2-sig2.5-DPI200.csv',1,0);
M{3}=csvread('../data/runningTimekNN-2-2-sig3.5-DPI300.csv',1,0);
sigs=[1.5 2.5 3.5];
%%
for(it=1:3)
figure(it);
DPI=100*it;
[X,Y] = meshgrid(...
linspace(min(... |
function [Freal,Fimag]=optimizecalF2(fringepath,fringeX,fringeY,dataPts,width)
%P=1024; %条纹有效CCD坐标为243-991 301-1299 ,
%Q=1280;
% X=720;%归一化框大小,即投射条纹的区域大小
% Y=1120;
%fringeX=24;%投射条纹分辨率大小100*125
%fringeY=24;
%参数
b=1;
k0=1;
%F=zeros(fringeX,fringeY,xmax-xmin+1,ymax-ymin+1); %储存单个单像素接收到的傅里叶系数
Freal=int16(zer... |
%http://stackoverflow.com/questions/19972878/matlab-code-to-compare-two-histograms
function k = Bhattacharayya_coefficient(cObj,X1,X2)
k = sum(sqrt(X1(:)).*sqrt(X2(:)));
end |
% Script to make some test on correlated sources
% Juan S. Castano
% 29 jan 2013;
clear; close all; clc;
nip_init();
% Load data (Leadfield, etc...) to be used
Nd = 2000;
load(strcat('data/montreal',num2str(Nd),'_10-10'))
cfg.L = L;
cfg.cortex = cortex_mesh;
cfg.t = 0:1/256:0.5;
model = nip_create_model(cfg);
[Lapl... |
%--------------------------------------------------------------------------
% Analysis code for tendon stiffness
% EMG
% Last update:2/17/18
% Note: Study No. 200
% Run AnalysisCode_1 before this
%--------------------------------------------------------------------------
close all
clear all
clc
Fs = 1000;
en... |
function [b]=c_fgm_staff_combine(bFgm,bStaff,varargin)
% C_FGM_STAFF_COMBINE combine FGM and STAFF data series
% b=C_FGM_STAFF_COMBINE(bFgm,bStaff) combines FGM and STAFF time series
% for the case when both are in burst or normal mode. For filtering are
% used FIR filters with 127 points for the normal mode and 1023 p... |
function notifyOfFault(message)
disp(['Fault Notification: ',message]);
disp(' ');
mail = 'rtfw.computer@gmail.com';
password = 'ypkwdtvwxeoboehc';
toMail = 'joe.bell@gmail.com';
toCell = '6178218253@vtext.com';
setpref('Internet','E_mail', mail);
setpref('Internet','SMTP_Server',... |
function fitness = fitness_nbr_unorm(sim_mat,labels)
n = size(sim_mat,1);
clusters = unique(labels);
k = length(clusters);
mem_mat = zeros([n,k]);
for i = 1:k
mem = find(labels==clusters(i));
mem_mat(mem,i) = 1;
end
aff_mat = sim_mat*mem_mat;
fitness = aff_mat(:,labels);
end |
function a = linIt(A)
% function a = linIt(A)
% a = A(:);
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Saurabh Gupta
%
% This file is part of the Utils code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this no... |
%% cellNeighbors
% Find neighbors of a series of cells in a cellNetwork object.
%%
%% Syntax
% NC = cellNeighbors(N,n)
%% Description
% This
%
%% Inputs
% * N - a cellNetwork object
% * n - an array of cell indices
%
%% Outputs
% * NC - a cell array containing the neighbor cells
%
%% Example
%
%% See also
% * neigh... |
function points=select_evalution_points(vertices)
[Gauss_weight,Gauss_point]=generate_Gauss_formula(vertices,4);
points=[ Gauss_point ];
end
|
%
% DD_RICE4 Sum of four 3D-Rice distributions parametric model
%
% info = DD_RICE4
% Returns an (info) table of model parameters and boundaries.
%
% P = DD_RICE4(r,param)
% Computes the N-point model (P) from the N-point distance axis (r) according to
% the paramteres array (param). The required parameters c... |
function t = create_training(nn, N, M, iterations, err, time_to_stop)
t.N = N;
t.M = M;
t.iterations = iterations;
t.ci = zeros(nn.ni, nn.nh -1);
t.co = zeros(nn.nh, nn.no);
t.cdeeph = zeros(nn.nh, nn.nh-1, nn.number_hiddens-1);
t.err = err;
t.time_to_stop = time_to_stop;
end
|
clear all; close all;
load('../identyfikacja/parametry2.mat')
[opt err] = fminsearch(@(params) q_pid(params), [1 1 1 ]);
Kp = opt(1)
Ki = opt(2)
Kd = opt(3)
% Kt = opt(4)
set_param('model/PID/Kp', 'Gain', num2str(Kp));
set_param('model/PID/Ki', 'Gain', num2str(Ki));
set_param('model/PID/Kd', 'Gain', num2str(Kd));
% se... |
function [tf,loc] = ismember_sorted(a,s)
%ISMEMBER_SORTED True for member of sorted set.
% ISMEMBER_SORTED(A,S) for the vector A returns an array of the same size as A
% containing 1 where the elements of A are in the set S and 0 otherwise.
% A and S must be sorted and cannot contain NaN.
%
% [TF,LOC] = ISMEMBE... |
function gausCenterPrior = GetGausCenterPrior(height, width)
h = height;
w = width;
[x y] = meshgrid(-w/2+1:w/2, -h/2+1:h/2);
x = x.^2;
y = y.^2;
c = 3;
% gausCenterPrior = zeros(1,sup.num);
% for ix = 1 : sup.num
% temp_x_dist = mean(x(cell2mat(sup.pixIdx(ix))));
% temp_y_dist = mean(y(cell2mat(sup.pixIdx(i... |
clear
clc
% define variables
x=[1 2 3 4 5 6 7]
y=[1.1 3.0 8.0 21.8 59.4 161.4 438.6]
%change y to ln(y) for fitting
ln_y=log(y)
%plot ln_y verses x
plot(x,ln_y,'r*')
xlabel('x')
ylabel('ln y')
%fit straight line through x and ln_y
coeff=polyfit(x,ln_y,1)
hold on
clear
%log-log graph
% define variabl... |
function [i,x_plus_rev,x_minus_rev,y_plus_rev,y_minus_rev,CAx_plus,CAx_minus,CAy_plus,CAy_minus,CAx_plus_sel, CAx_minus_sel,CAy_plus_sel, CAy_minus_sel, cout_one_plus, cout_one_minus, cout_two_plus, cout_two_minus, shift_o_plus, shift_o_minus,u_f,enable,res_enable,compare_frac,v_int_plus, v_int_minus,v_frac_plus, v_fra... |
function[x] = find_inv(a, m) % folosesc mica teorema a lui fermat ca sa aflu inversul
t = 1;
for i = 1:m - 2
t = mod(t * a, m);
end
x = t;
end |
function [t,r] = fabryPerot(nu,n1,n2,theta1,d,TEorTM)
% FABRYPEROT return the complex amplitude transmittance and reflectance of
% a FP etalon.
% [t,r] = FABRYPEROT(nu,n1,n2,theta1,d,TEorTM) returns the complex
% amplitude transmittance (T) and reflectance (R) of a slab fabry perot
% etalon where n1 is the index of the... |
%Costruisce la matrice tridiagonale con 2 sulla diagonale principale e -1
%sulle diagonali secondarie
function A=laplace(n)
A=2*eye(n);
for i=2:n
A(i, i-1)=-1;
A(i-1,i)=-1;
end
end
|
function [varargout] = likNegBinom(link, hyp, y, mu, s2, inf, i)
% likNegBinom - Negative binomial likelihood function for count data y.
% The expression for the likelihood is
% likNegBinom(f) = 1/Z * mu^y / (r+mu)^(r+y), Z = G(y+1)*G(r)/(r^r*G(y+r))
% with G(t)=gamma(t)=(t-1)!, mean=mu and variance=mu*(mu+r)/r, wh... |
function [ H ] = HOG(I, cell_x, cell_y, B)
% Inputs
% • I: m-by-n grayscale image.
% • cell_x: Positive integer holding the width of a HOG cell.
% • cell_y: Positive integer holding the height of a HOG cell.
% • B: Positive integer holding the number of HOG bins.
% Outputs
% • H: (floor(m/cell_y)-1)-by-(floor(n/cell_x)... |
function [lambdas,as,scales,fs] = chnsScaling( pChns, Is, show )
% Compute lambdas for channel power law scaling.
%
% For a broad family of features, including gradient histograms and all
% channel types tested, the feature responses computed at a single scale
% can be used to approximate feature responses at nearby sc... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2012 Analog Devices, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http:/... |
rng 'default'
close all
M = 7; % Number of observations
N = 2; % Number of variables observed
X = rand(M,N);
% De-mean
X = bsxfun(@minus,X,mean(X));
plot(X(:,1),X(:,2),'r*')
% Do the PCA
[coeff,score,latent] = pca(X);
hold on
plot(score(:,1),score(:,2),'bo')
% Calculate eigenvalues and eigenve... |
%MIT License
%Copyright (c) 2019 Sherman Lo
%ABSTRACT CLASS: EXPERIMENT DEFECT DETECT
%Compares a test image with aRTist, where the test image is an x-ray projection and aRTist is a
%simulation of that projection
%In detail: nSample of x-ray projections were obtained, all but one are used to train the
%varian... |
function res = loadExperimentPressureData(filePath)
%加载压力数据
% experiment 代表实验数据
if strcmpi(filePath(length(filePath)-2:end),'csv')
[num,tmp,tmp] = xlsread(filePath);
res = num(:,2:end);
else
[num,tmp,tmp] = xlsread(filePath);
res = num(:,3:end);
end
end
|
function mpcN_opf_storage = create_storage_case_file(mpc, p_storage)
define_constants
load_scaling_profile = mpc.load_profile(:,1);
%replicate mpc for each timeperiod, fix numbering
mpcN_opf = create_multi_time_step_case_file4(mpc);
if isfield(mpc, 'storageFlexibility')
... |
%{
EEG_Prepro_1
Author: Tom Bullock, UCSB Attention Lab
Date created: 09.28.20
Date updated: 14.06.20
Purpose:
Import data
Apply filters
Clean artifacts
Re-reference
Instructions:
Create directories and set directory paths in script
Edit filename to match the filename of your raw files
Notes:
Biosemi records to a s... |
% This subroutine computes the relative indexes that will allow to access all the
% points that are within a distance u_0+\xi_0 of a given point q of the grid of points.
function indexes_bound=index(N,grid_points_base,disturbance,control);
format long;
n=1;
center_point=floor(N/2);
indexes=zeros(N^2,2);... |
function P_out = world_2_local_2scale(P_robot, P_world, set_dx, set_dy, Dx,Dy)
% P_out = world_2_local_2scale(P_robot, P_world, set_dx, set_dy, Dx,Dy)
%
% Given a position and heading of the robot in the world frame, positions
% of obstacles as xy points, and an offset of the robot in its own local
% frame (set_dx, set... |
function output_txt = dataCursorUpdateFunction(~,event_obj)
% ~ Currently not used (empty)
% event_obj Object containing event data structure
% output_txt Data cursor text (string or cell array
% of strings)
pos = get(event_obj,'Pos... |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
% Symmetry
% Even symmetry
syms x t k T
w=2*pi/T;
c1=(2/T)*int(x*sin(k*w*t),t,-T/2,0);
c2=(2/T)*int(x*sin(k*w*t),t,0,T/2);
c=c1+c2
t0=-2;
T=4;
w=2*pi/T;
syms t
x=t^2;
k=-5:5;
a=(1/T)*int(x*e... |
function [unigrams_w2v_i, ngrams_w2v_i] = unigrams_w2v_index(m, ngrams, ngrams_i)
N = size(ngrams,2);
unigrams_w2v_i = cell(N,1);
ngrams_w2v_i = zeros(size(ngrams), 'single');
for i=1:N
uni = unique(ngrams(:,i));
uni_w2v_i = zeros(size(uni));
[~, ia, u_w2v_i] = intersect(lower(uni), lower(m.Terms));
... |
%Main_code
% Benchmark NE with fixed topology, produces 1 indivual per Generation,
% Random Mutation, No Crossover
% Direct Encoding
% Genomes are passed from Gen i to Gen i+1
% With Dropout method for better Generalization
close all;clear all;clc;
features = 2; %Total Number of features in dataset
rows1 = 4; % To... |
function data = formatData(data1,hints)
% Simulation Data
data.X = double(cell2mat(data1.X));
data.Xi = double(cell2mat(data1.Xi));
data.Pc = double(cell2mat(data1.Pc));
data.Pd = [];
data.Ai = double(cell2mat(data1.Ai));
data.Q = data1.Q;
data.TS = data1.TS;
% Performance Data
if isfield(data1,'T')
data.T = doubl... |
function rez = rez_wrapper(en,cut,fit,fg_par,bg_par)
rez = struct('en',[],'cut',[],'fit',[],'fg_par',[],'bg_par',[]);
rez.en = en;
rez.cut = cut;
rez.fit = fit;
rez.fg_par = fg_par;
rez.bg_par = bg_par;
%-------------------------------------------------
|
%% Compute the Jacobian analytically
% vec = [x y z u v w];
clear jac vec h1 h2;
jac = sym('J',[2,6]);
vec = sym('x',[6,1],'real');
h1 = atan2(vec(2),vec(1));
h3 = asin(vec(2)/sqrt(vec(2)^2 + vec(1)^2));
h2 = atan2(-vec(3),sqrt(vec(1)^2 + vec(2)^2));
jac(1,:) = jacobian(h1,vec);
jac(2,:) = jacobian(h2,vec);
jac
% ... |
function MouseDraw(action)
% ---------------------
% 改编自原作者:美利坚节度使
% 来源:CSDN
% 原文:https://blog.csdn.net/ying86615791/article/details/53607106?utm_source=copy
global InitialX InitialY FigHandle;
imSize = 28;
if nargin == 0
action = 'start';
end
addpath(genpath(pwd));
switch(action)
%%开启图形视窗
case 'start',
... |
function [outputArg1,outputArg2] = isReal(inputArg1,inputArg2)
%ISREAL Summary of this function goes here
% Detailed explanation goes here
outputArg1 = inputArg1;
outputArg2 = inputArg2;
end
|
clear all;
close all;
% p1 = [15.444804929251072 -0.493197742577506];
% p2 = [15.404643089607289 -0.831525276632670];
% p3 = [24.676891662992784 -25.232150729749170];
H_poziom = 5:5:30;
zbiornik_1 = [0.35 0.68 1.01 1.33 1.65 1.97];
zbiornik_2 = [0.38 0.7 1.03 1.35 1.68 2];
zbiornik_3 = [1.22 1.43 1.63 1.84 2.04 2.23]... |
%%%
%%%此函数是计算关节角序列对应的可操作度序列的函数
%%%输入:angle一组关节角n*7
%%%输出:这组关节角的可操作度n*1
%%%
function solution = AnglestoCaozuodus(angles)
angNum= length(angles);
Caozuodus=zeros(angNum,1);
for i=1:angNum
Caozuodus(i)=CaozuoduOfAngle(angles(i,:));
end
solution=Caozuodus; |
function pca_train(path,trainImageNameList, newSize, trainClassType, energy)
%pca_train(path,trainImageNameList, newSize, trainClassType, energy)
%功能:根据训练样本,计算并保存classType,newSize,originSize,平均脸,特征脸,投影矩阵,到pca_data.mat
%输入:
% path:训练样本路径
% trainImageNameList:训练图像名称列表(元胞数组)
% newSize:缩减后的图像尺度
% trainClassType:训练样本类别标号(列向... |
function [RMSE,rRMSE,AUROC,AUPRC] = evaluation(Y_true,Y_est,test_idx)
% calculate the errors between true Y and predicted Y
% coded by Eugene Seo (seoe@oregonstate.edu)
%% RMSE
diff = (Y_true(test_idx)-Y_est(test_idx)).^2;
RMSE = sqrt(sum(diff(:))/length(diff));
rRMSE = RMSE/mean(Y_true(test_idx));
%fRMSE ... |
close all;
clearvars;
commandwindow;
% Setup PTB with some default values
PsychDefaultSetup(2);
% Seed the random number generator.
rng('shuffle')
% Skip sync tests for demo purposes only
Screen('Preference', 'SkipSyncTests', 2);
%----------------------------------------------------------------------
% ... |
function f = rectpulse(t,t1,t2)
f = (t-t1>=0) - (t-t2>=0);
end |
function output = readFromControl_PidState(obj,father)
try
bag=rosbag(father.fileName+".bag");
bsel=select(bag,"topic",obj.topicName);
msg=readMessages(bsel,'DataFormat','struct');
obj.t=timeseries(bsel).Time;
obj.t=obj.t.';
if father.t0==0
father.t0=obj.t... |
%% PCA-ANALYSIS
% by Eva-Maria Weiss
% Version from 11.03.2020
% according to "A tutorial on Principal Components Analysis" By Lindsay I
% Smith (2003)
% this is a PCA for one time point: data input must be a cell array:
% STEP 1: get data
% data matrix need to have the variables within the rows and the fea... |
function loc = match_sorted_rows(a,s)
%MATCH_SORTED_ROWS Location of matches in sorted rows.
% MATCH_SORTED_ROWS(A,S) returns LOC such that S(LOC(i),:) = A(i,:).
% If A(i,:) is not in S, LOC(i) = 0.
% S must be sorted and unique.
%
% This function is a special case of ISMEMBER_SORTED_ROWS.
% Written by Tom M... |
function [trainPerf,valPerf,testPerf,gWB,trainN,valN,testN] = perfsGrad(net,data,hints)
% Copyright 2012 The MathWorks, Inc.
[gWB,Perfs,PerfN] = nnGPUOp.bg...
(net,data.Pc,data.Pt,data.Ai,data.T,data.EW,...
{data.train.mask data.val.mask data.test.mask},data.Q,data.TS,hints);
trainPerf = Perfs(1);
valPerf = Pe... |
clear
close all
clc
folder='R:\Projects\NRI\User_Study\Data\txtFile\';
robfile=fopen([folder 'MicronMoveI.txt']);
titleList={'psm_cur','psm_des','micron'};
line=fgetl(robfile);
cur.time=[];
cur.pos=[];
des.time=[];
des.pos=[];
micron.time=[];
micron.dat=[];
while line~=-1
temp=find(strcmp(line,titleList));
i... |
rng(taskId)
%%
paths = dataPaths();
resortIds = 1:66;
load(fullfile(paths.databases,'SC_Bastian','dti_20141209_preprocessed.mat'));
empSC = avg_ci;
empSC(isnan(empSC)) = 0;
empSC = empSC + empSC';
empSC = normGraph(empSC, avg_roi_size, 'ROIprd', true, 0);
dataEegTmp = load([paths.databases '/SC_Bastian/eeg_20150125_... |
[Notes, Labels, NFFT, FS] = load_notes();
%% Piano Only
% [y, ~] = audioread('soundfiles/p_easy.aiff');
% [y, ~] = audioread('soundfiles/p_med.aiff', FS*[20, 35]);
% [y, ~] = audioread('soundfiles/p_hard.aiff');
%% Piano & Violin
% [y, ~] = audioread('soundfiles/Bartok_PV.aiff', FS*[16.5, 36.5]);
% [y, ~] = ... |
% helperTriangulateLastFrames triangulate points from last two views
% [worldPoints, imagePoints] = helperTriangulateLastFrames(vSet,
% cameraParams, matchIdx, currPoints) returns world points triangulated
% from the last two views in the view set, which are also visible in the
% current image.
%
% vSet is a vi... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2014 Analog Devices, Inc.
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http:/... |
y=@(t)exp(-t.*t);
yf=quad(y,0,1) |
%function BayesDemonstrationRangefree()
%BayesDemonstration is used to demonstrate Bayes' rule for an underwater
%localization sestup
%
%The algorithm uses range-free localization
%
%
% Subfunctions:
%
% Author: Haoran Zhao, Master, Electrical Engineering
% University of Houston
% email address: zhaohaorandl@gmail.com... |
clear all
clc
PCA_or_LDA = 0; % 0 means PCA
% 1 means LDA
zitter_factor = 0.1;
File_Path = '../';
% Getting the files located in the folder
filelist = ls([File_Path,'*.arff']);
m = size(filelist,1);
in_data = cell(m,2);
for i=1:m
fid = fopen([File_Path,filelist(i,:)]);
c = ... |
function [resImg, Lo] = resampling(srcPath, srcType)
imgList = dir([srcPath '/' srcType]);
num = size(imgList,1);
% read captured light direction
Li = textread([srcPath '/lightvec.txt']);
Li = normr(Li);
coor = SubdivideSphericalMesh(IcosahedronMesh, 4);
coor = coor.X;
%get nneighbour
id... |
function mmapOut = recreateMmap(F, mmapIn)
%recreateMmap(F, mmapIn) recreates a memory map from the existing one
% it avoids problem of absolute path stored in memory map (which breaks the
% mmap if the folder was moved)
% F is the focus object to rebuild path
% mmapIn it the input memory map to redefine
p = split(mm... |
function [y] = f_polinomio_tailor(f, x, n)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
y = f(0);
for i = 1:n
y = y + (f(0)/factorial(i))*(x-0)^i;
end
end
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Crowding Distance Assignment for NSGA II %
% %
% Author : Julie... |
function [X_noised] = add_adaptive_noise_to_data(X, snr, remove_negative_terms)
% This function adds random noise to data. The noise is adapted to the
% absolute
%
% Input:
% ------------
% - X
% the raw data set.
%
% - snr
% Signal-to-Noise ratio. This parameter can be tuned to adjust the level of rand... |
clear all; clc
IC_str = '_front';
stat_meth = '_autor';
if strcmp(IC_str,'_front')
load(['CI' IC_str stat_meth '_all.mat'])
elseif strcmp(IC_str,'_gauss')
load(['CI' IC_str stat_meth '_all.mat'])
end
if strcmp(IC_str,'_gauss')
load(['advection_art_data' IC_str '_all_3_26.mat'])
elseif strcmp(IC_str,'_fro... |
% Exhibits ACF = 0.585 in ML cycle at finest level
problem = ufget(250);
g = Graphs.fromAdjacency(problem.A);
% g = Graphs.testInstance('mat/uf/HB/sstmodel');
[r,s,b] = runCycleAcf('graph', g, 'randomSeed', 5, 'clearWhenDone', false);
% Debug 2-level cycle at level 8
twoLevelAcf(s,2,8); % yields ACF = 0.392
%... |
%% beta_plot_ROI
% Plots betas extracted from ROIs
%
% MM/DD/YY -- CHANGELOG
% 06/27/14 -- Written by Yune
% 11/22/17 -- Updated by myself
% 04/23/20 -- Cloned for new isss_multiband, made universal
% 05/01/20 -- Simplified for hybrid > multiband comparison
% 10/13/20 -- Here we go again...
function beta_plot_ROI_v2(... |
classdef SvgTools < handle
methods(Static)
function exportCurves(filename, curves, scale)
% post-process for output
p_min = zeros(2,length(curves));
p_max = p_min;
for ci = 1:length(curves)
curves{ci}(2,:) = -curves{ci}(2,:);
p_... |
% Implemented by Shobeir Fakhraei for experimental evaluation in the following paper:
%
% @article{fakharei2014network,
% title={Network-Based Drug-Target Interaction Prediction with Probabilistic Soft Logic},
% author={Fakhraei, Shobeir and Huang, Bert and Raschid, Louiqa and Getoor, Lise},
% journal={... |
% UEqn.m
% Solve the Momentum equation
% Eqn. 23.4-4 from Fluent's User's Guide
% *************************************
% No viscous term is taken into account
% *************************************
% Assembling (implicit terms)
if (fullVerbose==1)
disp('Assembling UEqn')
end
%[M, RHS] = fvm_ddt(rhom,U0,V,dt,1... |
function[N_last,M_last, Z_last] = plot_diagrams(init, b)
% Takes initial values for M,N and Z and generates the plot
r1 = 0.18; r2 = 0.1045;
k1 = 5e6; k2 = 3e6;
a2 = 3.422e-9;
d1 = 0.0412; d2 = 0.0412;
%variable replacements
K1 = 1/k1; K2 = 1/k2;
% WHEN a11 = a33
% a1 = b*r1*(K1*(-b*r1+ d1*K2*r2)+K2*r2*a2... |
clc;
clear all;
close all;
r=1;
T=0.5;
mp=5;
ts=1.5;
% jieta = sqrt(1/(1/((log(mp/100)/pi)^2)+1));
% wn =3/(jieta *ts);
% a = -jieta*wn;
% b = wn*sqrt(1-jieta^2);
a=-1.95;
b=2.28;
p0=a+b*1i;
p1=0;
p2=-1/T;
anx=angle(p0-p1)+angle(p0-p2)-pi;
anp0=angle(p0);
anzc=anx/2+anp0/2;
anpc=anp0/2-anx/2;
zc=a-b... |
clear; clc;
N = 50;
x_start= -5;
x_end = 5;
y_start = -2;
y_end = 2;
x = linspace(x_start, x_end,N);
y = linspace(y_start, y_end,N);
[X,Y] = meshgrid(x,y);
Z = zeros(size(X));
w = ones(size(Y));
% Create line of sources
posx = linspace(x_start,x_end,5);
posy = [0 0 0 0 0];
u = zeros(N);
v = zeros(N);
for i = ... |
function histograma(fonte)
ext = strsplit(fonte,'.');
c = string(ext(2));
if(strcmp(c(1),'bmp'))
I = imread(fonte);
alfa = unique(I);
histogram(I,alfa);
elseif(strcmp(c(1),'wav'))
[y,Fs] = audioread(fonte);
n = audioinfo(fonte);
d = 2/(2^(n.BitsPerSample));
alfa = -1:d:1-d;
... |
% sets all default plotting properties, run once
% print settings
height = 7; % Height in inches
width = 10; % Width in inches
% screen info
s = get(0,'screensize');
% figure properties
set(0,'defaultAxesLineWidth',0.85);
set(0,'defaultLineLineWidth',1.2);
set(0,'defaultLineMarkerSize',6);
set(0... |
close all;
clear all;
R = 2;
k = 0.1;
ke = 5;
mr = 5;
r = 0.5;
mw = 0.5;
L = 0.1;
%moment bezwladnosci ramienia
Jr = 1/3*mr*r*r;
%moment bezwładności bez wody
J1 = Jr;
%moment bezwładności z wodą
J2 = Jr + mw * r*r;
%
% % A = [0 k/J; -ke/L -R/L];
% % B = [0; 1/L];
% % C = [1 0; 0 1];
% % D = [0; 0];
%
%Nastawy re... |
% SLIM Comptue a parameterization using Scalable Locally Injective Maps
% [Rabinovich et al. 2016]
%
% U = slim(V,F,b,bc);
% U = slim(V,F,b,bc,'ParameterName',ParameterValue, ...)
%
% Inputs
% V #V by 3 list of 3D mesh coordinates
% F #F by 3 list of triangle indices into F
% b #b list of boundary indices into... |
classdef Database < DynamicClass & handle & matlab.mixin.Copyable
properties(Hidden)
tableMap % ValueMap mapping :entryName --> Table
relationships % cell array of DataRelationship instances
singularToPluralMap % conversion table from entryName to entryNamePlural
pluralToSingularMa... |
% This demo shows how to easily look at ground-truth segmentations for a given video.
% Let's load the video of actor B playing jenga in the livingroom.
% getMetaBy() returns a struct that contains all possible meta information (including
% the ground-truth data) about the video. Check the getMetaBy() documentation fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.