text stringlengths 8 6.12M |
|---|
#include "com_codename1_io_BufferedInputStream.h"
const struct clazz *base_interfaces_for_com_codename1_io_BufferedInputStream[] = {};
struct clazz class__com_codename1_io_BufferedInputStream = {
DEBUG_GC_INIT &class__java_lang_Class, 999999, 0, 0, 0, 0, &__FINALIZER_com_codename1_io_BufferedInputStream ,0 , &__GC_MA... |
function [match,error ]=FindMatches(template,sample_image)
ws=size(template,1);
padded_image = padarray(sample_image,[floor(ws/2) floor(ws/2)] );
SSD=zeros(size(sample_image,1),size(sample_image,2));
ValidMask = template;
ValidMask( ValidMask>0 )=1;
Sigma=size(template,1)/6.4;
GaussMask = fspecial('gaussian', size(te... |
global NO_REPLICATIONS ITERMAX NET_ITERMAX NA NS TPM TRM EPSILON LAMBDA FIS ACTION_2_VALUE SLA MONDATA NORMONDATA
% ------------------------------------------------------------------------
% Authors: Pooyan Jamshidi (pooyan.jamshidi@gmail.com)
% The code is released under the FreeBSD License.
% Copyright (C) 2016 Pooy... |
% Gaussian Highpass Filter
%
% Author: Wu Jiangnan 2019/4/5
%
function [ Hd ] = GaussLPF( input,D)
% input : image in 'double' data type , 2 dimensions
% D : Gaussian end frequency
% range is [0,1] ( normalized )
Hd_low=GaussLPF(input,D);
Hd=ones(size(Hd_low))-Hd_low;
end |
function out = swapLongestTriple(x)
out = zeros(size(x));
out(:) = x(:);
n = numel(x);
load('cities.mat')
for i=1:n-2
d1 = (locs(out(i),1) - locs(out(i+1),1)) ^ 2 + (locs(out(i),2) - locs(out(i+1),2)) ^ 2;
%d2 = (locs(out(i+1),1) - locs(out(i+2),1)) ^ 2 + (locs(out(i+1),2) - locs(out(i+2),2)) ^ 2;
d3 = (l... |
% Função de Degrau bipolar
function y = degrau(u)
if (u >= 0)
y = 1;
else
y = -1;
end
end |
function [ord] = dendrorder(Z)
% DENDRORDER Get order of leaves in dendrogram
%
m = size(Z,1)+1;
leafOrder = [];
% For each node currently labeled m+k, replace its index by
% min(i,j) where i and j are the nodes under node m+k.
Z = transz(Z);
T = (1:m)';
A = zeros(4,m-1);
B = A;
n = m;
X = 1:n;
Y = zeros(n,1);
r = ... |
% Run analysis on a state. blocksize, tmin_min and tmin_max are optional arguments!
% If the optional arguments aren't supplied, it looks for a fitparams file.
% 08-20-2014: Load information from info.dat.
% 01-12-2015: Added 'noerrors' flag, which much be set to 0 or 1 if one wants to specify maxes and such.
% ... |
function [valout,Mf]=getCTEVect(M1,phi,theta)
%get the thermal expansion in a direction where phi is the angle
%between the vector and the z axis and theta is the angle
%between the projection of the vector on the x-y plane and the x axis
%CTERun License
%Copyright (c) 2012, The Kriven Research Group. All rights res... |
close all;
clear all;
N = 10000;%#samples
S=[];
r = [0.06]; %mean interest rate as initial
C = 1350;%Strike price
r0 = 0.06; %mean interest rate
sigma = 0.1;%volatility
T = 5.0;%maturity time
tau = 1.0; %ralaxation time
gamma = 0.3; %measure of volatility
dt = 5/1000;%lentgh time step
for n=1:N
currS = 1000;
... |
function ObjVal = rosenbrock(Chrom,switc);
% Dimension of objective function
Dim=size(Chrom,2);%·µ»Ø¾ØÕóµÄÁÐÊý
% Compute population parameters
[Nind,Nvar] = size(Chrom);
% function 11, sum of 100* (x(i+1) -xi^2)^2+(1-xi)^2 for i = 1:Dim (Dim=10)
% n = Dim, -10 <= xi <= 10
% global mini... |
clear all;
%% Define parameters
% What CVD?
CVD = 'protanopia';
% Which photoreceptor classes?
photoreceptorClasses = CVDToPhotoreceptorClasses(CVD);
% Field size
fieldSize = 27.5; % degree visual angle
% Pupil diameter
pupilDiameter = 6; % mm
% Observer age
observerAge = 32;
%% Define direction: mel isolating
% D... |
function exerciseNearNeigh
import brml.*
load NNdata
n=[600 600]; % number of training points in classes
trainlabel{1}=5*ones(1,n(1));
trainlabel{2}= 9*ones(1,n(2));
trainlabels=[trainlabel{1} trainlabel{2}];
xtest=[test5 test9];
train =[train5 train9];
for K=1:6
for leaveout=1:sum(n)
fprintf(1,'\nK=%d, ... |
% GenerateLUT.m
% 11 May 2015, Derin Sevenler
% This script walks you through generating a lookup table for IRIS image processing.
% This script is only configured to work with TIFF stacks collected using micromanager,
% saved in the order (blue, green, orange red). Use only a single image (not a time series)
% with ... |
function [RHSA, RHSU]=bifurcationRHS(N,A,U,qW,qP,LPminus,LPplus,LP,epsilon,boundaries,bifurcations,parameters, currentUpper, nextLower, currentLower, previousUpper,iM,iJ)
%
%INPUTS:
%
%N - the number of elements
%
%boundaryConditions
%parameters(i,:)=[Beta a0 rho]
segments=... |
function g=normalization(f)
% Copyright (c) 2013 Shuhua Li
tmp=max(abs(f));
tmp=repmat(tmp,size(f,1),1);
g=f./tmp; |
function sevec = figresize(bw2)
% This function take the cropped binary image and resize it to 5 x 7
% char representation as single vector.
bw_7050=imresize(bw2,[70,50]);
for cnt=1:7
for cnt2=1:5
Atemp=sum(bw_7050((cnt*10-9:cnt*10),(cnt2*10-9:cnt2*10)));
sevec((cnt-1)*5+cnt2)=sum(Atemp);
end
e... |
function [Am,Bm,km,Cm,s2]=sysinit(dets)
% Initialise system, ie. determine models and constants.
%
% Usage: sysinit
%
global t Ts; % Time administration
global thS fiS pilS se; % D-time Linear model
global datath0;
Ts=1.5;
shw=0;
%--------------------------------------------------------... |
function [xi_est, yi_est, ss_var]=getSScores1(res, x, t_x, y, t_y, nosvd, sigma_new, error, method, shrink, regular, rho)
mu_x=getVal(getVal(res,'xx'),'mucopy');
sc_x=getVal(res,'sc_x');
lambda_x = getVal(res,'lambda_x');
sigma_x = getVal(getVal(res,'xx'),'sigma');
out1x = getVal(res,'out_x');
mu_y=getVal(getVal(res... |
function [xbest, y_eval] = xacmes(strfitnessfct, N, MAX_EVAL, varargin)
global settings;
settings.strfitnessfct = strfitnessfct;
settings.ftarget = fgeneric('ftarget');
wrapperfct = 'xacmes_evaluate';
% ----------- Surrogate modelling extensions ------------
% author: Bajer&Pitra, 2015
if (~isempty(varargin)... |
function error = q3_cross_validation_error(Xtrain, Ytrain, k, N)
% Evaluate the cross validation error of kNN classifier with different
% values of k
% INPUT
% Xtrain : [m x n] matrix, where each row is an n-dimensional input *training* example
% Ytrain : [m x 1] vector, where the i-th element is the labe... |
classdef mySpamFilter < myNaiveBayes
%mySpamFilter extends myNaiveBayes class with file processing
% This is a subclass of myNaiveBayes and adds an ability to
% use dataset from SpamAssasin.
%
% The source files are grouped in three folders: 'easy_ham',
% 'hard_ham', and 'spam', and t... |
function [burstInfo, allBursts] = bursts(dest_dir)
% This function will return burst information from input neuron spike train
% burstInfo contains information for evaluating
% the shape of the ISI joint scatter plot for identifying if the
% neuron shows bursting pattern.
% allBur... |
function t = maxViewTimeStat(Ro, visible_ang)
% T = MAXVIEWTIMESTAT(RO,VISIBLE_ANG) calculates the maximum length of time
% a satellite in a circular orbit will be visible from the ground when
% passing directly overhead through the zenith of the observer, given a
% minimum viewing angle above the horizon.
%
% Inputs... |
function [z]=g(r,c)
%
% DO NOT MODIFY THIS FILE!!!!!
%
% r=(u,v)'
% z=g(r,c)=(g1(u,v,c), g2(u,v,c))'
%
N=128;
da=pi/N;
a=[0:N]*da;
[x,y]=meshgrid(a,a);
%
alpha=c;
mu=0.6;
alpha0=1;
E=1;
r1=1-r(2);
r3=r(1)-1;
%
h1=sin(y).*cos(x);
h3=cos(y);
g0=sin(y).*exp(alpha*r1*h1+(alpha*r3+mu*E)*h3+0.5*alpha0*E^2*h3.^2);
%
g=g0;
g(:... |
clear; close all;
file_name = './data/raw_semg_force_angle_2.txt';
mkdir('./data/output');
train_output_filename = './data/output/exp_S2FA_DS200_SEG_2.txt';
force_threshold = 0.15;
semg_channel_count = 2;
mpu_channel_count = 1;
force_channel_count = 1;
semg_channel = 1:2;
force_channel = 3;
mpu_channel = 4;
semg_m... |
% __ ___ __ ____ ________ ___
% / / / / | /| / / / __/______ / ___/ _ | / _ \
% / /_/ /| |/ |/ / / _// __/ _ \/ /__/ __ |/ , _/
% \____/ |__/|__/ /___/\__/\___/\___/_/ |_/_/|_|
% System Modeling and Simulations
%
% AutoSim Graphic User Interface v1.1
% Written by... |
clear;
clc;
for i=11:25
clearvars -EXCEPT i;
ground = imread(['XRAY_g/', num2str(1000+i), '_g.png']);
adaptive = imread(['XRAY_a/', num2str(1000+i), '_a.png']);
g_a = 0;
g = 0;
a = 0;
for i_x = 1:size(ground, 2)
for i_y = 1:size(adaptive, 1)
if ground(i_x,... |
%% stream signal tap data in matlab
setenv('path', ['C:\altera_lite\16.0\quartus\bin64;' getenv('path')]);
addpath 'C:\altera_lite\16.0\quartus\bin64';
alt_signaltap_run('VERBOSE_ON')
while(1)
tic;
data = alt_signaltap_run ('C:\Users\saurabhg\Desktop\fpga-spreadspectrum-adaptivefilt\a2dv2\stp3.stp', 'signed', 'only_coe... |
%Code used to detect filaments in image files
%Change the variables under common variables to optimize detection
%depending on the image
%F1 and F2 contain codes adapted from @cwchung1996/AFMFibrilPolyMorph
%common variables to change:
new = 1; %set to 1 to load new tiff image file, 0 to keep current image
thres... |
function [a b siga sigb r2 q y_fit delta]=expLinearFit(x,y,dy,useErrorBars,output)
% Fits an exponential function a*exp(b*x) to the data (x,y), by:
% fitting a straight line a+b*x to the data (x,log(y)), with y errors sigy.
% If there are no error bars, set useErrorBars=0, otherwise useErrorBars=1
% All output is... |
function fact = MyRecFactorial(x)
if x < 0
fact = -1;
elseif x == 0
fact = 1;
else
fact = x * MyRecFactorial(x - 1);
end
end |
clc;clear;
addpath('clf');
addpath('lib');
addpath(genpath('lib/manopt'));
addpath('evl');
dat0='dt/Computers.mat'; %Change Dataset
[obj_old,tstv2,P,lambda,gamma,in_result, out_result] = run_arts(dat0);
out_result = rmfield(out_result, 'time');
in_result(1).type='Recovery 70%';
in_result(2).type='Recovery 30%';
out_r... |
% synthetic_study.m
%
% This script is intended to generate synthetic "surveys" of movements in
% Burkina Faso based upon the equation in Marshall et al. (2018)
addpath('Shared');
clear;
% Make sure the output path exists
if ~exist('out', 'dir'), mkdir('out'); end
study(1000)
function [] = study(trials)
% Load ... |
function f_beep(n)
% - play a custom sound file
%
% USAGE: f_beep(n);
%
% n = # times to play sound file (default = 1)
%
% SEE ALSO: beep, wavread
% -----Author:-----
% by David L. Jones
%
% This file is part of the FATHOM Toolbox for Matlab and
% is released under the GNU General Public License, version 2.
% ---... |
function GatingMean(varargin)
% Wrapper to call JitterBackTex_JitterObjTex
%
% Divide the screen in object and background.
% Object will be a given texture changing phases every so often.
% Back will be a grating of a giving contrast and spatial frequency
% that reverses periodically at backReverseFreq.
global screen
... |
% This function performs the training at node k.
% Copyright (C) 2012 Quan Wang <wangq10@rpi.edu>,
% Signal Analysis and Machine Perception Laboratory,
% Department of Electrical, Computer, and Systems Engineering,
% Rensselaer Polytechnic Institute, Troy, NY 12180, USA
%
% You are free to use this software for a... |
function b = BrainStep(robot, time);
b = robot.Brain;
%% Add code here
fetchIrLeft = robot.RayBasedSensors(1).Reading;
fetchX = robot.Odometer.EstimatedPosition(1);
fetchY = robot.Odometer.EstimatedPosition(2);
fetchEstimatedHeading = robot.Odometer.EstimatedHeading;
if (b.CurrentState == 0)
b.LeftMotorSignal = b... |
% Application of simple limits/bounds
function s=simplebounds(s,Lb,Ub)
% Apply the lower bound vector
ns_tmp=s;
I=ns_tmp<Lb;
ns_tmp(I)=Lb(I);
% Apply the upper bound vector
J=ns_tmp>Ub;
ns_tmp(J)=Ub(J);
% Update this new move
s=ns_tmp; |
function [ TranMX, DistMean, DistCov ] = ...
PriorConstructionUpdate( Smoothedt, SmoothedtMinus, SmoothedCovt, SmoothedCovtMinus, ConvtMinus )
%PriorConstructionUpdate update:
% transition matrix: TranMX d-by-d
% disturbance mean: DistMean d-by-1
% disturbance covariance matrix: DistCov d-by-d
TranMX = S... |
function project_MP_ROIs_2func(session_dir,runNums)
% Creates correlation matrices between ROIs for M and P
%
% Usage:
% create_MP_matrices(session_dir,runNums)
%
% Written by Andrew S Bock Nov 2015
%% set defaults
hemis = {'lh' 'rh'};
ROIs = {'V1_pRF' 'V2_pRF' 'V3_pRF' 'LGN'};
%% Find bold dirs
b = find_bold(s... |
function [j]=partition(p,q)
global cpl;
global a1;
i=p;
j=q;
v=a1(p);
while(1)
while(1)
i=i+1;
if(i==q)
break;
end
cpl=cpl+1;
if(a1(i)>v)
break;
end
end
while(1)
j=j-1;
if(j==p)
break;
end
cpl=cpl+1;
... |
function [data, elapseTime] = runScope1Ch()
% [data] = runScope1Ch()
%% Initialize Global Variables
global ps5000aDeviceObj;
global scopeStatus;
starttime = clock;
manualPolling = false;
if (manualPolling==false)
[status, timeIndisposedMs] = invoke(ps5000aDeviceObj, 'runBlock', 0);
else
[status, timeIndispos... |
function imgOut = copy_paste_forge(imgIn, varargin)
if nargin == 2;
try copies = varargin{1};
assert(isnumeric(copies))
assert(isscalar(copies))
assert(copies - floor(copies) == 0)
assert(copies > 0);
catch
error('number_of_forgeries should be a positive integer');
... |
function [ spike ] = dpa_des_power_simplest_model_criteria(mean)
%DES_POWER_SIMPLEST_MODEL_CRITERIA(MEAN ) return the peak height
spike = max(mean);
|
classdef dbNaverLabs_1F_Test < dbBase
methods
function db= dbNaverLabs_1F_Test()
db.name= sprintf('NAVERLABS_Indoor_1F_test');
paths= localPaths();
dbRoot= paths.dsetNAVERLABS;
db.dbPath= [dbRoot, 'Train/'];
db.qPath= [dbRoot... |
% charakterystyka pompa
h=9.5;
a=31;
w=5;
sterowanie=[0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1];
czas=[167.73 59.23 41.63 33.02 26.78 22.61 19.96 17.61 16.26 14.93 13.76 12.9 11.88 10.91 10.75];
objetosc=zeros(length(czas));
objetosc=objetosc(1,:)+a*w*h;
wydajnosc_pompa=objetosc./czas;
interp... |
function [datmean,datmedian,datvar,datstd] = stat_summary(data)
% [datmean,datmedian,datvar,datstd] = stat_summary(data)
%
% INTPUTS:
% data - Nx1 vector of numerical data
%
% OUTPUTS:
% datmean - arithmetic mean of data values
% datmedian - median of data values
% datvar - variance of data
% datstd ... |
% Segment the gut to remove background signal from the bulb.
%
%
function [gutMaskAll, im] = segmentBulb(param, saveData, displayData,im)
%% Load in image stack
maxS = param.expData.totalNumberScans;
fileDir = param.dataSaveDirectory;
color = param.color;
%Filter size for std. dev. filter
filtSize = 5;
... |
function log4m_make_instance(log_file)
% LOG4M_MAKE_INSTANCE Make instance of log4m
%
% (c) Tomoya Sakai, The University of Tokyo, Japan.
% sakai@ms.k.u-tokyo.ac.jp
global LOG;
log_dir = fullfile(pwd, 'log');
if ~exist(log_dir, 'dir')
mkdir(log_dir);
end
LOG = log4m.getLogger(fullfile(log_dir, log... |
%% some Auxilary functions
% load superpixel segmentations (for using parfor)
function [seg,labels_img,seg_vals,seg_lab_vals,seg_edges,seg_img]=loadSpSegmentations(SpPath)
load(SpPath);
end |
%function AdjacencyMatrix = ReadInputFromTriang(input)
clear all;
close all;
clc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The code needs the input file "Input.txt" in which there are the
% neighbor lists of all triangulations got from the modified Sulanke's
% code.... |
%@(#) remblank.m 1.5 97/12/29 10:48:12
%
function utfil=remblank(infil);
utfil=infil;
if ~isempty(utfil)
i=find(abs(utfil)==32);utfil(i)='';
if length(utfil)>0,i=find(abs(utfil)==0);utfil(i)='';end
end
|
%% Прочитать из папки все .bmp картинки в cell-array
dirlist = dir('sized/*.bmp');
n = size(dirlist,1);
clear C;
for i = 1:n
C{i} = fullfile(dirlist(i).folder, dirlist(i).name);
end
%%
imnum = 1;
img = imread(C{imnum});
imtool(img);
%%
minval = min(img(:));
img2 = img - minval;
img2 = im2double(img2);
maxval = m... |
%% lateral resolution (analytical)
close all; clear all
x = -2*pi:pi/1000:2*pi;
y = sinc(x).^2;
det_y = abs(hilbert(y));
figure
plot(x,y,x,det_y)
figure
hold on
plot(fftshift(abs(fft(y))))
plot(fftshift(abs(fft(det_y))))
hold off
%% k-space rf vs detected
close all; clear all;
load('./mat_files/hw2_foc_psf_v2.mat... |
G = 6.6738480e-11; % m^3 kg^-1 s^-2
M1 = 5.9742e24; % kg
M2 = 7.3477e22; % kg
R = 384400000; % m
Mu = G*(M1 + M2); % Standard gravitational parameter
AngVelSq = Mu / (R^3); % Square of angular velocity of orbit
% Mass 1 at 0,0
% Mass 2 at R,0
% Center of mass of 2-body system
CMX = (0 * M1 + R * M2) / (M1 + M2);
CMY... |
% Realize polynomial regression of data of US population from 1900 to 2000,
% with fitting order from 1 to 5.
% Extra requirement: Use Gaussian Elimination to solve the problem.
y = [ 75.995 91.972 105.711 123.203 131.669 150.697 ...
179.323 203.212 226.505 249.633 281.422]'; % US population
t = (1900:10:2000... |
function x = lognorm(v_log)
x = v_log(1);
for i = 2:length(v_log)
x = logsum1d(x, v_log(i));
end
end
function x = logsum1d(log_a, log_b)
if (log_a < log_b)
x = log_b + log(1 + exp(log_a - log_b));
else
x = log_a + log(1 + exp(log_b - log_a));
end
end
|
function [] = qtb_check(psi)
global qtb_state qtb_n qtb_statistic;
F = abs(psi' * qtb_state)^2;
index = find(qtb_statistic.iterations == qtb_n);
if isempty(index)
qtb_statistic.iterations = [qtb_statistic.iterations, qtb_n];
qtb_statistic.fidelity{end + 1} = F;
else
... |
function VoigtSpectrGUI
%this is a GUI program i wrote about simulating absorption lineshape and
%spectrum from HITRAN output data
% this program simulate the spectrum using the HITRAN data and
% Calculating the Voigt porfile According to the paper:
% Applied spectro. V58, 468(2004);
% Phi= A*K(x,y)
% T... |
function[dop1,A02,A05]=correlated_clique_set(dopla,n,w,A0,gs_max)
[r2,c2]=size(dopla);
for i=1:r2
dop1(i,:)=[dopla(i,:),n-sum(dopla(i,:))];
end
x=1;
for i=1:length(A0)
clear A01
A01=A0{i};
dop=dop1(A01,:);
clear dopla edopla
[ed... |
function [y] = centre_finder_manipulate(x,timestamp)
%The matrix x which is input to the function should be in following format
%TRIPID/TIMESLOT/CENTRE
tripid=x(:,1);
n=unique(tripid);
l=length(n);
y=[];
for i=1:l
r=x((tripid==n(i)),:);
time=timestamp(tripid==n(i));%for each trip id
... |
%% box_indices
% Below is a demonstration of the features of the |box_indices| function
%
%%
clear; close all; clc;
%%
% Plot settings
fig_color='w'; fig_colordef='white';
faceAlpha1=1;
faceAlpha2=0.65;
edgeColor1='none';
edgeColor2='none';
%% |box_indices| for 2D arrays
siz=[25 25];
M=ones(siz);... |
%% Indexes exported data directory and iteratively loads files for measurements
% meta.archive.WT_channels_chosen=[]
% meta.archive.KO_channels_chosen=[]
%% sorts filenames into WT or KO
meta.archive.WT_filenames=cell(1);
meta.archive.KO_filenames=cell(1);
meta.archive.dir=pwd;
files=dir;
for idx=1:numel(files)
f... |
%softmax多类别分类
function W = softmax2(train_x,train_y,test_x,test_y, num)
%有O个样本,N个特征,M个分类
%X为样本矩阵,O行N列,每行为每个样本的数据
%W为权重样本,M行N列,每行为每类特征的分类器
%P为标签矩阵,O行M列,每行为该样本的类别数据
%X*W'为O行M列,每行为每个样本的经过各分类器得到的分类信息
%Q为softmax之后得到的矩阵,O行M列,每行为每个样本的经过各分类器得到的分类信息进行归一化后的结果
exnum = size(train_x, 1);
X = [ones(exnum, 1), train_x]... |
%% diplomova prace hledani cest v mapach
% 13.1.2012, xmihal00
clc; clear all; close all;
%porovnani rychlosti:
% Matlab
% t = [8.842, 12.485, 9.356, 9.061, 8.737], mean(t) = 9.6962, std(t) = 1.5769;
functionFolder = [pwd,'/function/'];
path(path,functionFolder);
%% nacteni obrazu
img = (imread('images/... |
%The output is a structure with both anticausal and causal parts
function [NC_causal, NC_anti] = TF_NonCausal(sys,TFs,TFt)
Klqr = sys.Klqr;
P = sys.P;
R_e = inv (sqrtm(( sys.R + sys.B'*P*sys.B )'));
z_A = zeros(size(sys.A));
% Reminder: dlyap(A,B,C); solves C - X+ AXB = 0;
L_A = sys.A-sy... |
clear
clc
close all
%give file dir, file name (the *.out file from Prospa export2d), T2 and D limits (should be the same for Naproxed
%stuff), and number of points in inverted data.
datadir = '/Users/tyler/Dropbox/Data/CHIRP/BigSamples_19Nov2015/out files/';
datafile = 'Double_CHIRP_256_19Nov2015_result.out';
T2lims =... |
function [uav,target,l,b] = initializeproblem
% initializations
global actualPerformance targetResoources
% search space dimensions
l = 1000; % length in units
b = 1000; % breadth in units
xMin = -l/2; xMax = l/2;
yMin = -b/2; yMax = b/2;
load tdata
% create targets
nTargets = 100;
% targetData = [targ... |
clc;
T = [0 0.1];
lam0 = -(47 + 55/60 + 38/3600)/180*pi;
phi0 = -(15 + 51/60 + 49/3600)/180*pi;
% phi0*180/pi
H0 = 1057;
psi0 = 89.7/180*pi;
dT = 0.1;
V0 = 0; Votr = sqrt(59.7); % Votr - скорость отрыва
T1 = 940*Votr/1800;
T = [0:dT:T1]';
e2 = 6.69437999014*10^(-3);
A = 6378137; %м
lam = 0*T + lam0;
%H = 0*T + H0;
r... |
x = fspecial('sobel');
y = x';
img = imread('house.tif');
imgx = imfilter(img, x);
imgy = imfilter(img, y);
x1 = double(imgx);
y1 = double(imgy);
z = sqrt(x1.*x1 + y1.*y1);
z=uint8(z);
figure('Name', 'Original');
imshow(img);
figure('Name', 'Horizontal');
imshow(imgx);
figure('Name', 'Vertical');
imshow(imgy);
figure(... |
function GLM_PCA_ANGULAR (regressor_pca_ang,signal)
hrf_duration = 30;
fs=10;
time = 0:1/fs:hrf_duration;
% HRF is the sum of two gamma function.
% Here first gamma peak at 5s; and FWHM is 5.2
% Second gama peak at 15s and is 9s wide.
% We scale the function so it peak at 3\mumol/l
hrf = computeHRF(time, 5, 5.2, 15, ... |
function display_results_EAM(solution,conf)
% Loading data for figure
if ~isfield(conf,'I'); conf.I=1; end
filename=conf.data.path;
if ~strcmp(conf.data.path(end-3:end),'.mat')
if ~strcmp(conf.data.path(end),'/'); add='/'; else add=''; end
s = dir([conf.data.path,add,'*.mat']);
filename=[filename,add,s(con... |
function exportNmlToAmira(param, nmlFile, outDir, varargin)
% exportNmlToAmira(param, nmlFile, outDir)
% This function allows you to render each tree in a
% given NML file (`nmlFile`) as separate isosurface and
% to export it to Amira. For each tree, a separate PLY
% file is generated and wr... |
function output = AddUniformNoise(image, sigma)
if size(image, 3) == 3
image = rgb2gray(image);
end
[row, col]= size(image);
u_noise = (rand([row,col]) - 0.5) * sigma;
output = uint8(double(image) + u_noise);
end
|
function [in, out, cin, cout] = affinityInOut(setup, l, i)
%AFFINITIES Intra- and inter-affinities around a node.
% [IN, OUT, CIN, COUT] = AFFINITYINOUT(SETUP, L, I) returns the
% cross-affinity matrix CI among the associates IN of the level-(L+1)
% aggregate to which node I belongs. COUT is the cross-affinit... |
function [ x0MF, x0FM ] = initParams(n)
%UNTITLED6 Summary of this function goes here
% Detailed explanation goes here
x0MF = -1 + 2 * rand(n,1);
x0FM = -1 + 2 * rand(n,1);
end
|
%for vdp
simOut = sim('vdp', 'SaveOutput', 'on')
results = simOut.get('yout');
T = 300;
for i = 1:3
T = T+10;
simOut{i} = sim('fuel', 'SaveOutput', 'on');
results = simOut.get('yout', 'tout');
end
T = 400;
simOut = sim('fuel', 'SaveOutput', 'on'); |
function cospsi = getcospsi(G0, pv_angle,geo_b,geo_l, alpha, beta, delta, t)
% ======================================================================
% !!! NOT YET IMPLEMENTED !!!
% Syntax: cospsi = getcospsi(G0, pv_angle,geo_b,geo_l, alpha, beta, delta, t)
% Description: converts global radiation vertical t... |
function [analytic_data] = analytic_comparisons(sigma_time, Charge_distribution_timescale, model_charge)
%% Constructing the analytical pulses to compare with data
analytical_pulse = (1/(sqrt(2*pi)*sigma_time)) * ...
exp(-(Charge_distribution_timescale.^2)/(2*sigma_time.^2)) * ...
model_charge;
analytic_data... |
function [x, y] = f_rk4ordenNEcuaciones(f,a, b, y0, N)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
h = (b-a)/N;
x = a:h:b;
x = x(:);
y = zeros(N+1, length(y0));
y(1,:) = y0;
for k = 1:N
k1 = feval(f, x(k), y(k,:) )';
k2 = feval(f, x(k)+h/2, y(k,:)+(h/2)*k1 )';
k3 = feval(... |
clear;
addpath(genpath('../..'));
set(0,'defaulttextInterpreter','latex');
f = figure('Name','Interpolazione funzione di Runge', 'Color','white', 'NumberTitle','off');
f.ToolBar = 'none';
num_nodes = [4, 8, 16, 32];
runge = @(x) 1 ./ (1 + 25*(x.^2));
zval = linspace(-1, +1, 100);
for n=num_nodes
xdata = chebyspac... |
function varargout = guidemo(varargin)
% Start initialization code
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @guidemo_OpeningFcn, ...
'gui_OutputFcn', @guidemo_OutputFcn, ...
... |
%% Using Cook's Distance to Detect Outliers
% Copyright (c) 2011, The MathWorks, Inc.
% Create a vector of X values
clear all
clc
hold off
X = 1:100;
X = X';
% Create a noise vector
noise = randn(100,1);
% Create a second noise value where sigma is much larger
noise2 = 10*randn(100,1);
% Substitut... |
function results = analysis_ANL(results, varargin)
%% DESCRIPTION:
%
% Analysis function for ANL testing.
%
% INPUT:
%
% results: data information. Can be one of the following formats
% - results structure from SIN_runTest.
% - string, path to a mat file containing the results
% ... |
%% description
% This script creates a quadrotor_agentHelper class instance and uses its
% adjust method to make sure a randomly-generated trajectory is safe. It
% then plots the agentHelper.
%
% Author: Shreyas Kousik
% Created: 2 Aug 2020
% Updated: 4 Aug 2020
%% create agentHelper
% get agent, FRS, and tracking err... |
clear
%number of nodes
n = 20;
%lenght
L = 2;
%lattice spacing
h = L/(n-1);
%lattice
xh = linspace(0,L,n)';
%final time
T = 10;
%number of time steps
nt = 500;
%time step
ht = T/nt;
%Vertical direction
%shear force at x=L
QL = -0.7;
%bending moment at x=L
ML = 0.3;
%w(0)
a = 0;
%w'(0)
b = 0... |
% 拟合第i供应商的订-供曲线
function [S,sigma2] = SB_proxy(i,B)
load datas.mat;
X = Book_matrix(i,:)';
[S,sigma2] = WMA(X,Supply_matrix(i,:)',B);
end
|
function out = KL(gmm1,gmm2,x)
%Get the approximate asymetric KL-divergence between two GMM's using
%the feature vectors contained in x
%
%
%Written by:
%Jonathan Lareau - Rochester Insititute of Technology - 2006
%programming@jonlareau.com
out = 0;
if ((nargin < 3) || (length(x)==1))
if nargin < 3
... |
% This procedure sets stages for the different artificial forests
clc
clear
close all
fog = 6.6;
tree_r = 0.0811;
load('../../data/processed/state_action_prob.mat','parameters')
% Find new grids
delta_x = parameters.Gridinfo(1,4);
delta_y = parameters.Gridinfo(2,4);
% small grid size
n_x = 12;
n_y = 16;
min_x = ... |
function [Ik,P,count,t,H,error]=shooting1(N,eps,alpha2)
% function [P,H]=shooting1(N,eps,alpha2) shooting algorithm between two
% template loaded in the function body. infty error.
n=100; %should be choosen so that ndt=1 in function Flow;
%N=64;
tol=1.0e-3;
%eps=1.1; %matters when come to stablility. smaller ... |
%qpAlphaDecay3D.m
% ALPHA DECAY HALF-LIFE COMPUTATION
% using the Finite Difference Method to solve the [1D] time independent
% Schrodinger Equation for a nuclear potential.
% VARIABLES: potential energy U, kinetic energy T
% transition probability P, radial coordinates x.
% Badr-Eddine Elfatehy C... |
obj = VideoReader('timelapsevideo.avi');
nFrames=obj.NumberOfFrames;
for k=1:nFrames
img=read(obj,k);
p=img;
q=rgb2ycbcr(p);
a=q(:,:,2);
b=q(:,:,3);
for i=1:480
for j=1:640
if((a(i,j)>=70)&&(b(i,j)>=140)&&(a(i,j)<=150)&&(b(i,j)<=210))
w(i,j)=1;
e... |
function [booleano]=recta(x1,y1,x2,y2,x3,y3,x,y)
%función que hace una recta con dos puntos de un triángulo. Luego toma el tercer punto del triángulo y dice si un punto (x,y) está del mismo lado o no.
%tomamos los puntos 1 y 2 para construir los parámetros de la recta
if x2~=x1
m=(y2-y1)/(x2-x1);
b=y1-m*x1;
%... |
%function to calculate the normalised line integral around a circular contour
%A polygon of large number of sides approximates a circle and hence is used
%here to calculate the line integral by summation
%INPUTS:
%1.I:Image to be processed
%2.C(x,y):Centre coordinates of the circumcircle
%Coordinate system :
%or... |
clc; clear
% ill-conditioned cases to be tested
test_funs = {
'test_1'
'test_2'
'test_3'
'test_4'
'test_5'
'test_6'
'test_7'
'test_8'
'test_9'
'test_10'
'test_11'
'test_12'
};
n = size(test_funs, 1);
results = zeros(n, 4);
for i = 1:n
disp(test_funs{i});
fun_hand... |
% load('tfoeindivarraysRvdata.mat', 'RvExp')
% load('tfoeindivarraysRvdata.mat', 'samples')
% load('Beste7H9modJ.mat', 'Beste7H9Jaa2')
%
% uTF = unique(BIGtf_05_2013_Rv2621(:,1));
% uTar = unique(BIGtf_05_2013_Rv2621(:,2));
%
% uMetTar = intersect(BIGtf_05_2013_Rv2621(:,2),Beste7H9Jaa2.genes);
% uMetTar(:,2) = cellfu... |
function grad = nnCostFunction(nn_params, ...
input_layer_size, ...
hidden_layer_size, ...
num_labels, ...
X, y, lambda,td,vmin,vmax)
Theta1 = reshape(nn_params(1:hidden_layer_siz... |
function [ f ] = f15( D, params, noisy )
%
% Params:
% x_opt = params{1};
% f_opt = params{2};
% R = params{3};
% Q = params{4};
if nargin < 1
D = 2;
end
if nargin < 2
params = default_params(D);
end
if nargin < 3
noisy = 0;
end
x_opt = params{1};
f_op... |
%MIT License
%Copyright (c) 2019 Sherman Lo
%SCRIPT: INFERENCE SUB SAMPLE
%A subimage from the z image is taken, tested using the BH procedure corrected for the empirical
%null
%Plots the following:
%z image with a rectangle to highlight the subimage
%histogram with critical boundary, not corrected for empiric... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.