text stringlengths 8 6.12M |
|---|
function timepts = calc_timepts(stepsize, windowsize, len, varargin)
if not(isempty(varargin))
startsamp = varargin{1};
else
startsamp = 1;
end
timepts = startsamp:stepsize:(len-windowsize);
return
end |
function [centroid, oui] = boite_englobante(nom_doss, nom_image, indice_image) %boite_englobante( nom_image, indice_i_g, indice_j_g, taille_i, taille_j)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
oui = 0;
OutVideoDir = nom_doss;
if ~exist(OutVideoDir, 'dir')
mkdir(OutVi... |
clear;
clc;
%----------------------------Super parameter setting-----------------------
lambda_1 = 1e-6;
lambda_2 = 1e-5;
lambda_3 = 1; %you can change the values of these super parameters to experiment
%--------------------------------------------------------------------------
%----------------------------load data... |
% % Solution to HW3 Answer 2
clear
clc
close all
SCALE = 2;
% % Part A % %
L = iread('mc0.png', 'reduce', SCALE);
R = iread('mc1.png', 'reduce', SCALE);
[di,sim,peak] = istereo(L, R, [10 120], 3, 'interp');
figure;
idisp(di, 'bar');
% % Part B % %
% Status to mark valid pixel which have a high simila... |
function res = entropy_cal(t_n0, t_n1, n0, n1)
pl0 = t_n0 / (t_n0 + t_n1);
pr0 = (n0 - t_n0) / (n0 + n1 - t_n0 - t_n1);
left = -pl0 * log(pl0) - (1 - pl0) * log(1 - pl0);
right = -pr0 * log(pr0) - (1 - pr0) * log(1 - pr0);
res = ((t_n0 + t_n1) * left + (n0 + n1 - t_n0 - t_n1) * right) / (n0 + n1);
e... |
function xdot = RobotKinematicModel(x,u,params)
L = 1;
x_update = [u(1) * cos(x(3)) * cos(u(2));
u(1) * sin(x(3)) * cos(u(2));
u(1)/L * sin(u(2))];
xdot = x_update;
end
|
function [ o1,o2 ] = decisionerr(teams,input,dp,label)
[m,n]=size(teams);
team=[];
dp=dp/100;
for i=1:n-3
flag=1;
for j=1:i-1
if teams(m,i)==teams(m,j)
flag=0;
break;
end
end
if flag==1
team=[team,teams(1,i)];
end
end
pssmtrain=[];
[m,n]... |
clear all
%--------------------------------------------------------------------------
% Set parameter values
%--------------------------------------------------------------------------
beta = 0.8; % Discount Factor
b = 0.6; % Unemployment income (not flow utility) (around 60% of net income for Germany)
alp... |
% replace
%
% Replace every instance of from with to
%
% input: A = input matrix in which to replace values
% from = vector of values to replace
% to = vector of values to place from with
% output: B = output matrix with replaced values
%
% written by: Cynthia Sung
% last modified: 12/11/2012
%
function ... |
function varargout = SaveAnnotation(varargin)
% SAVEANNOTATION MATLAB code for SaveAnnotation.fig
% SAVEANNOTATION part of a ANNOTATION SOFTWARE. Main purpose of this
% is to finalize annotation for a grasp instance and preview for its
% correctness.
%
% *See GUI Options on GUIDE's Tools menu. Choo... |
function data = extract_VAE_embeddings(encoderNet, options, ClusteringData)
% Resize the images to match the input image size
images = zeros([options.imageSize, size(ClusteringData, 1)]);
for i = 1:size(ClusteringData, 1)
images(:,:,:,i) = imresize(ClusteringData.Spectrogram{i}, options.imageSize(1:2));
end
images... |
function iris = importIrisData()
%% Import data from text file.
% Script for importing data from the following text file:
%
% C:\Users\Beheerder\Documents\Computational Neuroscience\Theoretical Foundations\iris.data
%
% To extend the code to different selected data or a different text file,
% generate a funct... |
function WriteFile(A, filename)
writematrix(A,filename,'Sheet',1);
end |
function record(object, eventdata)
global mouseDown
global trajectories
global trajNum
trajNum = trajNum + 1;
mouseDown = true;
trajectories{trajNum} = [];
end
|
function U0 = initialguess(problem)
% FUNCTION U0 = INITIALGUESS(PROBLEM)
%
% Generates an initial guess of the column space of X, the matrix to be
% recovered, based on the observed entries of X and the mask pattern.
%
% Input:
%
% PROBLEM: A structure describing the low-rank matrix completion problem
% to so... |
function batchWidth(self, plotNum, widthset)
widths = self.LineWidth;
if (~isnumeric(widthset))
widToSet = widths(str2num(widthset));
else
widToSet = widthset;
end
for i = 1:length(plotNum)
widths(plotNum(i)) = widToSet;
end
self.LineWidth = widths;
end |
function der_hk = Derivative_Hk (x,v,nt,k_Hk,A)
%this is to calculate derHk/derXk
%k is the index of given vertex
der_hk = zeros(3,3);
note_face = findface(v,nt,k_Hk);
if note_face(6) == 0
size = 5;
else
size =6;
end
for i_hk = 1:size
%note_face(i_hk) is the index of faces
simple = [2 3 1... |
function [ eigval, eigvec ] = PowerIterationSecondPair( M, first_eig, first_vec, tol)
%POWERITERATIONSECONDPAIR Summary of this function goes here
% Detailed explanation goes here
matrix_size = size(M, 1);
epsilon = tol * 2;
sigma = epsilon;
y_k = ones(matrix_size, 1) .* 5;
S_prev = 1:matrix_size;
y_k_prev = ones(m... |
function Img = IntraDecode(out_bytestream,scalar, height, width,EOB,Q)
%INTRADECODE Summary of this function goes here
% Detailed explanation goes here
% Decoding using Huffman Table
% out_bytestream = dec_huffman_new(bytestream, BinaryTree, NumEl);
% out_bytestream = out_bytestream + Low_bound - 1;
% Zerodec = Ze... |
function Y = uq_Example_Sensitivity_Advanced_Fcn(X)
% UQ_EXAMPLE_SENSITIVITY_ADVANCED_FCN is a function with a 5-dimensional
% input vector mapping to a output scalar.
%
% See also: UQ_EXAMPLE_SENSITIVITY_ADVANCED
Y = 5*X(:, 1).*X(:, 2) + 2*X(:, 3) + 3*X(:, 4) - sin(X(:, 5)); |
n_ind = 1.5;
t0 = clock;
%--------------------------------Init-----------------------------------
img0 = rgb2gray(imread('IMG_18.ppm'));
img1 = rgb2gray(imread('IMG_19.ppm'));
img2 = rgb2gray(imread('IMG_20.ppm'));
img3 = rgb2gray(imread('IMG_21.ppm'));
img4 = rgb2gray(imread('IMG_22.ppm'));
img5 = rgb2gray(imr... |
function[] = infra_classification_preprocess(filename)
%load data
filepath = 'Data\';
load([filepath filename '_data']);
%bin data
dT = 1;
Tbin = 0:dT:900; Nt = numel(Tbin);
xbin = cell(1,Nsheet);
xac = cell(1,Nsheet);
xmfr = cell(1,Nsheet);
xok = cell(1,Nsheet);
N = 0;
for n = 1:Nsheet
for m = 1:size... |
close all; clear all; clc;
fprintf('working...');
%echo on
cd /uv/user/pgierz/tracers_1p2/expt/raw_inputs;
%load mpiom_gr30s.mat;
% Prior to use this script, the file of mpiom output needs to be transformed to the netcdf, using following command:
% cdo -f nc copy input output
% For long timescales >600 timesteps, ... |
clear;clc;
data = csvread('C:\Users\DaTui\Desktop\sample9-20rpm-60kx_2D_comsolbuild_AC_binary_05-Feb-2015_IP10+50_run_1_CompPermImag.csv');
x = log(data(:,1));
y = data(:,2);
figure(1)
plot(x,y,'-r');
hold on
a1 = 0.00000001526143;
a2 = -0.0000003124087;
a3 = -0.0000007050768;
a4 = 0.00003541667;
a5 =-0.0001058866;
a... |
function [PR] = myRadon(img, theta_all)
% img: input image (type double)
% theta_all: list of angles in degrees (length=K)
% PR: radon transform (type double)(size: N x K)
%% your implementation here
[R,C]=size(img);
diagonal=ceil(sqrt(R^2+C^2));
%Defines size of the output radon transform:
PR=zeros(diagonal,length(t... |
function ranks_for_submission = rankify(ranks)
% turn a n x m matrix of (probabilities, some numbers) into a sorted rannk
% matrix for subm (also n by m). E.g. if for the first example the 5th number is the
% biggest in ranks, then ranks_for_sumission(1,1) = 5
%NOTE: this does tie breaking merely by picking up the fi... |
function A = getdec(t,option)
%GETDEC Get decomposition components.
% M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 12-Feb-2003.
% Last Revision: 29-Dec-2006.
% Copyright 1995-2006 The MathWorks, Inc.
% $Revision: 1.1.6.5 $ $Date: 2007/05/23 19:24:11 $
tn = leaves(t);
lev = treedpth(t);
d = read(t,'data',... |
function varargout = Training_model(varargin)
% TRAINING_MODEL MATLAB code for Training_model.fig
% TRAINING_MODEL, by itself, creates a new TRAINING_MODEL or raises the existing
% singleton*.
%
% H = TRAINING_MODEL returns the handle to a new TRAINING_MODEL or the handle to
% the existing singleton... |
function HW1_HistogramEqualization_Part2()
clc,close all
% Original image
im_original = im2gray(imread('../images/Checkerboard.png'));
disp(size(im_original));
disp(max(im_original(:)));
im_equalized = histeq(im_original);
% Display results:
figure
imshow( im_original );
title('O... |
%=============================================================================
% data structure
%=============================================================================
% D=data(object)
%
% Creates a data structure, similar to the data structures of the Spider.
% X is a data matrix and Y the truth... |
function [train_outputs, test_outputs] = MulRegression(train_data, train_p_target, test_data, lambda, par, ker)
% this model is actually a multi-output kernel ridge regression model
[m, ~] = size(train_data);
[t, ~] = size(test_data);
K = kernelmatrix(ker,train_data',train_data',par); % m by m, kernel matrix
Kt ... |
% 验证简单的IK算法
clear;clc;close all
format long
%% 三个关节坐标以及目标点的位置
% a=[1.25659, 45.2178, -3.38288];
% b=[-0.121869, 24.0376, -7.42323];
% c=[-0.254057, 1.71113, -9.4434];
% t=[0.254057, 11.71113, 9.4434];
a=[0, 45, 0];
b=[2, 24, 0];
c=[0, 2, 0];
t=[0, 12, 0];
% a=[0,0,0];
% b=[3,4,0];
% c=[3,5,0];
% t=[5,0,1];
%% 计算IK
% 先将... |
function w = move_me(v,a)
b = 0;
if nargin==2
b=a;
end
w = [v(v~=b) v(v==b)];
|
function [Rd,Rs,Rx,Rz,Rxx]=adaptive_lp(Wd,Ws,Wx,Wz,C,dobs,d,J,m,dm,p,epsilon)
Xd = Wd*(dobs-d-J*dm);
Xs=Ws*(m+dm);
Xx=Wx*(m+dm);
Xz=Wz*(m+dm);
Xxx=C*(m+dm);
Rd=diag(p*(Xd.^2+epsilon^2).^((p/2)-1));
Rs=diag(p*(Xs.^2+epsilon^2).^((p/2)-1));
Rx=diag(p*(Xx.^2+epsilon^2).^((p/2)-1));
Rz=diag(p*(Xz.^2+epsilon^2).^... |
%A,B ve C siniflari icin 10'ar adet nesne olusturuyoruz.
close all
clear
clc
[xa,ya,xb,yb,xc,yc]=SiniflariUret();
%Her sinif icin elemanlari cizdiriyor.
for k=1:10
plot(xa(k),ya(k),'.','color','magenta','MarkerSize',15)
hold on
plot(xb(k),yb(k),'*','color','blue','MarkerSize',13)
hold... |
function [elem] = parseFormula(form)
% Convert a string of chemical elements into a single homogeneous string
% that you can use in the function. Will require a defined list of
% elements, in order...
%
% James McKenzie, 2014.
% Define the elements
[elem] = defineElements;
% Shove a 1 on the end if absent...
if isstr... |
% you have to load a signal from MATs/ (4sjs)
signal(:, 1) = i4s_js_t_normalized{4};
signal(:, 2) = i4s_js{4};
f = 4;
Fs = 60;
indLow = find(signal(:,1) < 10000);
indHi = find(signal(:,1) > 50000);
sig = signal((indLow(end) + 1):(indHi(1) - 1),:);
i = 1;
j = 1;
wsig = {};
while i < (length(sig))
to = i + 299;
... |
classdef JointSphere < frost.Animator.Sphere
% Sphere depicting joints and axis of rotation for
% frost.Animator.Display
%
% @author omar @date 2017-06-01
%
% Copyright (c) 2017, UMICH Biped Lab
% All right reserved.
%
% Redistribution and use in source and binary forms, with or wi... |
function jp_renamefiles(baseDir, prefix, fileExt)
%JP_RENAMEFILES Rename files in a directory
if nargin < 3
fileExt = '';
end
if nargin <2
prefix = '';
end
if nargin < 1 || isempty(baseDir)
baseDir = uigetdir;
end
if isempty(fileExt)
files = dir(baseDir);
else
files = dir(fullfile(baseDir, sprin... |
%% Apply the whole process to one file
%% Define the file name
dataDir = 'hurricaneData';
fname = [dataDir,filesep,'hurricaneData2000.txt'];
%% Call the three functions to read/process/plot
data = readHurricane(fname);
[ws,d] = processHurricane(data{:});
plotHurricane(ws,d)
%% Add a title, specific to the file
title... |
classdef SWENonhydroVolumeFluxSolver1d < SWEVolumeFluxSolver1d
%SWENONHYDROVOLUMEFLUXSOLVER1D 此处显示有关此类的摘要
% 此处显示详细说明
properties
end
methods
function [ E ] = evaluate( obj, hmin, gra, mesh, fphys )
[ E ] = evaluate@SWEVolumeFluxSolver1d( obj, hmin, gra, mesh, fphys )... |
% COLLAPSE_MAPP_XVEC
function [collapse_xvec] = collapse_MaPP_xvec(matrices)
% creates a matrix (collapse_xvec) containing the collapsed x values of
% the MaPP in each row
num_M = size(matrices,1);
collapse_xvec = [];
for ii = 1:num_M
collapse_xvec = [collapse_xvec;sum(matrices{ii,1},1)];
end
end |
function PartMAsk = RGB2Mask(part_mask)
%Function that fuse Masks
% Make super class HEAD
PartMAsk=zeros(size(part_mask,1),size(part_mask,2));
PartMAsk = single(PartMAsk);
result = zeros(3, 14, 1, 'single');
for i=1:size(part_mask,1)
for j=1:size(part_mask,2)
%head class
if((part_mas... |
function repo=updateHistory( meas, repo)
% manages the data stucture for the measurements
N=1000;
f={ 'flame', 'gas', 'humidity', 'temperature' };
if isempty( repo )
% init repo
init=struct();
for k=1:length(f)
init.( f{k} )=[];
end
repo=repmat(init,N,1);
end
for k=1:length(f)
repo(en... |
# Author: Valentin Andrei
# E-Mail: am_valentin@yahoo.com
function [v_numbers] = do_n_diff_rand (n, a, b)
% This function returns n different random numbers between a and b
debug = 0;
if (abs(a - b) < n)
disp 'Interval is too narrow.';
return;
end
v_numbers = zeros(n, 1);
a = min(a, b);
... |
function obj = updateVariableProp(obj, label, node, varargin)
% This function updates the properties of the NLP variable objects
% based on the input name-value pair arguments.
%
% Parameters:
% label: the row name of the constraints @type char
% node: the identifier of the node list @type cha... |
function [Tree, Soma_PixelInd, image_bin, soma_mask] = skel_scoop(image_input, varargin)
% Function to skeletonize a neuron by scooping voxels. The algorithm is
% based the voxel scooping algorithm developped by
% Rodriguez, Alfredo, Douglas B. Ehlenberger, Patrick R. Hof, and Susan L. Wearne. “Three-Dimensional Neuron... |
%%% Model of Scranton & Vasseur 2016 (Theor Ecol.)
%%% Developped by Picoche & Barraquand 2017
%%% Check for convergence in the saved files, based on species richness,
%%% total abundance over a cycle, maximum biomass of each species over a
%%% cycle and coefficent of variation of the total biomass (inspired by
%%% Sak... |
function [ da_dt ] = RSC_a2_change( A, a4, W, D, lambda, kappa, CI, ndim, M, L )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
ndim=size(a4,1);
I=eye(ndim);
gamma_dot_magnitude=sqrt(0.5*(sum(sum(D.^2))));% according to wang is 2 instead of 0.5, page 4 of his PhD thesis
%gam... |
function [ tp, fp, labels, overlapScores] = getLabels_segmentation(cls, ANNOT_PATH, imname, BBoxes, train)
%getLabels_segmentation given a set of hypothesis image regions,
%this function returns the corresponding set of labels.
%This function is used while one trains
%the segmentation model. This is also used duri... |
%================================== pole =================================
%
% function qpole = pole(g)
%
% Computes the pole associated with the transformation g.
%
%================================== pole =================================
function qpole = pole(g)
qpole = inv(eye(2)- g.R)*g.d;
end
%
%============... |
%% BDG 2020
%%
%% 0.Preparation
% 0.1.clear space
clear all;
close all;
clc;
% 0.2.set work directory
cd F:\GitHub\SVARToolBox;
% 0.3.load data
Prep_ImportData('Data_BDG2020.xlsx')
load ..\SVARToolBox\DATASET DATASET_VAR; |
function [h, display_array] = displayData(X, example_width)
%DISPLAYDATA Display 2D data in a nice grid
% [h, display_array] = DISPLAYDATA(X, example_width) displays 2D data
% stored in X in a nice grid. It returns the figure handle h and the
% displayed array if requested.
% Set example_width automatically if ... |
clc, clear, close all
% create photons
tau_min = 0.1
tau_max = 10
% emission angle distribution
mu = rand()
% optical depth passed until next event
|
function [vol] = sp_vol(n)
if (mod(n,2)==0)
vol = (pi^(n/2))/factorial(n/2);
else
n_h = (n-1)/2;
vol = (2^n)*(pi^n_h)*factorial(n_h)/factorial(n);
end
end |
%This function triggers the solver and then calculates and plots the
%fidelity (closeness of two quantum states) with every iteration step.
repeats = 25;
fidelities = cell(1, repeats);
x0 = zeros(1,15);
qubits = 2;
ranknum = 7;
real = 1
for jj = 1:repeats
RDM_parempi;
paulimatrices;
[x, fval, history] ... |
PointEstResults = WIPsubfnVoxelWiseProcessBatch(AllData)
Data1 = AllData;
Data1.M = Data1.M(:,:,1:1000);
Data1.Indices = Data1.Indices(1:1000);
PointEstResults = WIPsubfnVoxelWiseProcessBatch(Data1)
Nvox = size(Data1.M,3);
Parameters2 = WIPsubfnVoxelWiseProcessBatch(Data1,1);
Nboot = 20;
Parameters
FieldNames =... |
% Complex Baseband QPSK Model with DSSS.
% AWGN Channel
% David O. Tetenji
% 16/12/2019
%initialisation
clc % clears the screen
clear all % clears all variables
randn('seed',0); % sets a seed for randn generator
% Variable parameters
% EbN0dB=10;
EbN0dB=[0,1,2,3,4,5,6,7,8,9,10]; % initialise the EbN0 loop
... |
function vec = int2baseb(n,b,k)
% vec = int2baseb(n,b)
%This function converts a nonnegative integer n, to a vector of 0s and 1s
%that represents its base b expansion. The optional third input variable
%k is a nonnegative integer representing the length of the output vector if
%one wishes to specify this, with a stri... |
function mu = ddOUn(fits, data)
% function vals_ = ddOUn(fits, data)
%
% Compute the DV given A and lambda (the drift rate and the leak term)
% based on an Ornstein-Uhlenback model. The DV is given by
%
% mu = A*COH./LAMBDA.*(exp(LAMBDA*T-TAU)-1),
%
% , where TAU is the neural delay.
%
%
% INPUTS:
% FITS - [A, ... |
classdef DgmGauss < Dgm
%DGMGAUSS
properties
end
methods
function model = DgmGauss(varargin)
%
end
end
end
|
function img = myInvRadon(p, theta_all, filter)
% p: radon transform input (size: N x K)
% theta_all: list of angles in degrees (length: K)
% filter: string indicating the type of filter to be used
% img: reconstructed image (type: double)
%% Implement your function here
%Dimensions we need:
[N,K]=size(p);
dim=ceil(... |
% Dane z zadania
run('init')
zet=0;
Ko=4.5+zet/10;
run('zadanie1')
opoz=z.InputDelay;
aa1=z.Denominator{1}; bb1=z.Numerator{1};
a1=aa1(2); a0=aa1(3);b1=bb1(2);b0=bb1(3);
% Dlugosc symulacji, skok
kk = 150;
U = ones(kk,1);
U(1:opoz+2) = 0; % Wymuszenie rowne 1 od momentu rozpoczecia symulacji
Y = zeros(kk... |
function outSentence = preprocess( inSentence, language )
%
% preprocess
%
% This function preprocesses the input text according to language-specific rules.
% Specifically, we separate contractions according to the source language, convert
% all tokens to lower-case, and separate end-of-sentence punctuation
%
% I... |
function [centroids] = extractCentroidsFrom2DPolyCell(polyCell)
%EXTRACTCENTROIDSFROM2DPOLYCELL Extract the centroids for 2D polygons
%stored in a cell.
%
% Input:
% - polyCell
% A vector cell containing polygons.
%
% Output:
% - centroids
% A matrix containing all the centroids for polygons in polyCell, wi... |
% Jeff Arata
% 12/18/17
%
% This script looks at the effects of filter order on the phase, group
% delay/time delay, and phase delay of a signal, using an FIR filter.
% Notes on FIR Filters
% phase shift = -2*pi*K*f/fs (group delay and frequency can change here)
% group delay in samples = K = (N-1)/2 = phase shift * ... |
function lab = fuzzy_knn(train,test)
% Function for getting labels using Fuzzy kNN
global k b membership
% Value of m variable.
m1 = 2;
% Finding the membership (V) of the test instances
Distance = wtdistance(train, test);
[d, idx] = sort(Distance);
test_fuzziness = zeros(b,1);
for i = 1:b
sum2 = 0; ... |
function [vol_GT, vol_CMF, vol_FWHM, vol_STRM] = Calculate_Volumes(info, GTA, CMF_Scar, FWHM_Scar, STRM_Scar)
%order of volume
%imgA, myoA, GTA, Scar_CMF, Scar_FWHM, Scar_STRM
% AVE_CMF_list=[];
% AVE_FWHM_list=[];
% AVE_STRM_list=[];
% ScarVol_FWHM_array=[]... |
function yy = mLagrange(x, y, xx)
n = length(x);
yy = zeros(size(xx));
for k = 1 : n
matrix = ones(size(xx));
for j = [1 : k-1, k+1 : n]
matrix = matrix .* (xx-x(j)) / (x(k)-x(j));
end
yy = yy + y(k) * matrix;
end |
clc,clear all;
a=0.02;
b=0.2;
c=-65;
d=8;
v0=c;
u0=b*v0;
h=0.01;
t0=0;
tk=1000;
Imax=6;
[ tout,uout,vout,I ] = EulerRichardson_Izhikevich( a,b,c,d,h,t0,tk,u0,v0,Imax );
min_pot=min(vout);
figure;plot(tout,vout);
figure;
plotyy(tout,vout,tout,uout);
title('RS');
legend('V','U')
hold on;
plot(tout,I,'y');
hol... |
function [bincenters,averages,errors]=bincumulativeopenmedian(x,y,min,max,oversamplingratio,nbins)
binwidth=(max-min)/nbins;
binedges=linspace(min,max,nbins+1);
bincenters=min+binwidth/2:binwidth:max-binwidth/2;
averages=NaN(1,nbins);
errors=NaN(1,nbins);
if nargin==6
for i=1:nbins
averages(i)=nanmedian(y... |
function [ T ] = roty( beta )
beta=deg2rad(beta);
T = [cos(beta), 0, sin(beta), 0;
0, 1, 0, 0;
-sin(beta), 0, cos(beta), 0;
0, 0, 0, 1];
end
|
%SCRIPT TO CHOOSE BEST LAMBDA FOR GIVEN W USING GT
par=[];
par.lambda=0; % L1-regularizer strength
par.tmin=tmin; % min coupling time-depth
par.tmax=tmax; % max coupling time-depth
par.dt=netSim.FR; % time-step
par.samples=spkM; ... |
function js=make_treemap_json_from_david(x)
%function js=make_treemap_json_from_david(x)
%
%IN:
% x is a struct contining information for a JAVA string encoding a JSON
% object to be generated
%
%js is a string in json format containing relevant data for a Jit
%icicle plot
%JSON fields: id, name, data{area,dim,co... |
function startup ()
% Root directory
root_dir = fileparts(mfilename('fullpath'));
%% This folder
addpath(root_dir);
addpath(fullfile(root_dir, 'paper2017'));
% OpenCV libraries (only on Windows; on linux, we must put them in
% LD_LIBRARY_PATH before Matlab is started)
if ispc()
... |
% Bestimmung Wendetangente symbolisch
function [Tu,Ta] = Bestimmung_Wendetangente(K,T1,T2)
syms s t;
% Zeitkonstante Zähler Regelstrecke
%K = 1;
% Zeitkonstante T1 und T2 Nenner Regelstrecke
% T1 : Zeitkonstante1 der Strecke
% T2 : Zeitkonstante2 der Strecke
% Berechnung der Wendetangente für Ziegler-Nichols / CHR... |
function [imfilename, pnevFileName, tifFold, date_major] = setImagingAnalysisNames(mousename, imagingFolder, mdfFileNumber, signalCh, pnev2load, postNProvided)
% [imfilename, pnevFileName, tifFold, date_major] = setImagingAnalysisNames(mousename, imagingFolder, mdfFileNumber, signalCh)
% E.g.
% mousename = 'fni17';
... |
%% iq2prob_centers tester
numSamples = 4e4;
sigma = 0.5;
showProcess = true;
iq_raw_0 = normrnd(0,sigma,numSamples,1)+1j*normrnd(0,0.3,numSamples,1);
iq_raw_1 = normrnd(1,sigma,numSamples,1)+1j*normrnd(1,0.3,numSamples,1);
[center0, center1] =...
data_taking.public.dataproc.iq2prob_centers(iq_raw_0,iq_raw_1,~sho... |
function derivative = Satellite(t,state)
global BB invI I Bfieldmeasured pqrdotmeasured
global Bfieldnav pqrdotnav current
%%Earth and sat params
Earth
m = 2;
x = state(1);
y = state(2);
z = state(3);
q0123 = state(7:10);
pdot = state(11);
qdot = state(12);
rdot = state(13);
pqrdot = state(11:13)... |
function [S,W] = get_structure(H_ish)
S = ones(size(H_ish)) - spones(H_ish);
W = get_identity_structure(H_ish);
end |
%function test_example_SAE
load mnist_uint8;
train_x = double(train_x)/255;
test_x = double(test_x)/255;
train_y = double(train_y);
test_y = double(test_y);
% normalize
[train_x, mu, sigma] = zscore(train_x);
test_x = normalize(test_x, mu, sigma);
%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFN... |
function printable_vals = make_printable_vals_struct( printed_im_path, num_colors )
% Make a Nx3 matrix of all the RGB values that exist in a printed
% image (preferably a printed palette that covers a large portion
% of the RGB space).
printed_im = imread( printed_im_path );
% cut 3% of the edges from ea... |
%% function microBifurcation creates the bifurcation diagram using secant continuation in the microsystem only
function microBifurcation()
clear;
h = 2.4;
tau = 1/1.7;
len = 60;
numCars = 30;
options = odeset('AbsTol',10^-8,'RelTol',10^-8); % ODE 45 options
foptions = optimoptions(@fsolve, 'TolFun',1e-15,'TolX',1e-15, ... |
function Y=normcl1(Y)
% normalization, each column of Y has l1 norm 1
% Y is nonnegative matrix
Y=abs(Y);
sumY=sum(Y,1);
[r,c]=size(Y);
Y=Y./(repmat(sumY,r,1));
end
|
wax=[3 15 0.5 1];
xx=[3 6 9 12 15];
LW1=3;
nirs='r';
eeg='g-';
comb='b';
figure,hold on
plot(xx,mean(Ccaverage_nirsAMf),nirs,'Linewidth',LW1)
plot(xx,mean(Ccaverage_eegAM),eeg,'Linewidth',LW1)
plot(xx,mean(Ccaverage_combAMf),comb,'Linewidth',LW1)
set(gca,'XTick',[3 6 9 12 15])
xlabel('time in seconds'),ylabel('accuracy... |
% Timothy Smith
% Choosing Wondows FFT analyzer
% Uniform Window
% 50.125 kHz and 50 kHz frequency
figure
% 50.125 kHz
subplot(2,1,1)
plot(Frequency_5,Voltage_5,'m')
xlabel('Frequency')
ylabel('Voltage')
title( 'Uniform Window 50.125 kHz')
dim = [0.15, 0.6 0.3 0.3];
str = {'Span=100 kHz','Linewidth=250 Hz','Acq-time=... |
function diffsq = sk_leastSqOri(eul,data2d,camParaCalib,param,model,cg)
ncams = size(camParaCalib,2);
d = param.diamet;
hl = param.armlength;
% imgd=zeros(ncams,1024,1280,'single');
% imgm=zeros(ncams,1024,1280,'single');
%make the model
ori = sk_ori(eul);
oarms = zeros(length(model.arms),3);
ocntr = zeros(length(m... |
% The MIT License (MIT)
%
% Copyright (c) January, 2014 michael otte
%
% 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, c... |
% proc_preproc() - prepares EEG data structure for subsequent steps of
% processing routine
%
% Usage:
% >> OUTEEG = proc_preproc(EEG, varargin);
%
% Inputs:
% INEEG - input EEG data structure
%
% Optional inputs:
% 'trimends' - time (sec) to delete from edges of data. For purposes
... |
classdef PolygonList < handle
%POLYGONLIST Interface that defines an abstract collection of polygons
%
% Class PolygonList
%
% Example
% PolygonList
%
% See also
% PolygonArray
% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% Created: 2018-03-30, using Matlab 8.6.0.267246 (R2015b)
% C... |
% 此程序为有干预时舆情传播的matlab程序
% B矩阵为3维矩阵,B(i,j,k),其中k表示迭代次数,k=1为初始感染情况,k最大值为迭代次数+1
% Blength:某时刻感染者数目(数值为B矩阵中每次迭代中的等于1的数目)
clf;clear;clc
%参数
n = 20001; % 迭代次数1000、3000、5000、7000、9000
Alpha = zeros(102,102);
Eta = zeros(102,102);
alpha = 0.04 * rand(100,100); % 参数阿尔法(可自行修改)
eta = 0.04 + 1.2 * rand(100,100); %参数依塔(可自行修改)
Al... |
function out1 = hess_grf_ceq_heel418(in1,toe_th,dmax,cmax,k,us,ud)
%HESS_GRF_CEQ_HEEL418
% OUT1 = HESS_GRF_CEQ_HEEL418(IN1,TOE_TH,DMAX,CMAX,K,US,UD)
% This function was generated by the Symbolic Math Toolbox version 8.4.
% 23-Jun-2020 11:18:34
out1 = 0.0;
|
function [tsc,ts] = AgregarDatosAnuales(tsc,ts)
%AgregarDatosAnuales Summary of this function goes here
% Detailed explanation goes here
disp(strcat( 't observatorio: ',num2str(tsc.TimeInfo.StartDate), ...
' año: ', num2str(ts.TimeInfo.StartDate)));
save ('matlab.mat');
for i=1:min(length(tsc),length(ts))
... |
%% solution for dispersion relation for 4 layer 2deg structure
clear all
f = linspace(.1e12, 1e12, 1e1); % Frequency in Hz
% f = .5e12;
% f = 8.3e12; % Frequency
% f = 25e12;
%% Constants
e0 = 8.85e-12; % Free-space permittivity
c = 3e8; % speed of light
e = 1.60218e-19; % electron charge
me = 9.109e-31; % Electron m... |
function Heredity_M400(Ind_No)
% $Rev: 690 $
% $Author: maxim $
% $Date: 2014-10-28 07:25:19 +0400 (Tue, 28 Oct 2014) $
global POP_STRUC
global ORG_STRUC
global OFF_STRUC
info_parents = struct('parent',{}, 'fracFrac', {},'dimension', {}, 'enthalpy', {});
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
function prettyPlots(ResultsFile)
RO = sprintf('%s_OLS',ResultsFile);
RG = sprintf('%s_GLS',ResultsFile);
load(RG)
GLSpower_SNR = Spower_SNR(1,:)';
GLSeff_SNR = eff_SNR(1,:)';
%some extra code to make the final figures.
load(RO)
set(0,'DefaultFigurePosition',[1 400 1200 400])
fi... |
%sifting algorithm
function [siftee, index] = sift(g, base, deltas, us, j) %deltas - basic orbits, us - corresponding transversal sets
h = g;
m = length(base);
broken = false;
for i = j:m
beta = find(h == base(i));
if (~inlis... |
function [ Lab ] = xyz2lab( XYZ, XoYoZo )
% Lab=xyz2lab(XYZ,XoYoZo)
%
% XoYoZo = CIEXYZ-värden för vitpunkten (belysningen).
% XYZ = CIEXYZ-värden för färgen som ska konverteras till CIELABvärden.
% Lab = CIELAB-värden för den konverterade färgen.
% Formlerna för konvertering återfinns i laboration 3.
Xn = XoYoZo(1);... |
function [ ] = pupilPMEL_plotAveragePupilResponses( mergedPacketCellArray, twoComponentFitToData, lockedTimeTPUPFitToData, analysisDir)
% Create plots of average evoked pupil responses within and across subjects
%% GET THE AVERAGE PACKETS
normFlag=3; % zero center the initial period, % change units
[ avgPackets ] = pu... |
function qbshOpt=qbshOptSet(matchType, anchorPos)
% qbshOptSet: Set up parameters for QBSH
% Usage: qbshOpt=qbshOptSet(matchType, anchorPos)
% matchType: 'wave2midi' or 'wave2wave'
% anchorPos: 'songStart', 'sentenceStart', or 'noteStart'
% Roger Jang, 20090925
if nargin<1, matchType='wave2midi'; end
if nargin<2, a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.