text stringlengths 8 6.12M |
|---|
function stan_cadata_crop_avis(CROP,FS,ROIS,PAD)
%
%
%
%
% given crop movies (nrois,ndays cell array), make montage movies
% 1: scale the same across days (within ROIs)
% 2:
if nargin<3
ROIS=[];
end
climits=[.5 99.5]; %middle 95%
[nrois,ndays]=size(CROP);
%v.Quality=100;
for i=1:nrois
% make the montage... |
function varargout = GUIMAIN(varargin)
rand('state',sum(100*clock))
% GUIMAIN M-file for GUIMAIN.fig
% GUIMAIN, by itself, creates a new GUIMAIN or raises the existing
% singleton*.
%
% H = GUIMAIN returns the handle to a new GUIMAIN or the handle to
% the existing singleton*.
%
% GUIMAIN('Pr... |
function p = pmBase(p, state, sn)
% function p = modularDemo.pmBase(p, state, n)
%
% PLDAPS module ("pm") for basic behavioral trial timecourse
%
% This module operates a behavioral state machine that
% - Controls trial progression based on subject behavior
% - based on keypress and/or fixation module state (...usi... |
% 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 RenderedStimulus < handle
properties
StimulusID
... |
function CovarsPeakFreq
loadpaths
loadsubj
load chanlist
load grp2.mat
for i = 1:length(subjlist)
basename = sprintf('%s',cell2mat(subjlist(i,1)));
EEG = pop_loadset('filepath',filepath,'filename',[basename '.set'],'loadmode','info');
alphapower(i) = mean(mean(mean(EEG.spectra(:,EEG.freq... |
function [d, c, psi, conv, diags] = fitFA(x, nLatents, varargin)
% This is a function to fit an FA model.
%
% In particular, we model:
%
% x_t = C * l_t + d + ep_t,
%
% where we assume:
%
% l_t ~ N(0, I)
%
% ep_t ~ N(O, psi), where psi is a diagonal matrix. Given training
% data, x, in a matrix this function... |
function [out] = plot_scalar_mesh(shape, f, varargin)
out = trisurf(shape.TRIV, ...
shape.VERT(:, 1), shape.VERT(:, 2), shape.VERT(:, 3), ...
f, 'EdgeColor', 'none', 'FaceColor', 'interp', varargin{:});
material(out, [0.35, 0.5, 0.15])
mesh.plot.default
end
|
function [ F ] = smoothing_matrix( coarray_length )
m = 0;
F = [];
A = zeros(coarray_length, coarray_length - m - 1);
B = eye(coarray_length);
C = zeros(coarray_length, m);
F = [F A B C];
for m = 1:coarray_length - 1
A = zeros(coarray_length, coarray_length - m - 1);
C = zeros(coarray_length, m);
F = [F A B... |
% pUpdateModelWithSSF(Node,Search,...) uses the sequence variability in Search to adjust insertion and substitution probabilities
function [Node,Search] = pUpdateModelWithSSF(Node,Search,f,F,Param,Prior,loopType,File,UseCandidate,Normalize)
DeletionProbPerNucleotide = 0.005; % deletion is less likely than putting... |
function D = pdist2( X, Y, metric )
% Calculates the distance between sets of vectors.
%
% Let X be an m-by-p matrix representing m points in p-dimensional space
% and Y be an n-by-p matrix representing another set of points in the same
% space. This function computes the m-by-n distance matrix D where D(i,j)
% is the ... |
%----------------------------------------------------------------------------
% Mandelbrot.m
%----------------------------------------------------------------------------
function Mandelbrot(n,t)
global M
%
% creates an n x n matrix M whose (i,j)-th entry contains the
% number of iterations (at most t) that the ... |
function [result] = evaluateOverTestData(param, model, testset)
% Get results
[result.segmentations, result.qualityMeasures] = getBunchSegmentations(param, testset, model);
end |
function o = normpdfM(x,m,s)
%Computes elementwise normal pdfs at x with mean m and standard
%deviation s
%Constant term
if nargin == 2
s = 1;
elseif nargin == 1
s = 1;
m = 0;
end
o = 1./sqrt(2*pi*(s.^2));
o = o.*exp(-((x-m).^2)./(2*(s.^2)));
|
% 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
function [keys, values] = dictionaryKeysAndValues(d)
if isa(d, 'GenericDictionar... |
clear all
clc
%% outline
% use 3-20 ser
% loop train ANN to predict 21-60 ser.
% 00 load data
%% main part
n_inp = 253;
n_atom=23;
%% load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % load 3-20 ser data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% dat_path320='../data/ANN_input_out_file_cluster/';
%... |
function []= multilabel_classification()
type = input('Question 2 \n Enter 1: Polynomial 2: Gaussian');
if type==1
display('Polynomial kernel selected');
elseif type==2
display('Gaussian Kernel Selected');
else
disp('Enter the correct value');
return;
end
% Gettin... |
%MUY IMPORTANTE: VAMOS A NECESITAR COMO ENTRADA YA ESTELA ACTUALIZADA, ES
%DECIR, QUE DEBERIAMOS HABER EJECUTADO AL MENOS UNA VEZ CREO
%actualizador_estela.
%SISI DEFINITIVAMENTE, vamos a tener que haberlo
%ejecutado porque sino es imposible obtener los terminos de la columna de
%la derecha del todo de la matri... |
function track
%[D1 D2 QF QD time]=gettrackinghall('nodisplay');
QVG=10/0.2 ; % volt -> T/M
QVB=0.74/0.55 ; % volt -> T
RHO=12.376;
QF_cur =tango_read_attribute('BOO/AE/Tracking','channel2');
QF_field=tango_read_attribute('BOO/AE/TrackingHall','channel1');
QD_cur =tango_read_attribute('BOO/AE/Tracking','chan... |
% Load the data
data = load('training_data.mat');
X = data.train_inputs;
y = data.train_labels;
N = size(y);
% PCA to columns 22:2021
[coeff, score, latent, tsqured, explained, mu] = pca(X(:,22:2021));
% construct the accuracy matrix
nFeature = size(explained);
accuracyMat = zeros(nFeature);
accuracyMat(1) = explain... |
% Script for loading images LoadImages.mat and retrieve HOG
%Resizes the image to 4 times its value
%Look at the HOG features obtained to understand need for this step
%Stores features in .mat file so we dont have to run this repeatedly
function [Features] = LoadImages()
Features = [];
for j = 1:2
num = num2str(j)... |
function setupPlotLab(obj, mode, figWidthInches, figHeightInches)
if (mode == 0)
obj.plotlabOBJ = plotlab();
obj.plotlabOBJ.applyRecipe(...
'colorOrder', [1 0 0; 0 0 1], ...
'axesBox', 'off', ...
'axesTickDir', 'in', ...
'renderer', 'pa... |
function [out] = makeBiSpeechNoise(listNum, SNR, SNtype, location, b, fs)
filePath = '/home/agudemu/Experiment/Stimulus/QuickSIN/original_stimuli_harvard/'; % CHANGE AS NEEDED
fileName = strcat(filePath,'list',num2str(listNum),'_snr',num2str(SNR),'.mat');
load(fileName, 'sig');
arrayLength = 26.4;% length of electrode... |
% get_video_data.m
% Copyright 2003-2010 The MathWorks, Inc.
imaqreset
hw=imaqhwinfo('winvideo'); %create video object
if length(hw.DeviceIDs)>0
msg='Grab live data from camera or load captured data from file?';
button=questdlg(msg,'Data source','Grab','Load','Load');
switch button
case 'Gr... |
function CreateCutterWindow(self, varargin)
% MClustCutter.CreateCutterWindow
% varargin
CreateAxesControls = true;
CreateHideShow = true;
process_varargin(varargin);
MCS = MClust.GetSettings();
MCD = MClust.GetData();
%--------------------------------
% constants to make everything identical
uicHeight = self.uicHe... |
% Using no if-statements
function y = classify_v03 (x)
d = size(x);
p = prod(d); % multiplies the two dims
y = -1 +(p>=1) +(p>1) +(min(d)>1); % each added condition increases the answer by one
end
% Note that the first two solutions are longer but easier to read and understand than... |
function P_rad_O_total=P_rad_O_nse(n_e, T_e,n_O_0,n_O_1, n_O_2, n_O_3, n_O_4,n_O_5,n_O_6,n_O_7,n_O_8,Vp,Vv,VnD,VnBe,VnC,VnN,VnO);
%free electron power loss due to O radiation including excitation, recombination and bremsstrahlung.
[PLT_O_0,PLT_O_1,PLT_O_2,PLT_O_3,PLT_O_4,PLT_O_5,PLT_O_6,PLT_O_7]=PLT_O(n_e,T_e);
PL... |
function ex2q4q1(pointCloud_IVP,data)
% ex2q4q1(pointCloud_IVP,data)
% function relative to question 2.4.1 Objective quality assessment
% computes the symmestric point-to-point metric using MSE and Hausdorff distance
% error_MSE : MSE distance
% error_HAU : Hausdorff distance
bpp = table2array(data(:,6));
% longdres... |
%2D Darcy flow------------------------------------------------------------
%-\nabla \cdot (K \nabla h) = 0-------------------------------------------
%pde toolbox: https://www.mathworks.com/help/pde/ug/equations-you-can-solve.html
clear all
close all
global per;
K_filename = "KLE/K_field.mat";
load(K_filenam... |
function outtst=knnclsfy(intrn,outtrn,intst,k);
% KNNCLSFY - Realiza una clasificacion con el metodo K-Nearest neighbour
%
% outtst = knnclsfy(intrn,outtrn,intst,k)
%
% Copyright (c) Pedro L. Galindo (1998)
if nargin~=4,
error('Numero de argumentos invalido');
end;
valorminimo = min(outtrn) - 1;
outtrn... |
close all
clear all
%% [H,C,L]
H = 260;
C = 0:100;
L = 0:100;
[C,L] = meshgrid(C,L);
H = repmat(H,size(C));
[m,n] = size(C);
LCH = [L(:) C(:) H(:)];
RGB = pa_LCH2RGB(LCH);
R = reshape(RGB(:,1),m,n);
G = reshape(RGB(:,2),m,n);
B = reshape(RGB(:,3),m,n);
whos R G B RGB
RGB = reshape(RGB,m,n,3);
who... |
function [ ObjectsCoords, generatedObjects ] = rbrs_DestroyLifeObject(ObjectsCoords, generatedObjects)%codegen
global border
limit=length(ObjectsCoords);
i=2;
if(limit>2)
while i<=limit
n=[0 1 0]/norm([0 1 0]);
T=[ObjectsCoords(i).X(1,1) ObjectsCoords(i).Y(1,1) ObjectsCoords(i).Z(1,1)];
i... |
%% 实验三第一题
% 对方程组进行LU分解
clc,clear;
syms L U x;
% A为分解矩阵,L,U分别为分解后的矩阵
A = [4,-1,1;4,-8,1;-2,1,5];
b = [7;-21;15];
[L,U,x]=LUresolve(A,b);
fprintf("LU分解\n");disp(A);
fprintf("L矩阵:\n");disp(L);
fprintf("U矩阵:\n");disp(U);
fprintf("x解:\n");disp(x); |
%
% classdef (Sealed) CParamGlobal < handle
%
% gestion des paramètres pour toutes les applications
% rien de spécifique à une seule application.
%
%
classdef (Sealed) CParamGlobal < handle
properties (SetAccess =private)
%_______________________________________________
% la propriété dispError ... |
function setoperationalmode(ModeNumber)
%SETOPERATIONALMODE - Switches between the various operational modes
% setoperationalmode(ModeNumber)
%
% INPUTS
% 1. ModeNumber = 1. 2.7391 GeV, lattice 18.2 10.3
% 2. 2.7391 GeV, Chasmann-Green
% 3. 2.7391 GeV, Low-alpha (alpha/15)
%
% ... |
function out = cryptosubdecode(in,key)
numbers = double(lower(in))-96;
decodednumbers = zeros(1,length(numbers));
for i = 1:length(numbers)
if numbers(i) >= 1 & numbers(i) <= 26
decodednumbers(i) = find(key==numbers(i));
else
decodednumbers(i) = numbers(i);
end
end
out = char(d... |
x=[1,2,3];
y=[3,4,5];
Sigma=[[1,2,5];[2,5,7];[3,4,9]];
z1=x*inv(Sigma)*y'
Sigma1=Sigma;
Sigma1(1,1)=Sigma(1,1)+0.001;
z2=x*inv(Sigma1)*y'
(z2-z1)/0.001
analytic=x'*y.*(-inv(Sigma)*sone(3,1,1)*inv(Sigma));
sum(analytic,'all')
dS=inv(Sigma1)-inv(Sigma);
dS(1,1)/0.001
-inv(Sigma)*sone(3,1,1)*inv(Sigma)
%%
%x^TAx
z1=... |
function plotCellGUI(dF)
imPos = [.1 .15 .8 .75];
barPos = [imPos(1) 0 imPos(3) .05];
txtPos = [barPos(1) (imPos(2)+imPos(4)) barPos(3) barPos(4)];
Fs = 1.48; %unless otherwise stated
[nFrames,nROIs] = size(dF);
tFrames = 1:nFrames;
tSec = (tFrames - 1)/Fs;
mindF = min(dF(:));
maxdF = max(dF(:));
hF = figure; %axes... |
function matlab_vectors = hypreParVectors2matlab(filename,num_of_vectors)
%HYPREPARVECTORS2MATLAB Converts Hypre IJ Vectors to Matlab.
%
% This program was tested on Matlab 7.1.
%
% Description:
% [matlab_vectors] = hypreParVectors2matlab(filename, num_of_vectors)
% converts hypre formatted vectors, ... |
function [ Ref_Model, Test_Model ] = fb_Ear_Model(sig_ref, sig_test, General, match_method)
%UNTITLED2 Summary of this function goes here
% Implementation of the PEAQ Filterbank Ear Model
% Implemented as per ITU-R BS.1387-1 Section 2.2
global debug_var
if debug_var
disp('FB Ear Modelling')
end
%Scale the inpu... |
function dn = forwardprop(dz,j,z,n,param)
%NETSUM2.FORWARDPROP Propagate derivates from weighted input to net input
% Copyright 2012-2015 The MathWorks, Inc.
dn = dz*param.alpha;
end
|
function eventLFPplot(fc,varargin)
% function eventLFPplot(fc,varargin)
%
% INPUTS
%
% fc: {1 x 1} cell, name of file to extract LFPs from. **Note: if you want
% to use sample file name, remove comment marker from fc line**
%
% varargins (with defaults):
%
% t_window: [2 x 1] double indicating time window to use, e.g. ... |
%Função que calcula a distância entre dois pontos
x0 = 0;
y0 = 0;
x1 = 0;
y1 = 0;
function [dist] = calcdist(x0,y0,x1,y1);
x = x1 - x0;
y = y1 - y0;
dist = sqrt(x**2+y**2);
endfunction
|
function printBsp(node,indent,to_ascii)
% Print bsp as text
ascii=64;
if nargin<3
to_ascii=1;
end
if nargin<2
indent=0;
end
if isTreeCell(node)
printIndents(indent);
fprintf('%s\n',node);
else
printIndents(indent);
if to_ascii
fprintf('%c:\n',node.id+ascii);
else
fprintf('%d... |
function [hfInsertPoint, hfInsertLineROI, hfPlotLabel, hfPlotMetrics] = fLandmarkCompare(iNPlots, dVoxelsize)
% comparison figure in LandmarkGUI
%
% input:
% iNPlots amount of to be plotted figures (Points=#Gates, Lines, ROIs)
% dVoxelsize voxelsize
%
% output:
% hfInsertPoint handle to insert poin... |
%exo 7
%% BPSK AWGN soft
Pb = 1e-6;
rate = 0.5;
D = compute_D(Pb);
Ec_No = -log(D);
Eb_No = dec2dB(Ec_No/rate)
%% BPSK AWGN hard
Pb = 1e-6;
rate = 0.5;
D = compute_D(Pb);
eps = roots([4,-4,D^2]);
eps = eps(eps < mean(eps));
Ec_No = -log(2*eps)
Eb_No = dec2dB(Ec_No/rate)
%% BPSK rayleigh soft
Pb = 1e-6
rate =... |
function hints = codeHints(hints)
B = hints.batch;
switch(hints.precision)
case 'single', sizeofPRECISION = 4;
case 'double', sizeofPRECISION = 8;
end
sizeofPointer = 8;
% YY Temporary Memory Size
if hints.doProcessInputs
P_size = sizeofPRECISION * hints.seriesInputProcElements * (hints.numInputDelays + hints... |
clc
clear all
close all
%% fase de la referencia
H=fspecial('average',9);
I1=double(imread('refef1.tif'));
I1=imfilter(I1,H);
I2=double(imread('refef2.tif'));
I2=imfilter(I2,H);
I3=double(imread('refef3.tif'));
I3=imfilter(I3,H);
I4=double(imread('refef4.tif'));
I4=imfilter(I4,H);
ref_e=h4(I1,I2,I3,I4);
ref_d=uw(ref_e... |
function [TTP_voxel_time] = calcTTPvoxel(DSC_curve,TimeBetweenSamples,BolusStartGlobal)
% Find bolus start:
Ps=zeros(1,numel(DSC_curve))+2;
% We use the t-test to get the biggest probability that the distribution of the sample
% is diffrent than the rest of the test ( -> smallest Ps value)
for i=BolusStartGlobal-3:Bol... |
function format_geoaxes(gax)
for iax=1:numel(gax)
gax(iax).NextPlot='add';
gax(iax).Box='on';
gax(iax).MapCenterMode='manual';
gax(iax).Toolbar=[];
cur_ver=ver('Matlab');
if str2double(cur_ver.Version)>=9.7
gax(iax).LongitudeLabel=matlab.graphics.primitive.Text;
gax(iax).Latitud... |
function [f,h] = plotting_plotMatrix(Y,S_fig)
f = plotting_makeFig;
h = imagesc(Y);
colormap hot;
xlabel(S_fig.x_label,'interpreter','latex');
ylabel(S_fig.y_label,'interpreter','latex');
title(S_fig.title_str,'interpreter','none');
h1 = colorbar;
ylabel(h1,S_fig.z_label,'... |
function simulateGALPathway(trait, param_init, parameter_update, fit_type, varargin)
mcmc_version = '3.0';
% input parser
p = inputParser;
addRequired(p, 'trait', @isstruct);
addRequired(p, 'param_init', @isstruct);
addRequired(p, 'parameter_update', @istable);
addRequired(p, 'fit_type', @isstr);
addOptional(p, 'n_... |
function examenrec
disp('Eber Gilberto P?rez Pe?a');
disp('Sistemas y Se?ales');
disp('Examen de Recuperacion');
ti=input('Cual es el tiempo inicial?'); %0
tf=input('Cual es el tiempo final?');%10
T=input('Cual es el periodo?');%2
pasos =input('Cuales son los pasos?');%.01
t=ti:pasos:tf;
t1=t;
xt=zeros(1,length(t)); %A... |
% Takes saved data from SaveExperimentData() and calculates metrics for NRI
% user study of "ablation" along a path
% % Inputs:
% dataFolder -
% expIndex -
% expOrgan -
% regTimes -
% regNames -
% plotOption -
% % Outputs:
% metrics -
function metrics=processArteryIREP(output,arteryInMag,plotOption)
cur=out... |
function [output_width_map, output_height_map] = proposal_calc_output_size(conf, test_net_def_file)
% [output_width_map, output_height_map] = proposal_calc_output_size(conf, test_net_def_file)
% --------------------------------------------------------
% Faster R-CNN
% Copyright (c) 2015, Shaoqing Ren
% Licensed under T... |
function [ area ] = Integrationdata(filename,xrange,yrange)
x = xlsread(filename,xrange);
y = xlsread(filename,yrange);
h = abs(x(2) - x(1));
steps = .5*(y(2:end) + y(1:end-1))*h;
area = sum(steps(1:end));
end
|
clear all;
%% Data
tri = 1;
if tri == 1
%% Histogram plotting - triangle (drop surface)
csv_tri_wl9 = dir('/Users/peixoto/latex/phd/thesis/Data/csv/quality_tet/wl-2-0-5-0/*.csv');
data = csvread('/Users/peixoto/Desktop/test.csv',1,0);
quality_measure = data(:,1);
n_elements = data(:,2);
... |
classdef Chromosomes < handle
%This class takes care of all the chromosomes
% Detailed explanation goes here
properties (SetAccess = protected)
name % name of chromosome
score % fitness of chromosome
parameter % parameter of the function
geneticCode % ge... |
%% Burst Rate
clear all; close all; clc
% Load up the data folder with all the files in %
InDir = '/Volumes/Vinith2/Starr/Dystonia/RawData';
Groups = {'RCS04L','RCS04R'};
Devices = {'DeviceNPC700418H','DeviceNPC700412H'};
T1L=.0102;
T2L=.0096;
T3L=.0143;
T1R=.0113;
T2R=.0140;
T3R=.0122;
totminON=0;
totminOFF=0;
%... |
function [Anodes_contact_bodyT, KCT, KET]=getinfo_Emilyt()
clear all;
load('EmilyData.mat');
%% TopBlock
numNode_Block=length(K)/(6*2);
%% DOF2
NodeNumber2=[1:numNode_Block];
for j = 1:length(NodeNumber2)
DOF2(1, 2*(j-1)+1) = 6.*(NodeNumber2(1,j)-1)+1;
DOF2(1, 2*(j-1)+2) = 6.*(NodeNumber2(1,j)-1)+2... |
clear;
cd(fileparts(which('dataProperty.m'))); dataDir='../../data/';
posGtDir=[dataDir 'Train' '/image/'];
posImgDir=[dataDir 'Train' '/annotation/'];
fs={posImgDir,posGtDir};
fs=bbGt('getFiles',fs); nImg=size(fs,2); assert(nImg>0);
%% Aspect ratio, w/h & size of object
r = zeros(14, nImg);
s = zeros(28,... |
function varargout=plEmitContrib(varargin)
%PLEMITCONTRIB Plot H/rho³ at every dipole
%
% USAGE:
% >> atbaseplot(ring,@PLEMITCONTRIB);
% >> atplot(ring,@PLEMITCONTRIB); (obsolete)
%
% See also atbaseplot
if nargout == 1 % From atplot
[lindata,ring,dpp]=deal(varargin{1:3});
idx=1:length(ring)+1;
H=Cur... |
function y_averaged = Averager(y_fine, nAVG, L_org);
% edit: In the avearging prpcess points do not get blended
% nAVG --> the number of interpolating points needed between
% two succesive points in the origianl vector
% L_org --> the length of the original vector wich was fined and
% it is... |
% Script for plotting the Soccer field over the Robot Visualizer
%
% Copyright 2019 The MathWorks, Inc.
% Title
title('Robot Soccer Simulation');
% Center Line
xline(46,'k-','LineWidth',2);
% Center circle
viscircles([46 23.5],9.15,'Color','k');
% Draw outer boundary
rectangle('Position', [0 0 92 47]... |
function handle = plotLineDotAng2D(dot, ang, axisRange, clr, lw)
handle = plotLineDotVec2D(dot,[cos(ang);sin(ang)],axisRange,clr,lw); |
% REFERENCE
% ---------
% You are free to use this software for research purposes, but you should
% not redistribute it without our consent.
%
% In addition, we expect you to include the following citations:
%
% Z. Puspoki and M. Unser, "Template-Free Wavelet-Based Detection of Local
% Symmetries", IEEE Transactions o... |
% Wrapper for pca_apply that allows for application to large X.
%
% Wrapper for pca_apply that splits and processes X in parts, this may be
% useful if processing cannot be done fully in parallel because of memory
% constraints. See pca_apply for usage.
%
% USAGE
% same as pca_apply
%
% INPUTS
% same as pca_apply
%
%... |
%function show_origin(origin,xdirn,ydirn,l)
%
% Visualize origin and X and Y axes
%
%
% Per-Erik Forssen, April 2003
% [Mod by ErikJ, 2006]
function show_origin(origin,xdirn,ydirn)
if nargin<4,l=100;end
% xdirn=xdirn/sqrt(xdirn'*xdirn);
% ydirn=ydirn/sqrt(ydirn'*ydirn);
%Plot X-axis
h=plot(origin(1)+... |
classdef (Sealed) Logger < handle
%LOGGER A MATLAB logger, similar to Log4J for Java.
% This class allows setting a global verbosity level (ERROR, WARN,
% INFO, DEBUG or TRACE). fprintf printout functions is provided into
% which a verbsoity level is passed, for fine-grain-control.
%
% T... |
% Solves alpha equation for 1D Mixture Model using centered schemes from
% Kurganov and Tadmor with superbee reconstruction
page_screen_output(0);
% Initialization
%Garcia_Cascales_Phase_separation
Phase_separation
% **************************** MAIN PROGRAM ***************************
% Temporal loop
for step=1:t... |
function displayMaskConfigs(stimuli)
for l=1:2
figure('color','w','pos',[100,100,1200,500]);
ha = tight_subplot(5,ceil(length(stimuli{l})/5),0.005,0.005,0.005);
for s=1:length(stimuli{l})
stim = stimuli{l}{s};
plotPolyWithMasks(ha(s),stim);
end
end
end |
%/**
% Скрипт отрисовки графики для межсистемных помех
%*/
clear
close all
clc
path_to_pics = [pwd '/stuff/complexity_stuff/L1'];
% Путь должен существовать, а в нем каталоги png и fig
% Туда будем класть картинки, туда же сдедует положить html
path_to_results = [pwd '/results/complexity_L1'];
path_to_ro = [pwd '/r... |
classdef test6 < handle
properties
expName='12mv1211';
figFormat='png';
end
methods
%Runs everything
function run(this)
for en=1:length(Const.ALL_EXPERIMENTS)
this.expName = Const.ALL_EXPERIMENTS{en};
this.runOnce();
end
end
function runOnce(this)
%[xAll,yAll]=this.generateDataSet(3,1... |
%visualising cross-encoded data
%close all
clear all
clc
%valid_labels = load('mnist_98_784_feat_fusion_clsfr_valid_labels');
%test_labels = load('mnist_39_784_feat_fusion_clsfr_test_labels');
%n_valid_samples = size(valid_labels.valid_labels,2);
valid_data = load('mnist_25_784_cnn_svm_784_dim_valid_data');
indices =... |
function FuncMain(image_base, img_template_name, img_detect_name, img_template_circle_name, config)
%%%%%%%%%%%%%%%%%%%%
%% preprocess the image %%
%%%%%%%%%%%%%%%%%%%%
% save figure path
ind = findstr(img_detect_name, '/');
temp_folder_name = ['temp-', img_detect_name(1: ind(1))];
if exist(temp_folde... |
%function estimation( file,obj )
file = 'configuration_SDA_Estimation.xml';
xDoc = xmlread(file);
rootNode = xDoc.getDocumentElement.getChildNodes;
node = rootNode.getFirstChild;
nbMetric = 0;
while ~isempty(node)
if strcmpi(node.getNodeName, 'metric')
data = [];
returnedMetric = node.getAttribut... |
function [ ] = printInnerGrid( n )
%PRINTINNERGRID Summary of this function goes here
% Detailed explanation goes here
for y = 16:-1:1
for x = 1:16
a = n(x, y);
fprintf('%s ', a.hex);
end
fprintf('\n');
end
end
|
function[ljVector] = Lj(Xvector, a)
[row, col] = size(Xvector);
if row ~= 1 && col ~= 1
error('dimensión Xvector incorrecta');
end
n = length(Xvector);
ljVector = ones(n,1);
for j = 1:n
for k = 1:n
if j ~= k
ljVector(j) = ljVector(j) * ((a-Xv... |
function [centers, cost_vec] = Simplex_Method(x0, func_handle, maxiter, epsilon, alpha, cost_handle)
%alpha is recommended to be set to 2, in 2D smaller alpha results in
%shrinking the simplex, bigger alpha results in expanding the simplex
%none of the coordinates of x0 should be zero
%epsilon gives the tolerance o... |
% learning a logistic neuron with sigmoid transfer function
%
% X - features
% Y - labels
% theta_init - initial values of weights
% niter - number of iterations
% learningRate - learning rate
%
% theta - return the learned weights
%
% qwei
function theta = logistic_neuron(X,Y,theta_init,niter,learningRate)
%Similar ... |
%% startup
startup;
startup4style;
load([sPath vPath 'labels.mat']);
vdatapath=fullfile([sPath,'\loop\',num2str(orderdata)]);
vname=sprintf('V%d',orderdata);
vname=fullfile([vdatapath,'\',vname]);
load(vname);
%% add labels into the feature maxtrix X
[XL,Y,G,neworder]=makedata(X,labels,pectlbs);
|
clear
close all
clc
addpath(genpath('gco-v3.0'));
%% parameter setting
datapath='data09\';
lambda=0.4;
sigma=0.6;% large sigma,small smooth effect
scale=5;
%% main function
disp('Step1 : Uniform resampling...');
[images,lightVec] = unifResampling( datapath );
disp('Step2 : Initial normal estimation...');
[iniNormal] ... |
clc;
clear;
vx = 1;
vy = -1;
v = [vx, vy];
dt = 1;
center = [320,240];
n_images = 60;
radius = 100;
max_circles = 4;
detect_circle_probability = 0.8;
max_error_center = 100;
filename= 'data_2';
mkdir(filename);
centers_list = zeros(n_images,2);
for i = 1: n_images
center_curr = center + i*dt*v;
centers_lis... |
% basis.m
% Generates basis functions (for linear Lagrange basis functions) for a
% triangular mesh in 2D and evaluates at a particular position
% REQUIRES:
% triangle_nodes = 3x2 array of node positions for triangle
% node_number = node number being the maximum-point of the basis function
% (corresponds... |
warning('off')
function [xk,k,err] = newton_raphson_nl(f,vars,x0,tol,maxIter)
n=length(vars);
var=cell(1,row);
for i=1:n
var(1,i)=x(i);
endfor
index={''};
flag=strcat(var,index);
vars=sym(Temp);
xk=x0';
Jf=jacobian(f,vars);
k=0;
err=tol+1;
iteraciones=[0];
error=[err];
while(k<maxIter&& ... |
function varargout = draw_fig(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @draw_fig_OpeningFcn, ...
'gui_OutputFcn', @draw_fig_OutputFcn, ...
'gui_Lay... |
function PlotInExcel
x= {1:10};
a= cell2mat(x);
y= {1:10};
b= cell2mat(y);
%............plotting..............................................................................................
plot(a,b);
xlabel('X Values');
ylabel('Y Values');
print -dmeta; %.................Copying ... |
classdef Line < handle
% point object
properties
a
b
end
methods
function self = Line(x1, y1, x2, y2)
self.a = Point(x1, y1);
self.b = Point(x2, y2);
end
end
methods(Static)
function enable_excentury
import excentury.dum... |
clear all;
close all;
load('iris.mat');
%%% 5/5 well done!
%%
% change this to project to either two or three dimensional eigenspace
num_eig_vec = 2;
n = length(y);
dim = length(x(1,:));
%% normalization
x_mean = mean(x);
x_norm = [(x(:,1)-x_mean(1)) (x(:,2)-x_mean(2)) (x(:,3)-x_mean(3)) (x(:,4)-x_mean(4))];
%%
%Cal... |
function [o1,o2,o3] = mcI( i1, i2, i3 )
% mcI rigid-body inertia <--> mass, CoM and rotational inertia.
% rbi=mcI(m,c,I) and [m,c,I]=mcI(rbi) convert between the spatial or planar
% inertia matrix of a rigid body (rbi) and its mass, centre of mass and
% rotational inertia about the centre of mass (m, c and I). In t... |
function [x]=martin1994(s,fs)
gama=0.88;%¦Ãin eq.(2£©
alpha=0.92;%¦Áin eq.(4)
omin=1.5;% omin in eq.(5)
L=length(s);%length of the signal
WFft=256;%256 points FFT,also the length of window
R=64;% R in paper
nf=ceil((L-(WFft-R))/R); % number of frames
plus=nf*R+WFft-L;
s=[s;zeros(plus,1)];
w=hamming(WFft);
% w=ones(WFft... |
figure(1);clf;surf(X,Y,Z,'Edgecolor','none');
alpha .7
xlabel('x')
ylabel('y')
xlim([xmin,xmax])
ylim([ymin,ymax])
zlim([min(Z(:)),max(Z(:))])
view(fig_view) |
function [xreturn] = nl_conjgrad_fluor_3D(app, A, b, x, niter, nouter, outeriter, T, lambda, size_im, varargin)
% TESTING
%1 only l1 norm on PFOB image/
%2: l2 norm on sum of
visualizationoption=0;
n1=size_im(1);
n2=size_im(2);
n3=size_im(3);
slice=round(n3/2);
realI=[];
if nargin==11
visualizationoption=... |
function out = update_struct(new, old)
% FORMAT out = update_struct(new, old)
% new - Struct (can be hierarchical) with new values.
% old - Struct (can be hierarchical) with original values.
%
% Updates the values of old with those of new.
% - Fields of old which are not in new are kept unchanged.
% - If some fi... |
function phi = img_smooth(img, time_step, num_iterations)
%IMG_SMOOTH Summary of this function goes here
% Detailed explanation goes here
phi = img;
for i=1:num_iterations
[phi] = evolve_height_function(phi,time_step);
end
end
%% function evolve_height_function
function [new_phi] = evolve_height_function(phi,time... |
function Latency = ck_physio_getlatency(sigZ,tax,thr,INTERVAL,DUR)
% function Latency = ck_physio_getlatency(sigZ,tax,thr,INTERVAL,DUR)
%
% function to estimate response threshold as well as latency using the SD method
% INTERVAL: Duration of window for which resp > thr
% DUR: maximal duration of stimulus inte... |
function [ JBr ] = ClusteringReduced( K,Xr)
%UNTITLED8 Summary of this function goes here
% Detailed explanation goes here
% reduced Xr
Corr_x = corr(Xr);
x_cov=cov(Xr);
[U S V] = svd(x_cov);
[o,p]=size(Xr);
eigen= zeros(1,p);
for j=1:p
eigen(j)= S(j,j);
end
SumOver_k=sum(eigen);
alpha=0.... |
function [ words, boxes ] = processImage( img )
%processImg Runs ocr and post processing on img. Returns a cell array of
%the extracted words
% the ocr alphabet
alpha = 'abcdefghijklmnopqrstuvwxyz';
alpha = strcat(alpha, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
alpha = strcat(alpha, '1234567890');
alpha = strcat(alpha, '!@#$&()... |
function [ u ] = attitude_control( E, e, R, w, d, ddot, M )
%ATTITUDE_CONTROL attitude controller
% E 3X3 error in rotation
% e 3X1 error in angular velocities
% R 3X3 current rotation Matrix
% w 3X1 angular velocity
% d 3X1 desired angular velocity
% ddot 3X1 desired angular acceleration
% M 3X3 inertia matrix
gl... |
%function changing_reflectivity
%*************written by Wenting Chen****************
clear all;
clc;%以下单位如无特别说明均为国际单位制
tic
global h c Ner Nyb sgm56p sgm65p sgm12 sgm21 sgm56 sgm65 ...
lams1 lams2 alpha1 alpha2 alphap Ts1 Ts2 Tp N2 N3 N6 N6np
h=6.628e-34;%plunk constant
c0=2.9979245e8;%light velocity in ... |
function [frameShifts,upCross,downCross,T,transitionNotFound]=frameTimeFromDiode(dataRecordingObj,varargin)
% [frameShifts,upCross,downCross]=frameTimeFromDiode(dataRecordingObj);
% Function purpose : calculate triggers from recording
%
% Function recives : dataRecordingObj - a data recording object for extracting a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.