text stringlengths 8 6.12M |
|---|
function [timestamps,meanProcessingTimePacket,sizeIn,sizeOut,meanVx,sdGlobalVx,meanVy,sdGlobalVy,meanRotation,sdGlobalRotation] = getMotionStatistics(varargin)
if nargin == 0
[filename, pathname] = uigetfile('D:/Google Drive/Studium/Masterthese/Data/Statistics/*.txt');
oldPath = cd;
cd(p... |
function obj = powerloss( obj )
%POWERLOSS Summary of this function goes here
% Detailed explanation goes here
z = obj.busdata(:,3) + j*obj.busdata(:,4);
Un = [obj.baseKV;obj.U];
Sfrom = Un(obj.busdata(:,1)).*conj(Un(obj.busdata(:,1))-Un(obj.busdata(:,2)))./conj(z);%线路首端流经功率
Sto = Un(obj.busdata(:,2)).*conj(Un(... |
function trial_data_cell = load_curl_data(filenames)
% loads all curl field data from folder, conditions it, and puts it into a
% cell array of TrialData structures
tgt_block_assign = [0 pi/2 pi 3*pi/2];
learning_block_ranges = 0:0.2:1;
trial_data_cell = cell(1,length(filenames));
for filenum ... |
function [ x, w ] = LegendreGaussGrids(n)
grids_file = strcat('/home/wang/matlab/LegendreGaussQuadrature/', int2str(n), ...
'-LegendreGauss.grids');
if ~exist(grids_file, 'file');
error(' Grids file %s does not exist', grids_file);
end
xw = load(grids_file, '-ascii');
x = zeros(n, 1);
w = zeros(n, 1);
m ... |
close all;
clear all;
%load('mat/betas_to_scores_glm=21_con=theory_change_flag_Num=1_sphere=10.0mm_reg=theory_change_flag.mat');
load('mat/betas_to_scores_glm=102_con=theory_change_flag_Num=1_sphere=10.0mm_reg=theory_change_flag.mat');
%ROI_ix = [1 2 3 5 7 11];
ROI_ix = [1 7 11];
mask... |
%% Plots Soliton Tunneling theory, numerics, and experiment
close all;
load('stdata_plot.mat');
Ttop = 4:Ttop(end);
Tbot = Tbot;
% ----- plot parameters -----
fs = 9; %fontsize
w = 8.5; %cm
h = 5.25; %cm
n = 10;
qaxis = [ 3 10.5 2 7.3];
xtick = [4:2:10];
ytick = [2:2:6];
fontsize = fs;
msiz... |
function logW=log_target(xt,z,tt,K1,para2,temper)
if nargin == 4
temper = 1;
end
N=size(z,2);
logW=zeros([1,N]);
parfor i=1:N
z_c=z(:,i);
% first stage
if isnan(K1)
logW1=0;
else
logW1=logmvnpdf(z_c,xt*0,K1);
end
% second stage
K2=kfcn(z_c,z_c,para2);
K2=0.5*(K2+K2');
K2=K2+eye(length(xt))*1... |
clear all;
% num_cells=4;
% T=80;
%num_cells=60;
%T=8;
N_states = 14;
qn=[1 0 0 -13.6;... % shell 1
2 0 0 -3.4;... % shell 2
2 1 -1 -3.4;...
2 1 0 -3.4;...
2 1 1 -3.4;...
3 0 0 -1.511;... % shell 3
3 1 -1 -1.511;...
3 1 0 -1.511;...
3 1 1 -1.511;...
3 2 -2 -1.511;..... |
function f = structdata_plotFFT(S_structdata,S_fig)
if strcmp(S_fig.type,'2DfieldFFT') || strcmp(S_fig.type,'3DfieldFFT')
if strcmp(S_structdata.type,'coeffs')
[~,CFvecs,~,x] = cavity_loadBasis(S_structdata.basis_loc,S_structdata.k_a);
temporal_data = userdata_calcTemporalField(S_st... |
% This scripts prepares the experimental setup and launches the
% experiments. It is called by the script main.m
% The results are saved in save_name.mat
% create m and N vectors
mm = round(logspace(log10(m_min),log10(m_max),Nmm)); % equally spaced on log scale
NN = round(linspace(Nmin,Nmax,NumbN));
% cre... |
function [ts, ys, asleep] = twocycles(ts, y_init, varargin)
%TWOCYCLES Wrapper my toy model
%
% Output:
%
% y(1,:) = x(t);
% y(2,:) = y(t);
%% Solve the differential equation
dy = dtwocycles(varargin{:});
opts = odeset('RelTol', 1e-6,'AbsTol', 1e-9);
sol = ode45(dy, ts, y_init, opts);
ts = sol.x;
ys = sol.y;
... |
function [ output ] = energy_value( u )
%ENERGY_VALUE Summary of this function goes here
% Detailed explanation goes here
global tri_num X_g_inv tri_areas exam_mesh amips_s K q c1 c2 d1
q_target = K * u + q;
output = energy_value_mex(tri_num, X_g_inv, tri_areas, exam_mesh.f, q_target, get_energy_type(), amips_s, c... |
clc; clear; close all
g_x = [1 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 1];
k = 8; % длина сообщения
r = length(g_x) - 1; % степень g(x)
num_messages = 2^k; % колво сообщений
[H, G] = hammgen(4); %
messages = de2bi((0:num_messages-1)');
codewords = zeros(num_messages, k+r); % масси... |
% function [A, B] = my_weighted_linear_fit(MSDs)
for i = 1:length(MSDs)
delta_var = (sum(MSDs(i).weights)*...
dot(MSDs(i).weights,MSDs(i).MSD(:,1).^2)-...
dot(MSDs(i).weights,MSDs(i).MSD(:,1))^2);
A(i) = (dot(MSDs(i).weights,MSDs(i).MSD(:,1).^2)*...
dot(MSDs(i).weights,MSDs(i).MSD(:,2)) - ...
dot(MSDs(... |
%%%%ENTRADAS
x_oo=-6;
z_oo=-8;
theta_inst=(pi/180)*45;
u_inf=[1,1];
posiciones_global=[-6 -8;-5 -8;-4 -8];
dt=1;
%posiciones_estela=;
%%%%
posicion_bs_anterior_global=posiciones_global(numel(posiciones_global)/2,:);
n_posiciones=numel(posiciones_global)/2; %lo mismo en algún momento ya se podría qui... |
function plotfamilystartup(handles)
% plotfamilystartup(handles)
global THERING
% Remove injection lattice
% set(handles.LoadtheInjectionLattice, 'Visible', 'Off');
% set(handles.SaveLatticetotheInjectionFile, 'Visible', 'Off');
% Remove production/golden lattice
set(handles.LoadtheGoldenLattice, 'Visible', ... |
function PlotScaling(dmax, j, save)
% PlotScaling(dmax, j, save) plots B-spline scaling functions of degrees 0
% through dmax at level j. If save is present, the plot is saved in an EPS
% file.
figure(1);
clg;
hold on;
j = j + 1;
n = 20; % samples per interval
hspacing = 1.4; % horizontal spacing between fun... |
function y = ElementStiffness3(he,E,A,lx,ly)
y = [(A*E*lx^2)/he, (A*E*lx*ly)/he, -(A*E*lx^2)/he, -(A*E*lx*ly)/he;...
(A*E*lx*ly)/he,(A*E*ly^2)/he, -(A*E*lx*ly)/he, -(A*E*ly^2)/he;...
-(A*E*lx^2)/he, -(A*E*lx*ly)/he, (A*E*lx^2)/he, (A*E*lx*ly)/he;...
-(A*E*lx*ly)/he, -(A*E*ly^2)/he, (... |
function [ L_t, S_t, iters, logData ] = ncrpca_ml( M, true_r, opts )
%% Based on the ncrpca function, with the low rank matrix approximation
% replaced by a multilevel approximation
%
% Author: Vahan Hovhannisyan, 2017.
startTime = cputime;
[~, n] = size(M);
t = 1;
idx = [];
thresh_const = opts.incoh; % threshold... |
function processed_segments = RMSDOWN_FIXnICA_splice_func(train_filename, target_sample_rate, RMS_window_size, downsample_filter_order, semg_sample_rate, semg_max_value, semg_min_value, mpu_max_value, mpu_min_value, semg_channel_count,mpu_channel_count,semg_channel,mpu_channel, mpu_segment_threshold, mpu_segment_index,... |
paramsets = {'Exploit','Explore'}
paramsetsn = [ 60, 10, 60000, 10; 600, 10, 20000, 10]
datasets = {'Audiology','CreditCard','HorseColic','Servo'}
datatypes = {'class','class','class','reg'}
neurons = [10,12,14,16,18,20]
prefixes = {'hnn','mlp','rbf'}
cd('Results')
for par = 1:length(paramsets)
params = paramsets{... |
function [ M ] = fwkin3001( q )
%Calculates 4x4 transformation matrix and matrix of Px,Py,Pz for each
%transformation
L1 = 135;
L2 = 175;
L3 = 169.28;
t1 = q(1);
t2 = q(2);
t3 = q(3);
% End effector Transformation
T = tdh_test(-t1, L1,(pi./2), 0) * ...
tdh_test(t2, 0, 0, L2) * ...
... |
% MIT License
%
% Copyright (c) 2017 JM Joseph
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, ... |
function [db_s] = FBenvndesc(db_s,handles)
if nargin < 2
handles = [];
end
mel_s = Fload('./filtreMel.mat');
freq_v = mel_s.center;
server_says(handles,'Computing noise moments',0);
for k=1:length(db_s.data_s)
db_s.data_s(k).envnSClin = Fmean(freq_v, db_s.data_s(k).envnMean_v);
db_s.data_s(k).envn... |
classdef nn_c < handle
properties
nu; % Array of number of units in each layer (exclude bias, include input and output layer)
theta_l; % Learned theta
end
methods
function [pred_raw,pred] = predict(obj,x,theta_l,threshold)
% Predict the output for an input x and theta
% If the... |
classdef logRegressionLoss
% classdef logRegressionLoss
%
% object describing logistic regression loss function
properties
theta
addBias
end
methods
function this = logRegressionLoss(varargin)
this.theta = 1e-3;
this.addBias = 1;
... |
function array_config2=place_element(array_config,x,y,z,Elt,Pwr,Pha)
% Place a single element in specific orientation and location
%
% Usage: place_element(n,xr,yr,zr,x,y,z,eltype,Pwr,Pha)
%
% n.......Element number (integer)
% xr......Rotation about X-axis (Deg)
% yr......Rotation about Y-axis (Deg)
% zr......... |
function omega = g_omega
% G_OMEGA Return earth rotation rate omega [radian/s] using the gsw toolbox
%
% OUTPUT omega - earth rotation rate in radian/s
%
% Gunnar Voet
% gvoet@ucsd.edu
%
% Created: 01/22/2016
omega = gsw_f(90)/2; |
function [pt_peaks, varargout] = find_r_peaks(signal, smaplerate, frame, ...
minPeakDistance, minPeakHeight, ...
returnPantompkinsed, adjustPeaks)
% find_r_peaks finds peaks in ecg signal
% INPUTS:
% signa... |
%Método de interpolación Splines Cúbicos
function T=spline_cubico(x,y)
n=length(x);
xx = 1:length(x); %para la tabla
format short
for i=1:n-1
h(i)=x(i+1)-x(i);
end
for i=2:n-1
alfa(i)=3/h(i)*(y(i+1)-y(i))-3/h(i-1)*(y(i)-y(i-1));
%esta es la b del sistema Ax=b
end
%Esto es para resolver el... |
function tmp
close all
clear all
clc
%% Single Sounds
marc
%% Load data
% cd('C:\DATA\Double\MW-PB-2010-07-31');
fname1 = 'C:\DATA\Double\MW-PB-2010-07-31\MW-PB-2010-07-31-0004';
[Sac,Stim]=loadmat([fname1]);
Sac = firstsac(Sac);
checkmissingtrials(Sac,Stim);
% First sound
sel = ismember(S... |
function f = poisp(x,lambda);
%POISP POISP(X,LAMBDA) is the cumulative distribution function at X
% of the Poisson distribution with mean LAMBDA.
% Reference: Johnson & Kotz, Discrete Distributions, p 114
% GKS 22 Sep 95
if lambda <= 0
error('Poisson mean must be positive.')
elseif x < 0
f = 0;
else
f = 1 -... |
clear
clc
close all
%call function ode45 to solve new model
[t,CN]=ode45(@Model,[0 100],[1 1]);
c = CN(:,1);
h = CN(:,2);
%plot solutions
plot(t,c);
hold on;
xlabel('$t$','interpreter','latex');
plot(t,h,'-');
l=legend('$c$ : Ca$^{2+}$ concentration','$h$ : Fraction of active IP$_3$Rs');
set(l, 'inter... |
function distance = calDistance(x,y)
%%
dif = x - y;
distance = sqrt(dif*transpose(dif) );
end
|
function f=vimpelplot(amplitude)
% Uppbyggnad och utritning av vimpel.
global vimpel
i=[-2 -1 1 2];
sinstartx=3.545; sinstopx=6;
Xv=[]; Yv=[]; Zv=[];
for x=1:0.05:2
scaledx=(sinstopx-sinstartx)*(x-1)+sinstartx;
Xv=[Xv;
x*ones(size(i))];
Yv=[Yv;
amplitude*sin(0.5*scaledx^2)/(scaledx)*ones(size(i))];
... |
% initialize
clc;
% clear;
close all;
set = 2;
B = 1; % budget length
global_dataset = getenv('DATASET');
switch(set)
case 1
%% Set 1: 2D planning dataset
fprintf('2D dataset\n');
train_folder = strcat(global_dataset, '2d_planner_dataset/train_data.mat');
validation_folder = strcat... |
function c=calfa(n)
%------------------------------------------------------------------------------------------
% CALFA
%
% The following program codes a number n like a word, that is to say it is written in
%
% base 26 and by means of a substitution it transforms it into the letters of the alphabet.
%
... |
function [tran_matrix] = transition_background_aux(prob, transition, m, r)
% change accumulated in one column or one row
% assume is strictly ordered
% r is genetic distance
% probability of no recombination exp(-r)
% recombination fraction, odd number of recombination
% odd: [1 - exp(-2r)]/2 ~ r - o(r^2) if r is s... |
function [vecX0, vecXi, vecX1, vecEa] = fun_SEC2(fun,x0,x1,error)
fx0 = fun(x0);
fx1 = fun(x1);
ea(1) = 100;
i=1;
vecX0 = nan(2,1);
vecXi = nan(2,1);
vecX1 = nan(2,1);
vecEa = nan(2,1);
while abs(ea(i))>= error
xi = x1 - ((fx1 * (x1-x0)) / (fx1 - fx0));
ea(i+1) = (abs(xi-x0)/xi)*100;
vec... |
function [] = extractTrainingData()
% Function to extract the training data and store the patches
% Written by Deepak Muralidharan, UCLA, 2016.
clc;
close all;
clear all;
addpath('/Users/deepakmuralidharan/Downloads/AOSLevelsetSegmentationToolboxM/AOSLevelsetSegmentationToolboxM'); %adding path ... |
function [ paths ] = getPaths( ROOT_PATH )
%GETPATHS Defines and creates useful paths
paths = struct;
paths.EXPORT = [ROOT_PATH, '\gen'];
paths.RES = [ROOT_PATH, '\res'];
paths.FROST = [ROOT_PATH, '\submodules\frost-dev'];
paths.C_FROST = [ROOT_PATH, '\submodules\C-Frost\Matlab'];
paths.MODEL = [ROOT_PATH, '... |
function[range] = rangePredict(robotPose,map,sensorOrigin,angles)
% RANGEPREDICT: predict the range measurements for a robot operating
% in a known map.
%
% RANGE = RANGEPREDICT(ROBOTPOSE,MAP,ROBOTRAD,ANGLES) returns
% the expected range measurements for a robot operating in a known
% map.
%
% INPU... |
function ANUM2es10s(m, n)
if m < 2*n+1 || mod(m,2) == 0
error('m oppure n non validi');
end
n = m;
x = linspace(0,2*pi,m);
f = sin(x).^2;
fplot(@(s) trigonometricAprossimation(s, x, f, m, n), [min(x), max(x)]);
hold on
fplot(@(s) sin(s)^2, [min(x), max(x)]);
legend('P_{'... |
function h=plott(p,fs,reverse)
%
% h=plott(p,fs,reverse)
% Plot sensor time series, p, sampled at fs Hertz against time in seconds
% By default, plott shows the y-axis reversed as for a dive profile.
% To prevent reversal, use:
% plott(s,fs,0)
% where s is the time series to plot.
% Optionally return... |
function B=bernoulli_pdf(y,theta)
B= theta^y*(1-theta)^(1-y);
end
|
push 1
push 2
push 3
push 4
push 5
pall
|
function [parameters, lpp] = runfit(fit_param, method)
options = optimset('display', 'off');
w = waitbar(0, 'Fitting subject');
tStart = tic;
for sub = 1:fit_param.nsub
waitbar(...
sub/fit_param.nsub,... % Compute progression
w,...
sprintf('%s%d%s... |
classdef VirtualConnection
%
properties
%
%
end %
%
%
methods
%
function tConnection = VirtualConnection( tParameters )
%
%
end;% default constructor
%
end % methods
%
end % classdef
|
function [data_matrix_out,data_labels_out] = reduce_data_size(data_matrix,data_labels,reqd_size)
% REDUCE_DATA_SIZE Reduce size of dataset to reqd_size which is how many
% data points per class - takes the first "reqd_size" data points in the
% input data matrix
% INPUTS %%%%
% data_matrix/data_labels - dataset to... |
function [ ssMatrix ] = VecToso3( inputVel )
% usage - Vectoso3(inputVel)
% input (inputVel) - A 3 vector representing angular velocity
% output (ssMatrix) - A 3by3 skew symmetric matrix version of input
% angular velocity. If the input is not valid, appropriate error message
% will be shown
% Example usa... |
%Empezar simulación
clc;
%clear all;
%close all;
kv=200; %max 500?
kp=(kv^2)/4; %Del libro
Kv = [kv,kv];
Kp = [kp,kp];
pert=0.8; %perturbación
stop_time=1.3;
step_sim=1e-2; %step para sim
wally = robo_init(pert);
%wally_noise = robo_init(pert);
%% Cálculos de trajectoria
start_pos=[-pi/2 pi/2];
p1 = [1 -1 0];
p... |
function [db_s] = FscanSoundFiles(ROOTDIR)
%% Brutal: on scan type par type.
filetypes_c = {'aif', 'aiff', 'wav'};
db_s = FscanFiles(ROOTDIR, filetypes_c{1});
for k = 2:length(filetypes_c)
dbTmp_s = FscanFiles(ROOTDIR, filetypes_c{k});
db_s.data_s = [db_s.data_s, dbTmp_s.data_s];
end |
%----- 1. variable declaration
inputSize = 15;
hiddenLayer1Size = 5;
hiddenLayer2Size = 5;
outputSize = 1;
lambda = 0.000001; % weight decay parameter
%----- 2a. load trainingset
inputD = csvread("/home/pinkpanther/Documents/Studies/Master Thesis/Data/octave/trainnongau.csv");
%disp(size(inputD)); %-... |
close all
clear all
decision_map_path = '/usr/not-backed-up/1_convlstm/convLSTM_prediction6_avenue/';
addpath('../')
addpath(genpath('../Persistence1D'))
%gt
testSeqPath = '/usr/not-backed-up/1_DATABASE';
load(fullfile(testSeqPath,'gt_avenue.mat'))
expand_range = 25;
%% EVALUATION CD/FA
% % global max min
% % load('x_b... |
clc
clear all
%% Procedimento para solução da equação 2D permanente do calor - Gauss Seidel com SOR
%Parâmetros do problema
Lx = 1; %comprimento total em x
Ly = 1; %comprimento total em y
dx = 0.05; %passo no espaço em x
dy = 0.05; %passo no espaço em y
nx = Lx/dx + 1; %n... |
%fgehbe
M=imread('A (5).png');
h= find(M==0); |
function [param, rmse]=circleFit(circleData, plotOpt)
if nargin<1, selfdemo; return; end
if nargin<2, plotOpt=0; end
x=circleData(1, :)';
y=circleData(2, :)';
n=length(x);
A=[2*x, 2*y, ones(n,1)];
b=x.^2+y.^2;
theta=A\b;
a=theta(1);
b=theta(2);
r=sqrt(theta(3)+a^2+b^2);
param=[a, b, r]';
temp=sqrt(... |
function [Utilde, Stilde, Vtilde] = kSVDPrototype(A, k, C)
% This is the k-SVD prototype algorithm
% ======================================
% Input: A: matrix to do k-SVD, A is m by n
% k: k-SVD parameter
% C: sketch matrix: Gaussian or CountSketch
% ======================================
[Q,R] = qr(C, ... |
function s = tanimoto_metric_cvip( vector1, vector2)
% TANIMOTO_METRIC_CVIP -calculates the Tanimoto similarity metric between two feature vectors.
%
% Syntax :
% ------
% d = tanimoto_metric_cvip( vector1, vector2)
%
% Input Parameters include :
% ------------------------
% 'vector1' Feature vector ... |
function [ grad ] = grad_function( u_x )
%GRADFUNCTION Summary of this function goes here
% Detailed explanation goes here
global tet_num X_g_inv tet_vols tet_mesh amips_s F_dot ver_num K q c1 c2 d1 x2u J_u J_ui JT_u JT_ui JV_u JTV_u wu bu
q_x = K * u_x + q;
JTJ_in = [J_ui(1), J_ui(2), JT_ui(1), JT_ui(2)]';
[J_q... |
function output = sumDigits(x)
%SUMDIGITS Adds up all the digits of an inputed integer.
% Recurssively adds up the digits of an inputed integer.
% Converting integer to an array of its digits.
x_arr = num2str(x) - '0'; % Doesn't work for integers with more than 2 digits???
% If the array is empt... |
function varargout = im2EdgeAvi(ext, imDir, scale, frameRate, fileName, map)
% im2avi converts image sequenses to avi video
%
% SYNTAX
%
% Inputs: imDir: image sequence directory
% ext: the extension name of the image such as 'jpg', 'tif',
% scale: image resize, like [320 400] or 0.9
% frameRate: avi video frame rate
%... |
function [tsteps_struct,counts] = hist2_extra(TSdataX,TSdataY,nbinsX,nbinsY)
Xmax = max(TSdataX);
X_stepsize = abs(Xmax-min(TSdataX))/nbinsX;
Ymax = max(TSdataY);
Y_stepsize = abs(Ymax-min(TSdataY))/nbinsY;
for iter = 1:1:nbinsX,
for iter2 = 1:1:nbinsY,
tsteps_struct(iter,iter2).binUpperX = nan;
tsteps_struc... |
function k = F0AM_get_ends(Sin, varargin)
Snew = Sin;
lt = length(Snew.Time);
Snew.Time = Snew.Time(end);
cnames = fieldnames(Snew.Conc);
c1 = eval(['Snew.Conc.' cnames{1}]);
szconc = size(c1,1);
if lt ~= szconc
display('Expecting Conc vectors to have number of rows equal to time point. Aborting...')
... |
%------------------------------------------------------------------
function output1 = deinterleav( sig, Nrows, Ncols)
i = repmat([0 : Ncols - 1]', Nrows,1);
j = reshape(repmat([1:Nrows],Ncols,1),Nrows*Ncols,1);
output1 = sig(Nrows * i + j);
end |
load data/data m x y yd periods Q Q_rand noise_lvl noise_factor f data_male_filter
filt = load('data/filter_male_a');
A = create_filter_matrix(filt.alpha, length(m));
rec = A \ m;
figure(1)
plot(x, rec)
hold on
plot(x, yd, 'g-', 'linewidth', 2);
xlim([0, x(end)])
scrsize=get(0,'Screensize');
set(gcf,'Position',scrsiz... |
function [pass,maxerr] = test(opt)
% Check indifference of apt() towards input dimensionality
t = linspace(-1,4,100);
S = dipolarsignal(t,3);
K = aptkernel(t);
Pfit1 = apt(S,K);
Pfit2 = apt(S.',K);
% Pass 1: outputs are unchanged
pass(1) = isequal(Pfit1,Pfit2);
% Pass 2: both outputs are columns
pass(2)... |
%
% this scripts illustrates the use of makekmz to generate kmz files
% for GoogleEarth overlay images
%
% For fun, two simple images (one in lat/lon, the other in
% northing/easting and rotated) are made to overlay the
% painted "Y" near Brigham Young University in Provo, UT USA
% kmz files are created for each that ... |
function [tb,sb]=birsoy_time(t,s,q)
%BIRSOY_TIME - Calculates the equivalent time of Birsoy and Summers
%
% Syntax: [tb, sb] = birsoy_time( t, s, q)
%
% t = vector containing the time steps
% s = vector containing the drawdowns
% q = matrix describing the pumping periods
% size = nb of lines = nb of pumping... |
function env = environment_nominal()
%CREATE_ENVIRONMENT Creates a struct that represent atmosphere conditions.
% The fields are initialized with sea level values.
%
% Output:
% env: struct holding values that represent atmosphere conditions.
% Contains the fields:
% - density : dens... |
% ANTIDIAG - Antidiagonal of matrix.
% GMR 2005
% ANTIDIAG(A, R, C) returns the antidiagonal of matrix where
% the diagonal is specified by the upper-right corner.
%
% Example
% A = [1 2 3; 4 5 6; 7 8 9];
%
% antdiag(A, 1, 3) produces [3; 5; 7]
%
% antdiag(A, 2, 3) produces [6; 8]
function adiag = antidiag(A, r, c)
... |
subs = {'alex','dina','genevieve','jeremie','karl','russell','valerie'} ;
for s=1:length(subs)
cd(['c:/shared/badger_mri/',subs{s},'/nii/']) ; ls
nii = load_untouch_nii('delay_mean.nii.gz') ;
img = squeeze(nii.img(:,:,:,3)) ;
[~,km] = kmeans(uint8(mat2gray(reshape(img,[1,numel(img)]))*25... |
function coef = applySRG(parameter)
load coef.mat coef
load SRGstep.mat SRGstep
load coefConvergence.mat coefConvergence
systemSuffix = parameter.systemSuffix(1 : 3) ;
while (coefConvergence > parameter.convergenceCriterion_SRG) && (SRGstep < parameter.maxSRGstep)
SRGstep = SRGstep + 1 ;
disp(['SRGstep = ', n... |
function z=exact_ITE_disc_elastic
% Computes first exact 2D ITEs for unit disc from Sun paper (NOT all though since eigenfunctions are not always rotational symmetric!!!)
% Only besselj(1,:) feasible as required to solve Bessel equation of order 1
format long;
% Lamé constants
u=1/16;
l=1/4;
% densities
rho... |
%This script is to run the simulation multiple times in order to gather
%mean results.
function meanrisetime = grossresult(controller,numsim)
%numsim is the number of times the simulation is to be run
%define arrays:
x=[];
y=[];
z=[];
xdot=[];
ydot=[];
zdot=[];
... |
function [op]=orthpoly(x,n,c)
%ORTHPOLY ORTHPOLY(X,N) calculates the orthogonal polynomials up
% to order N corresponding to vector X.
%
% ORTHPOLY(X,N,C) calculates constrained polynomials, so that
% the constant vector is not included.
% GKS 5 Mar 92. Revised 5 Dec 92.
if n>=0;
x=x(:);
if nargin<3,
op(... |
function [xt, lb] = LMO(gyt, domain)
%%%% determine the number of nonzeros in the solution
%%%% dependent on the domain type, generate an optimal solution
type = domain.type;
R = domain.R;
n = domain.n;
if type == 0 %% standard box intersected with simplex
xt = zeros(n,1);
[S_gyt, I_gyt] = sort(gyt)... |
function [ v, lambda] = MyPower( A )
x = rand(length(A),1);
v = x/norm(x);
for k = 2:100
vtemp = A*v;
lambda = dot(vtemp,v);
v = vtemp/norm(vtemp);
end
lambda;
v;
end
|
% Figure 10.78 Feedback Control of Dynamic Systems, 5e
% Franklin, Powell, Emami
%
% fig10_78.m is a script for the LQR(LQG) design for the disk
% drive case study
clf;
wm= 5*pi;
z=.05;
GM = 4;
a=0.1;
numG= [1/(50*pi) 1];
denG=[1/(25*pi^2) 1/(50*pi) 1 0 0];
sysG=tf(numG,den... |
% function [curlNormed, curlHistActive, curlHistCtrl, dbinArray] =...
% bootStrappingLoop(activeScore, ctrlScore, dt, cutoff, plotbox,...
% m, nbinArray, stdArray, plotstuff)
%
% Function that performs a bootstrapping procedure on an active and control
% set of time series
function [curlNormed, curlHist, dbin... |
%% reject_IC works with 05_ERP_esports_data_after_ICA folder:
% - Visualize ICs (topoplot, power spectrum, ERP image)
% - Mark ICs not related to brain activity and reject marked ICs
CFG = define_defaults();
%% Define function-specific variables
CFG.output_data_folder_name = ['stage_6_reject_IC', filesep, 'data'];
CFG... |
function psi = zero(m, phi)
if nargin < 2
phi = 0;
end
psi = zeros(2^m, length(phi));
psi(1,:) = 1;
end
|
data_source= fullfile(pwd,'Data','Fe_ei401.sqw');
proj.u = [1,0,0];
proj.v = [0,1,0];
pos = [1,1,0];
mff = MagneticIons('Fe0');
fixer = @(ws)(mff.fix_magnetic_ff(ws));
erange = [0,4,400];
zonelist = {[1,1,0],[1,-1,0],[-1,1,0],[0,1,1],[0,1,-1],[0,-1,1],...
[1,0,1],[1,0,-1],[-1,0,1]}; %,...
%[2,0,0],[-2,0,0],[0... |
function jacobi(A,B,P, max1)
% Input - A is an N x N nonsingular matrix
% - B is an N x 1 matrix
% - P is an N x 1 matrix; the initial guess
% - delta is the tolerance for P
% - max1 is the maximum number of iterations
% Output - X is an N x 1 matrix: the jacobi approximation to
% ... |
function [ model ] = Game2MDP(varrewards)
%%GAME1MDP Creates a model of the simple stair climbing MDP from the lectures
% if g is the gamma value and r is the variable reward (varreward( then we ask matlab to solve:
% solve('v=0.2*(0.05+g*v)+0.8*g*(p*(5*x+g*v)+(1-p)*(5*0.1+g*v))','v')
% solve('v=0.8*(1+g*v)+0.2*g*(p*(5... |
function [error_train, error_val] = ...
learningCurve(X, y, Xval, yval, lambda)
%LEARNINGCURVE Generates the train and cross validation set errors needed
%to plot a learning curve
% [error_train, error_val] = ...
% LEARNINGCURVE(X, y, Xval, yval, lambda) returns the train and
% cross validation set e... |
function GUIRNT(Parent)
% GUIRNT Sub-GUI for Run New Tracking
%
% Written by: Michael M. Deng
% Last updated: 4/22/2016
% Constants
FULL_FILL = [.02 .02 .96 .96];
TOP_FILL = [.02 .51 .96 .47];
BOT_FILL = [.02 .02 .96 .47];
LEFT_FILL = [.02 .02 .47 .96];
RIGHT_FILL = [.51 .02 .47 .96];
% Defaults
defFileSetts = struct... |
clc
clear all
close all
% initial conditions of the robot
motors0 = [0; 40; 3695; 9537; -5807; -334; 18810;-2000; 1; 8801; 0; 40; -3730; -9537; 5807; 425; -18800; 2000; 0; -8800; 418; 60; 60]; %initial pose arms down
%motors0 = [0; 40; 3695; 9537; -5807; -334; -6984; -3045; 1; 8801; 0; 40; -3730; -9537; 5807; 425;... |
function f = interpolated_series(x_nodes, y_nodes, interpolation_type, xs)
ys = ones(1,length(xs));
for i = 1: length(xs)
if interpolation_type == 1
ys(i) = lagrange_interpolation(x_nodes,y_nodes,xs(i));
else
ys(i) = newton_interpolation(x_nodes,y_nodes,xs(i));
end
end
f = ys;
|
%%%% CBSD Randomization
function np_cbsd_rand_cata_opt1_with_azi_deployment_sort
load('list_census_cata.mat','list_census_cata')
%CAT A
cata_eirp=26; %CatA 26dBm;
%Dense Urban Antenna Height
anthp1_dur=0.5;
anth_dur_r1=3;
anth_dur_r2=15;
anthp2_dur=0.25;
anth_dur_r3=18;
anth_dur_r4=30;
anthp3_dur=0.25... |
function features = descriptor(file_vector)
%Creates features vector using HOG
siz = length(file_vector);
features = cell(siz, 1);
cellSize = 8; %size of hog cell
for i = 1:siz
img = imread(file_vector{i});
features{i} = vl_hog(single(img), cellSize);
end
end |
num = [1];
den = [1 6 5 0];
Kvalues = [0 5*logspace(-5,0,1000)];
Kvalues = [0:.01:1000];
rlocus(num,den,Kvalues)
num1 = 6.2777*[ 7.84 22.4 16];
% num1 = 5*[1 2.8 1.4^2];
den1 = [1 6 5 0 0 ]; |
clear; clc;
meanfit = []; Rfit = []; Cfit = []; biasedSD=[]; guessfit=[]; targetSD=[];
richSD = []; controlSD = [];
tprop =[]; fqprop = []; rqprop = []; guessprop = []; targetfit = [];
load('degOffs'); incdegoff = [];
% model.paramNames = {'muT','g','sdT'};
% PlotConvergence(fit.posteriorSamples, model.paramNames);
%... |
function nrQ=near_ringQ(sC,n)
% NEAR_RINGQ checks whether the collection cS is a near ring.
%
% Example:
% sC=[2 7 11 13 14];
% nrQ=near_ringQ(sC,4), returns true, that is,
% 1.
%
% Usage: nrQ=near_ringQ(sC,n)
% Define variables:
% output:
% nrQ -- Returns true (1) is the collection sC is... |
% Creates segmentation results from detection results.
% CREATE_SEGMENTATIONS_FROM_DETECTIONS(ID) creates segmentations from
% the detection results with identifier ID e.g. 'comp3'. All detections
% will be used, no matter what their confidence level. Detections are
% ranked by increasing confidence, so more confiden... |
% Test af sfind
nstp=100;
a=[1 -1.5 0.7];
b=[1 0.5];
c=[1 0.8];
f=1;
d=1;
ms=idpoly(a,b,c,d,f,'nk',1)
fprintf('Generating estimation set \n');
u=prbs(nstp,15);
e=randn(nstp,1)*0.1;
y=sim(ms,[u e]);
%idplot([y u]);
Ze=[y u];
%Ze=dtrend(Ze);
fprintf('Generating test set \n');
u=prbs(nstp,15);
e=randn(nstp,1)*0.1;
y=s... |
xRange = -2:0.1:5;
yRange = -6:0.1:6;
grids = cell(length(yRange) - 1, length(xRange) - 1);
occ_grid = zeros(length(yRange) - 1, length(xRange) - 1);
xValues = xRange + 0.05;
xValues(end) = [];
yValues = yRange + 0.05;
yValues(end) = [];
rad = 0.11;
figure; hold on;
b = [min(yRange) max(yRange)];
for i=1:length(xRange... |
function spy_koeff(Ahyd)
%spy_koeff
%
%spy_koeff(Ahyd)
%Click on a spy plot and get the desired value
%@(#) spy_koeff.m 1.2 96/08/21 13:57:49
[x,y]=ginput(1);
disp(['x=' num2str(round(x)) ' y=' num2str(round(y)) ' c=' num2str(Ahyd(y,x))])
|
function plot_table(family_display)
n_ind = family_display.num_ind;
len = 20;
lines = ceil(n_ind/20);
allele_string = family_display.allele_string;
id_string = family_display.id_string;
for i = 1:n_ind
order = floor((i-1)/len);
x = mod(i-1,len)+1;
text(x,-(1+order*4),id_string{i}, 'VerticalAlignment', ... |
% clear;clc;close all;
%% szablon wejsc:
%Wprowadzenie wagi statycznej
waga_statyczna=769.58; % masa 1
% waga_statyczna=367.94; % masa 2
% waga_statyczna=361.26; % masa 3
% waga_statyczna=361.25; % masa 4
%Wprowadzenie ości rzędów
Order=[1:100]; % z góry określony rząd
nazwaPliku1='m1_s01b';
nazwaPli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.