text stringlengths 8 6.12M |
|---|
% -------------------------------------------------------------------------------------------------------------------------
classdef MaxScoreErr < dagnn.Loss
%MAXSCOREERR computes binary error of a response map.
% It uses the maximum response of a negative example
% and the response at the center for a positive example... |
%%% Convergence analysis
%% Array Parameters
Mr = 6; % Number of radar TX antennas
Nr = 4; % Number of radar RX antennas
%% FD Comm parameters
Mc = 4; % Number of BS TX antennas
Nc = 4;% Number of BS RX antennas
I = 4; % Number of UL UEs
J = 2; % Number of DL UEs
%% Set the SNRs in dB
% SNR.rtr = randi([-5,5],Mr,Nr)... |
%----Colocando os valores do contorno em torno da matriz-------------------
% ordem=sqrt(n^2);
% X=zeros(ordem+2);
% X(1,:)=-u(1,:);
% X(:,1)=-u(:,1);
% X(ordem+2,:)=-u(ordem+2,:);
% X(:,ordem+2)=-u(:,ordem+2);
% for j=2:ordem+1
% for i=2:ordem+1
% X(i,j)=x(i-1+(j-2)*ordem);
% end
% end
%---------------... |
function [cost, grad] = softmaxCost(theta, numClasses, inputSize, lambda, data, labels)
% numClasses - the number of classes
% inputSize - the size N of the input vector
% lambda - weight decay parameter
% data - the N x M input matrix, where each column data(:, i) corresponds to
% a single test set
% labels -... |
function TestStim2PDColors(stim_number, base, digits, waitframes)
global screen pd
try
InitScreen(0);
Add2StimLogList();
% Define the PD box
if exist('pd', 'var')==0 || isempty(pd)
pd = DefinePD();
end
Wait2Start();
framesN = 50 * screen.rate/waitframes; % # of... |
function [ ObjectsCoords, generatedObjects ] = removeElementByIndex( ObjectsCoords, generatedObjects, i )%codegen
limit=length(ObjectsCoords);
if i > 0 && limit > 0
generatedObjects = generatedObjects - 1;
if(i==1)
ObjectsCoords=ObjectsCoords(2:limit);
... |
% composit.m September 2, 2013
% sun-synchronous, repeating ground track,
% frozen orbit design - Kozai J2 perturbations
% Orbital Mechanics with MATLAB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all;
global j2 j3 mu req omega argper fi xldot xqp
% astrodynamic and utility constants
j2 = 0.00108... |
function bits = bcd2bits (val)
%
% function bits = bcd2bits (val)
%
% Convert val into its BCD binary representation used by the IRIG format
% This representation takes 9 bits:
% | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
% | 1 | 2 | 4 | 8 | - | 10| 20| 40| 80|
% val must be strictly less than 1... |
for i = 1:100
[LeftSignal,FrontLeftSignal,CenterLeftSignal, ...
CenterRightSignal,FrontRightSignal,RightSignal] = AllLightSensorsReadRoomba(serPort);
disp([LeftSignal,FrontLeftSignal,CenterLeftSignal, ...
CenterRightSignal,FrontRightSignal,RightSignal])
end
t1=clock;
AllLightSensorsReadRoo... |
load('Fish201709131_ERO_10_output_analysis_matlab.mat');
load('Fish201709131_ERO_10_output_correlation.mat');
imageSizeY = size(Correlation_image,1);
imageSizeX = size(Correlation_image,2);
[columnsInImage rowsInImage] = meshgrid(1:imageSizeX, 1:imageSizeY);radius =3;
image=zeros(size(Correlation_image));
for r... |
Avg(size(Results,2)) = Results(1);
toCopy = {'subject','cvholdout','finalholdout','lambda','lambda1','LambdaSeq','regularization','bias','normalize'};
toAvg = {'nzv','err1','err2','iter','job'};
for iResult = 1:size(Results,2);
for iCopy = 1:numel(toCopy)
field = toCopy{iCopy};
i = 1;
while... |
%6/12/20: modified (annotated) from O2inNew_Load.m by EJZ
%2/21/17:
%from the div script O2inNew_Load, convert this to the INCOMING gross flux
%of oxygen.
%ECCO velocity data
%OCCA v 2, annual resolution: 50 depth levels: 50x160x360
%http://mit.ecco-group.org/opendap/ecco_for_las/
%annual
ncload('OCCAvelocity/DDuve... |
function caller = get_caller_name(varargin)
%GET_CALLER_NAME Returns the name of the caller function.
% Usage:
% caller = get_caller_name()
% caller = get_caller_name('Path', true)
% caller = get_caller_name(..., 'Warn', true) % warning if called from workspace
%
% See also: mfilename, funpath, dbstack
... |
function Import_ground_truth_route_2_MySQL ( truth_route_filename )
%% function Import_ground_truth_route_2_MySQL
% Steps:
% EXAMPLE: Import_ground_truth_route_2_MySQL ( 'ground_truth_route.txt' )
% example of insert sql:
%
%%
t1 = clock;
% connect with the database
... |
function [gene,tf,net_prob,gene_names,tf_names]=prepare_data5(filename,control)
% control=0 % denovo network
% control=1 % sush net
%control=2 % motif net
% control=3 %bind net
%control=4 % comb motif and bind
% determining gene_names and tf_names
ntfs=open('sushnet.mat');
gene_names=fieldnames(ntfs); ... |
function Jis = Jfunctional(u,tspan,thetaT,beta)
N = length(thetaT);
Jis = zeros(length(thetaT),1);
index = 0;
for ithetaT = thetaT'
index = index + 1;
sum = 0;
for jthetaT = thetaT'
sum = sum + (jthetaT-ithetaT).^2;
end
Jis(index) = (0.5/N)*sum + 0.5*b... |
function set_buffers_and_messages
global exp
%% Clear all buffers
for buffer = 1:exp.numb_of_buffers
clearpict(buffer)
end
%% Name buffers
exp.buffer.text = 1;
exp.buffer.left_box = 2;
exp.buffer.right_box = 3;
exp.buffer.both_boxes ... |
function weights=makeweights_old(edges,vals,valScale, gradients,geomScale,EPSILON)
%Function weights=makeweights(edges,vals,valScale,points,geomScale,EPSILON)
%computes weights for a point and edge list based upon element values and
%Euclidean distance. The user controls the parameters valScale and
%geomScale that b... |
clc;
clear all;
close all;
automaticGongFFT;
orderedFFTResult = sort(FFTResult,2,'descend');
absFFTResult = abs(FFTResult);
for i=1:10
for j=1:512
absFFTResult2(i,j)=(absFFTResult((i*3)-2,j)+absFFTResult((i*3)-1,j)+absFFTResult((i*3),j))/3;
end
end
orderedAbsFFTResult = sort(absFFTResult, 2,'descend... |
%this examples fits a simple neural network to the function
%z= 0.5*sin(pi*y(1,:).^2).*sin(2*pi*y(2,:));
N_neurons=15;%number of neurons
N_in=2;%number of inputs
N_params=N_neurons*(N_in+2)+1;%number of parameters
N_pop_min=N_params+1;%minimum population
N_pop=round(N_pop_min*1.5);%population used
fcn_name='fitne... |
%function [ No2fun, fun2No, Nbasis, hxList, hyList, xList, yList, Svec, Cxvec, Cyvec, Mvec ] = getCoeffs2D_Lobatto( mesh,K )
%Generate the coeff matrices for Lobatto basis
% Called by function getCoeffs2D()
% K: cutOff of the Lobatto basis
% [Def] id: the index of an object (either node, edge or surface) in th... |
val=arcgridread('F:\Clarence\Floodmap_journal\Resampled\3m-texture\jhilrel3.asc');
sar=arcgridread('F:\Clarence\Floodmap_journal\Resampled\3m-texture\jhilsar3.asc');
ctex=arcgridread('F:\Clarence\Floodmap_journal\Resampled\3m-texture\jhilctex3.asc');
optex=arcgridread('F:\Clarence\Floodmap_journal\Resampled\3m-textu... |
% global state recovery for map joining
%
% recover state vector before select beacon for data association, thus
% before recovery of covariance submatrix
%
% output: global map state vector
%
% compute the state vector by solving linear equation Ix=i
% where i is the informatin vector
%
% use the complete C... |
function [SFD] = GetSFD(SFD,xipos,etapos)
%% compute shape function derivatives
% Coded by Prof. Gun Jin Yun (gunjin.yun@snu.ac.kr)
% May 15 17 2017
% Computational Structural Analysis Spring 2017
% xi-derivatives d_N/d_xi
SFD(1,1) = -0.25*(1-etapos);
SFD(1,2) = 0.25*(1-etapos);
SFD(1,3) = 0.25*(1+etap... |
function [ outCoords ] = cornerFind(yCor, ymax, xCor, xmax)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
orients = {'TL','BL','BR','TR'};
for oi = 1:4
orientation = orients{oi};
switch orientation
case 'TL'
outCoords.topLeft = (yCor < y... |
% SHEARZONE_NF simplified shearzone model with no thermo-mechanical feedback.
%
% Here the temperature is assumed constant throughout a shear zone of
% fixed width and the boundary condition is a constant shear velocity.
%
% Can be used to study eff. viscosity and shear stress as a function of
% temperatu... |
clear paramsAll;
folderlist = { ...
'05june05_static_street_boston',...
'05june05_static_street_porter',...
'10feb04_static_cars_highland',...
'30may05_static_street_cambridge',...
'april21_static_outdoor_davis',...
'april21_static_outdoor_kendall',...
'barcelona_static_street',...
'boston_static_march',...
'dec_stati... |
function [X_tri,id_tri] = n_triangulation(P,x,id)
%% LinearTriangulation
% Find 3D positions of the point correspondences using the relative
% position of one camera from another
% Inputs:
% K - size (3 x 3) camera intrsinc parameter for both cameras
% C1 - size (3 x 1) translation of the first camera pose
% ... |
FIFO_DEPTH = 16384; %Depth of FIFO Memory Block in MAX10 FPGA
delete(figure(1)) %Delete figure so the new text will not overlap with the old
if(size(instrfind) ~= 0) %Delete and release all serial port objects
fclose(instrfind);
delete(instrfind);
end
%Setup serial port
serialPort = serial('COM10');
s... |
% Example 11.4
% from Parameter Estimation and Inverse Problems, 3rd edition, 2018
% by R. Aster, B. Borchers, C. Thurber
% lp=logprior(m)
%
% For this problem, our prior is uniform on m1=[0 2], m2=[-1 0], m3=[0 2],
% m4=[-1 0]
%
function lp=logprior(m)
if (m(1)>=0) && (m(1)<=2) && (m(2)>=-0.9) && (m(2)<=0) && (m(3)>=0... |
function varargout = DPABI_DCMSORTER_TOOL(varargin)
% DPABI_DCMSORTER_TOOL MATLAB code for DPABI_DCMSORTER_TOOL.fig
% DPABI_DCMSORTER_TOOL, by itself, creates a new DPABI_DCMSORTER_TOOL or raises the existing
% singleton*.
%
% H = DPABI_DCMSORTER_TOOL returns the handle to a new DPABI_DCMSORTER_TOOL or t... |
%% Long term Plot
LimitMins=3:10;
Delay3Var=zeros(7,length(LimitMins));
NumGroups = 5;
AveTimespan=0;
sample=7;
figure;
hold off;
xlim([0 7]);
ylim([3 10]);
title(sprintf('Delay for 25 A/C over %d samples w.r.t runway options and delay limits',NumGroups));
zlabel('Delay (minutes)')
ylabel('Last Delay Limi... |
%% acc_plot_ROI
% Make bar plots of MVPA accuracy
% MM/DD/YY -- CHANGELOG
% 10/01/19 -- File inception. MJH
clearvars; clc; close all;
%% FLAGS
do_extract = 0;
do_calc = 1;
do_plot = 0;
%% paths and parameters
cd ..
isss_multi_params_v2_MVPA
scan(1).name = 'hybrid';
scan(1).full = 'hybrid_nowrong_unsmoothed... |
%red
I1=zeros(64,64,3);
I1(:,:,1)=0;
I1(:,:,2)=1;
I1(:,:,3)=1;
I1=hsv2rgb(I1);
%light red
I2=zeros(64,64,3);
I2(:,:,1)=0;%hue
I2(:,:,2)=0.5;%saturation
I2(:,:,3)=1;%value
I2=hsv2rgb(I2);
R = {I1 I2};
%green
I1=zeros(64,64,3);
I1(:,:,1)=0.333;
I1(:,:,2)=1;
I1(:,:,3)=1;
I1=hsv2rgb(I1);
%light green
... |
function stats = cnn_test_mpii(net, imdb, getBatch, varargin)
opts.expDir = fullfile('data','exp') ;
opts.continue = false ;
opts.batchSize = 256 ;
opts.numSubBatches = 1 ;
opts.train = [] ;
opts.val = [] ;
opts.gpus = [] ;
opts.prefetch = false ;
opts.numEpochs = 300 ;
opts.learningRate = 0.001 ;
opts.weightDecay = 0... |
%clc;
%clear all;
close all;
delete(instrfindall);
letra='A';
%a=arduino('com12','leonardo');
a=[];
comport=serial('COM8', 'Baudrate', 9600);
fopen(comport);
x=int16.empty(1000,4,0);
y=int16.empty(1000,4,0);
z=int16.empty(1000,4,0);
t=0;
for g=1:50
if(strcmp(fscanf(comport,'%s'),'F')==1)
fscanf(comport,'... |
clear; clc;
%==============================================================%
% This script derives the equations of motion for SPOT.
% Author: Alex
% Creation Date: 2016-08-04
% Last Edit: 2018-01-18
%==============================================================%
% Define symbolic variables
syms a1 a2 a3 b0 b1 b2 b3 q... |
%
% This code first generates 3000 artificial data sets based on
% the fitting function at the optimal value of c and using
% the standard deviation of noise.
% For each data set, it runs the golden search method to find
% the optimal value of c corresponding to that data set.
% The statistical uncertainty is calcul... |
%%%%%%%%%%%%%%%%%%%%%%%%
% Kernel function for PSE operator
%%%%%%%%%%%%%%%%%%%%%%%%
% Input
% rVec: (numNeighbors x 1)-Vector of inter-particle distances
% epsilon: Kernel parameter epsilon (standard deviation)
% dim: dimension
%
% Output
% etaVals: (numNeighbors x 1)-Vector of eta ... |
function [all_transforms] = find_transformations (A,B,In_xyz,I1,colors, Label)
Labels = {'HC','Sp','Sc','Head','SL','EL','WL','HanL','SR','ER','WR','HanR','HipR','KnR','AnkR','FtR','HipL','KnL','AnkL','FtL'};
SkeletonConnectionMap = [[1 2]; % Spine
[2 3];
[3 4];
[3 5]; %Left Hand
[5 6];
[6 ... |
function out = alignDimension(in)
% 将结构体in中的成员维数对齐
children = fieldnames(in);
nChild = length(children);
for i = 1:nChild
thisChild = in.(children{i});
len(i) = length(thisChild);
end
maxLen = max(len);
num = 10;
for i = 1:nChild
for j = 1:num-1
in.(children{i})(maxLen-j+1) = in.(children{i})(maxLen... |
function filteredMask = nLargestAreas(segmentedImg, numAreas)
SE1 = strel('disk', 2);
dilated = imdilate(segmentedImg, SE1);
[labels numlabels] = bwlabel(dilated, 8);
regionStats = regionprops(dilated,'Area');
sortedAreas = sortrows([(1:size(regionStats,1))' [(regionStats(:).Area)]'],2);
imageMask = zeros(size(l... |
function B = mtransposex(B)
B = permute(B,[2 1 3]); |
function [] = Solenoidal(n)
% Imposes solenoidal and normal boundary conditions to a vector field
% Differential operators
rd=[1,n];
kd=2:n-1;
[D,x]=chebD(n); D2=D*D;
[xx,yy]=ndgrid(x); y=x';
% Original field
zz=xx+1i*yy;
fz=(zz-1/2).*(zz+1/2);
v1=real(fz);
v2=imag(fz);
v1old=v1;
v2old=v2;
vvold=hypot(v1,v2);
% Boun... |
function pn = ShiftF(p,tau)
%% Shifts coordinate ordering of p
%% Inputs
% p = two-dimensional curve
% tau = shift amount (to the left)
%% Outputs
% pn = new shifted coordinates of p
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[d,N] = size(p);
% No shift
if (tau == 0)
pn ... |
N = 100;
bestIndividualSetTest = bestIndividualSet(1:N, :);
trainingSetAndTestSet1 = getTrainingSetAndTestSet(testNumber, BaseData); % 划分训练集和测试集
historyIndividualRecord1 = zeros(1, 12);
[Fitness11,Fitness10,~,historyIndividualRecord1] = GetFitness(bestIndividualSetTest, BaseData, trainingSetAndTestSet1, 1, history... |
function [EAxisDegree, EAxisDiag] = extremum_EAxis(ecgI, ecgII, WaveOnset, WaveOffset, WaveName)
% 根据振幅法测电轴,用 median wave 中的 PQRST 定位信息确定各波段振幅极值代数和
% Input:
% ecgI: the data of I lead
% ecgII: the data of II lead
% WaveOnset:
% WaveOffset:
% WaveName: 'P' / 'QRS' / 'T' 一般为'QRS',根据QRS判断电轴左右偏
... |
img=imshow('C:\Users\hpl\Desktop\lena.jpg');
%%imshow(img);
[r,c]=size(img);
x1=input('enter x1');
x2=input('enter x2');
y1=input('enter y1');
y2=input('enter y2');
m=x2-x1;
n=y2-y1;
imgc=zeros(m,n);
imgc=uint8(imgc);
for i=1:m
for j=1:n
if((i+x1)<r && (j+y1)<c)
imgc(i,j)=img(i+x1,j+y1);
e... |
%% Chladni Plate Analytic Solution Simulator
%clear all;
%close all;
compute_circle_model = false; %only set to true if circle data isn't already cached
numcirc_to_find = 6; %number of discrete frequencies/wavelengths to find
compute_annulus_model = false; %only set to true if annulus data isn't already cached
numan... |
function layer_uv = select_good_init(iSeq)
K = 4;
% iSeq = 17;
fn = sprintf('/u/dqsun/research/program/nips10_flow/data/init/classic+nl/train_%03d.flo', iSeq);
uv = readFlowFile(fn);
fn = sprintf('/u/dqsun/research/program/nips10_flow/data/init/classic+nl-backward/train_%03d.flo', iSeq);
uv2 = readFlowFile(fn);
n_ca... |
lambda = linspace(400, 800, 401)';
omega = 2*pi./lambda;
low_bound = 30;
up_bound = 70;
values = [];
r1 = round(rand*(up_bound-low_bound)+low_bound,1);
r2 = round(rand*(up_bound-low_bound)+low_bound,1);
r3 = round(rand*(up_bound-low_bound)+low_bound,1);
r4 = round(rand*(up_bound-low_bound)+low_bound,1);
r5 = round(ra... |
function D = m_dist(data,fs, smoothDur, overlap, consec, cumSum, expStart, expEnd, baselineStart, baselineEnd, BL_COV)
% Calculate Mahalanobis distance for a multivariate time series.
%
% Inputs:
% data: A data frame or matrix with one row for each time point.
% Note that the Mahalanobis distance calculation sh... |
clear
clc
k=1;
a=1;
sum=2;
d(1)=2;
x=2000000;
while d<=x
a=a+2;
p=a;
n=0;
c=0;
for m=2:a
while rem(a,m)==0
n=n+1;
c(n)=m;
a=a/m;
end
end
if numel(c)==1
k=k+1;
d(k)=c;
if d<=x
sum=su... |
function [Signal] = OFDM(Entree)
%symetrie hermitienne
Vecteurtest = [Entree 0 conj(fliplr(Entree(2:length(Entree))))];
%ifft
Signaltrans = ifft(Vecteurtest);
% prefixe cyclique
Signal = [Signaltrans(481:512) Signaltrans];
end
|
clear all
% Desemnarea variabilei x ca si simbolica
x=sym('x');
% Incarcarea functiei de integrat
F=1/x
% Calcularea integralei nedefinite
I1=int(F)
% Calcularea integralei definite intre limitele 1 si 2
I2=int(F,1,2) |
addpath ('/home/user/projects/openlte-code/octave')
addpath("/home/user/projects/gnuradio/gnuradio-core/src/utils/")
in=read_complex_binary('/home/user/git/gr-lte/gr-lte/test/traces/lte_02_796m_30720k_frame.cfile');
% frame start: 301104 Ts
% PSS: 7th symbol 1st slot: 7072 Ts
lte_fdd_dl_receive(c)
% Generate PSS
pss0 ... |
path = '/home/amanda/Dropbox/trabalho/doutorado/testes/aplicacoes/precipitação/data/';
D = 2;
for i = 1 : 86
folder_name = strcat('s', int2str(i));
cd(strcat(path, folder_name));
Y_train = dlmread('Y_real.csv');
Y_test = flip(Y_train);
csvwrite('Y_train.csv', Y_train)
csvwrite('Y_test... |
function err = ccs_06_singlesubjectDMRIparcels( ana_dir, sub_list, dti_dir_name, ccs_matlab_dir)
%LFCD_06_SINGLESUBJECTDMRIPARCELS Computing the 165 parcels for each subject.
% ana_dir -- full path of the analysis directory
% sub_list -- full path of the list of subjects
% dti_dir_name -- the name of functional d... |
function LoadCarData(filename)
global nummins starttime formatIn formatIn2 formatIn3 inc_min_step offset_time current current_end min_quality
global search_region max_search_time prev_time alldataset dataset newdataset
global indFrictionValue indFrictionQuality ind1PrevDistFriction ind1PrevTimeFriction ind... |
function [ H, V, f, lucky ] = arnoldi_v1( A, k, v1)
%ARNOLDI_V1 Summary of this function goes here
% Detailed explanation goes here
lucky = 0;
[m,n] = size(A);
if m~=n
error('A is not square')
end
if nargin == 2
v1 = rand(n,1);
end
v1 = v1/norm(v1);
V = zeros(n,k);
V(:,1) = v1;
H... |
%% the actual approximation of any input via rounding to nearest node
function f = approxP(t, r, k, theta, sigma, N_time, N_space)
i = floor(r*N_space);
j = floor(t*(N_time/10));
A = solveCIR(10, k, theta, sigma, N_time, N_space);
f = A(i, j);
end
%% the implementation of the scheme
function f = solveCIR(T, k... |
function Y= Q3(w)
Y=zeros(length(w));
for i=1:length(w)
Y(i)=1/(1-0.9*exp(-1j*w(i)));
end
figure;
subplot(211);plot(w,abs(Y));
xlabel('Frequency');
ylabel('Amplitude');
title('Magnitude');
subplot(212);plot(w,angle(Y));
xlabel('Frequency');
ylabel('Amplitude');
title('Phase');
end
|
function r = fhndfdp(t,fd_cell,p)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% fhndfdp
%
% The derivative of the FitzHugh Nagumo equations with respect to p
% at times t.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y = eval_fdcell(t,fd_cell,0);
r = cell(2,3... |
function corners = gt_box(ground_truth_mask)
xmin = min(find(logical(sum(ground_truth_mask))));
xmax = max(find(logical(sum(ground_truth_mask))));
ymin = min(find(logical(sum(ground_truth_mask'))));
ymax = max(find(logical(sum(ground_truth_mask'))));
corners = [xmin ymin xmax ymax];
end |
% Startup script for Surrogate CMA-ES
disp('executing surrogate-cmaes startup script...');
addpath(genpath(fullfile(pwd, 'src')));
addpath(genpath(fullfile(pwd, 'test')));
addpath(fullfile(pwd, 'exp'));
addpath(genpath(fullfile(pwd, 'exp/pproc')));
addpath(genpath(fullfile(pwd, 'exp/util')));
addpath(genpath(fullfile... |
% 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, ... |
% Copyright (c) 2013, Sibt ul Hussain <sibt.ul.hussain at gmail dot com>
% All rights reserved.
% Released under BSD License
% -------------------------
% For license terms please see license.lic
function [feat,nrows,colsize]=readFaceFeatureFile(fname)
% function reads the binary feature files written by cpp code.
% i... |
% Copyright 2018-2020, by the California Institute of Technology. ALL RIGHTS
% RESERVED. United States Government Sponsorship acknowledged. Any
% commercial use must be negotiated with the Office of Technology Transfer
% at the California Institute of Technology.
% ------------------------------------------------------... |
function [y]=t2monofit(k,x)
A = k(1);
t2 = k(2);
alpha = k(3);
y=(A).*(exp(-(x./t2).^alpha)); |
function Lorenz = make_Lorenz()
Lorenz.ode.fn = @Lorenz_ode;
Lorenz.fn = @Lorenz_fun;
Lorenz.dfdx = @Lorenz_dfdx;
Lorenz.dfdp = @Lorenz_dfdp;
Lorenz.d2fdx2 = @Lorenz_d2fdx2;
Lorenz.d2fdxdp = @Lorenz_d2fdxdp;
end
|
classdef GraphFixture < TestCase
%GRAPHFIXTURE Graph module test fixture.
% Use as a base class for test classes. Contains common testing
% set-up and tear-down and utility methods.
%=========================== PROPERTIES ==============================
properties (Constant, GetAccess ... |
clear
close all
clc
%% Nastaveni independence chain M-H algoritmu
S = 50000+1; %celkovy pocet generovanych vzorku + pocatecni vzorek
S0 = 30000+1; %celkovy pocet vyhozenych vzorku
S1 = S-S0; %pocet ponechanych vzorku k dalsi analyze
theta = zeros(1,S); %radkovy vektor pro uchovavani vzorku
theta(1) = 0; %pocatecni vz... |
function status = XuReconToHU(s_config_fbp, s_config_preprocessing)
%status = XuReconToHU( s_config_fbp, s_config_preprocessing)
status = 0;
config_fbp_file_name = s_config_fbp;
config_preprocessing_file_name = s_config_preprocessing;
recon_para=XuReadJsonc(config_fbp_file_name);
preprocessing_para = XuReadJsonc(con... |
classdef Opti < casadi.PrintableCommon & casadi.SharedObject
%OPTI A simplified interface for NLP modeling/solving.
%
%
%
%This class offers a view with model description facilities The API is
%guaranteed to be stable.
%
%Example NLP:
%
%::
%
% opti = casadi.Opti();
... |
function bsp = bspan(xgrid,x,p);
%
% Computes the bandwidth at each point of xgrid corresponding to
% a span of p with x the vector of x values.
%
% Last edited: 3/20/97
%
% USAGE: bsp = bspan(xgrid,x,p);
%
% Copyright: David Ruppert
%
n = size(xgrid,1);
nx = size(x,1) ;
bsp = zeros(n,1) ;
np = ceil(nx*mi... |
function [Rxx, p] = CorrleationMatrixCalc(rx, FilterLength)
%function [Rxx, p] = CorrleationMatrixCalc(rx, FilterLength)
%
% This function calculates the correlation matrix and correlation vector
% for use in a transversal filter which eliminates narrowband interference.
%
% Inputs
% rx - 1 x N vector of complex inp... |
clc,clear;
% load the data set
load co2.txt -ascii;
X = (co2(:,1)+(co2(:,2)-1)/12)';
X = [X;ones(1,length(X))];
Y = co2(:,3)';
s_sigma = 1;
Ca = 100;
Cb = 10000;
w = [Ca 0;0 Cb];
w_cov = (X*X'/s_sigma+w^-1)^-1;
w_mean = w_cov*X*Y'/s_sigma;
res = Y-w_mean'*X;
figure,plot(X(1,:),res);
figure,hist(res,100); |
% Copyright (c) 2012 Howard Hughes Medical Institute.
% All rights reserved.
% Use is subject to Janelia Farm Research Campus Software Copyright 1.1 license terms.
% http://license.janelia.org/license/jfrc_copyright_1_1.html
classdef Simulation < handle
properties
callback
end
... |
function [numbin] = dec2binPN(numdec,N) %判断输入数正负
if (numdec>= 0)
%正数转二进制
numbin1 = dec2bin(numdec,N);
else %负数转二进制
numbin1 = dec2bin(abs(numdec),N);
l1=length(numbin1);
numbin4=0;
for i=1:l1
if (numbin1(l1-i+1)==num2str(1))%按位... |
function B = delete_nodes(A)
if ~isempty(A)
for i = 1: length(A{1})
if A{7}(i,1) == 0
A{1}(i,1) = 0;
A{2}(i,1) = 0;
A{6}(i,1) = 0;
end
end
B = A;
end
end
|
% ------------------------------------------------------------------------
% Demo : Wigner Ville Distribution
%--------------------------------------------------------------------------
% -------------------------------------------------------------------------
% Run simulation first to generat... |
classdef Wfs < naomi.objects.BaseObject
% NaomiWfs contains the WFS of the bench
%
% This class implement some basic functions
% such as GetPhase, SetMask, Reset... which
% are properly propagated either to the
% HASO128 in the IPAG bench to the
% PhaseCam serveur at ESO
... |
figure();
yyaxis left;
plot(time,ILs1,'r-','LineWidth',3);
hold on;
plot(time,ILs2,'LineWidth',3);
hold on;
ylim([-5 5])
yyaxis right;
plot(time,Vout,'LineWidth',3)
ylim([0 220])
xlim([0.00998 0.01])
%%
|
function mat = imgpca(img)
r = img(:,:,1);
g = img(:,:,2);
b = img(:,:,3);
in = double([r(:),g(:),b(:)]');
mu = mean(in, 2);
X = bsxfun(@minus, in, mu);
[U, S] = svd(X, 0);
mat = U';
end |
%% read in data
base_path = 'C:\Users\jktha\Documents\MATLAB\Introduction to Speech Processing\';
% paths for music files
dev_mixtures = dir([base_path 'Speech Data\DSD100\Mixtures\Dev']);
dev_sources = dir([base_path 'Speech Data\DSD100\Sources\Dev']);
test_mixtures = dir([base_path 'Speech Data\DSD100\Mixtures\Test'... |
function normalized_value = normalizeInRange( value, range )
% NORMALIZEINRANGE Normalizes a value in the range [0,1] using a given a range of possible original values.
%
% normalized_value = NORMALIZEINRANGE(value, range)
% @PARAM
% value - value to be normalized
% range - original range of possible values.
% @RETURN... |
function [p] = gauseid(p,v)
maxit = 1000;
tol = 1e-8;
% Give another inital value
p_old = [1.5,1.5];
for it = 1:maxit
fval = bertrand_foc(p,v);
if norm(fval,inf) < tol
break
else
p_B = p(2);
p_A = secant(p(1), p_old(1), p_B);
... |
function [ivv] = mcs_cluster_stats(diro,ilndocn,season)
%function mcs_cluster_stats(vname,vdim,camcrm{icc})
% Purpose: Calc mean, median or eof for cluster samples in 1Dspace-time (heating) or 0Dspace-time (precip).
% The input data random variable dimension is the space and time index
% (e.g., z-t), and the... |
function [N_grad] = get_shape_fnc_grad(quad_iterator, n_quad, ...
element_node_number, node_coordinates)
N_derv= get_shape_fnc_derv(quad_iterator,n_quad, element_node_number);
dx_dxi= get_dx_dxi(quad_iterator, n_quad, element_node_number, ...
node_coordinates);
dxi_dx= inv(dx_dxi);
N_grad=N_derv*dxi_dx;
en... |
function result = matching_filenames(pattern)
% function result = directory_files(pattern)
%
% returns the filenames that match a specific pattern,
% in ascending alphabetical order
files = dir(pattern);
file_number = numel(files);
names = cell(file_number, 1);
for i = 1:file_number
names{i} = files(i).name;
end
... |
function [Kx, Ky, Kq] = bpm_getgain(Prefix)
% Comes from a where for the different geometrys????
% Arc BPM gain factors on a curved section Bergoz card are X: 0.1613 V/% and Y: 0.1629 V/%
%Kx = 16.13;
%Ky = 16.29;
Kx = 16;
Ky = 16;
Kq = 10; % as of 2014/11/4 (was 1 previously)
if nargin < 1 || isempty(Prefix)
... |
% GU_ExM_MouseSomato_NeuroLucida processing
rt = '/groups/betzig/betziglab/4Stephan/171104_Mousebrainsynapse/Neurolucida/Ex9_Spine_Homer_collocalization/';
p = recursiveDir(rt, 'maxlevel', 1);
for i = 28%[3:27,29:numel(p)]
fnlist = dir([p{i} '*.tif']);
fnlist = {fnlist.name}';
% GU_ExM_c... |
%% Load Designed Filters
% band_low60 = 59.6 ; band_high60 = 60.4; sig_low60 =59.9; sig_high60 =60.08;
% band_low50 = 47 ; band_high50 = 53 ; sig_low50 =49.1 ; sig_high50 =50.9 ;
% run('Filter_creator8th.m')
% break
load('C:\Users\Samin Yeasar\Desktop\Final Program\filter_8th.mat')
powerfile_no=[9 10 11 ... |
%------------------------------ PolyMesher -------------------------------%
% Ref: C Talischi, GH Paulino, A Pereira, IFM Menezes, "PolyMesher: A %
% general-purpose mesh generator for polygonal elements written in %
% Matlab," Struct Multidisc Optim, DOI 10.1007/s00158-011-0706-z %
%-----------... |
function cct=i_roo2cct(Roo, obs, wl)
%I_ROO2CCT Calculate correlated color temperature.
% CCT=I_ROO2CCT(ROO,OBS,WL) with size(ROO)=[M W] returns
% matrix CCT with same size.
%
% ROO holds M spectral readings with W spectral bands and WL, size [1 W],
% holds the wavelengths. If WL is empty, the default wav... |
function [expgeno,cover_fraction,concat_id] = networkPropgateEntrezQuick(netobj,genoEntrez,genoEntrezKey,alpha,isInclude,doNorm,name_map)
% Network progate a signal on a network
%
% INPUT: netobj - d x d gene interaction network A in NBS paper
% genoEntrez - n x p original data matrix,
% genoEntrezKey - p... |
function [U] = defTouchResponse(U,confidenceThreshold,displayOpt)
%function that builds upon location code data struct. Adds fields of
%touch properties under meta. Response window is defined by a confidence
%threshold above baseline response (BL response is from -25:0ms pre touch)
if (nargin < 3), displayOpt = 'on';... |
classdef irPhys < ir
% irPhys stores general properties of the retinal patch and stores the
% rgcPhys mosaic objects in its mosaic property field. irPhys and rgcPhys
% store mosaics with RGC parameters set by fits to data from the
% Chichilnisky Lab.
%
% obj = irPhys(inputObj, params);
%
% An irPhys object tak... |
function [eigQ, opinions] = generalizedAsymmetric(A, sB, s, tMax, c_eps, varargin)
% generalizedAsymmetric - Simulate the GA (or variable weights model)
%
% INPUT:
% [A] = NxN Adjacency Matrix of the Network
% [sB] = Nx1 The diagonal of the stubborness matrix B
% [s] = Nx1 Vector of the Intrisic Bel... |
function mmldemo
% MMLDEMO is a guided tour about using MML.
disp(' ')
disp(' MMLDEMO')
disp(' ')
disp(' MMLDEMO demonstrates the capabilities of the MML function and how to use it.')
disp(' This demo guides through a number of examples showing the syntactical')
disp(' variations MML can be used with.')
dis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.