text
stringlengths
8
6.12M
classdef GardnerSmallRoomPlugIn < audioPlugin properties mix = 0; gain = 0.5; Fs = 48000; gardner; end properties (Constant) PluginInterface = audioPluginInterface(... audioPluginParameter('mix',... 'DisplayName', 'Mix',... 'Label',...
function d = DuijDdi(Vi, Vj, Gij, Bij, deltai, deltaj) d = -DuijDdj(Vi, Vj, Gij, Bij, deltai, deltaj);
function [seq,M] = sample_genome_sequence(n,st) % (do not modify function) % % INPUT: % n - length of whole genome % st - strength of chain % OUTPUT: % seq - single-read % M - transition matrix X = 4; % ATCG bits = log2(X); % // bleed_src = st; % start with a transition matrix prow = normcd...
function varargout = draw_rect_try(varargin) clc clear global seg_window fontsize1=12; fontsize2=10; fontsize3 = 14; seg_window = 1.0; % x lim of the plotwindow seg_time = 0.2; % minor xtick on time axes color_set = [0.2 0.8 0.8]; time_stx = 11*0.06; w1 = 0.1; hMainFigure = figure('Name', 'ICG ...
function [J] = nnclassSVfast(traces,varargin) % function [J rJ] = nnclass(traces) % % performs a nearest neighbor classification % traces: [cells classes trials] % % MF 2011-08-25 params.repetitions = 1; params.cells = size(traces,1); params.frames = 0; params.trials = 0; params = getParams(params,varargin); if par...
function idx = findClosestCentroids(X, centroids) %FINDCLOSESTCENTROIDS computes the centroid memberships for every example % idx = FINDCLOSESTCENTROIDS (X, centroids) returns the closest centroids % in idx for a dataset X where each row is a single example. idx = m x 1 % vector of centroid assignments (i.e. eac...
classdef AnalysisBuilder %% ANALYSISBUILDER - INACTIVE - is a builder design pattern for imaging analysis objects% Version $Revision$ was created $Date$ by $Author$, % last modified $LastChangedDate$ and checked into svn repository $URL$ % Developed on Matlab 7.13.0.564 (R2011b) % $Id$ % N.B. c...
if collector.options.printTimings ticCalcOT = tic; end %mu_diff = q_b.mu'-models.shapeModel.mu'; %product = sigmaML^-1*double(mu_diff') - sigmaML^-1*WML*M*(WML'*mu_diff'); %productB = product(idxProd) - (sigmaML^-1*mu_diff(idxProd) - sigmaML^-1*sum(WML(idxProd,:)'.*(M*squeeze(sum(reshape((WML(idxPrecB,:)'.*repmat(res...
function colmap = cmapL(colors, n) % % Create a custom colormap from multiple RGB triplets or a string % If only one RGB triplet is given, that color will be the maximum color, % the minimum color will be black % % % colmap = cmapL(colors, n); % % EXAMPLES: % % img = zeros(124); % first create an image to use the co...
function LEDs=decUpdateLEDs(changedArm,turnArm,LEDs,permuteLEDs); % Randomly select a new LED to turn on iShift=0:3:(sum(changedArm)-1)*3; turnArm=turnArm(changedArm); turnArm=turnArm+iShift; % Convert arm to index # newArm=rand(sum(changedArm)*3,1); % Randomly select new LED newArm(turnA...
function [testClassPredicted]=nmfClassifier(trainSet,trainClass,testSet,testClass,option) % NMF classifier. % Usage: % [testClassPredicted,sparsity]=nmfClassifier(trainSet,trainClass,[],testClass) % [testClassPredicted,sparsity]=nmfClassifier(trainSet,trainClass,testSet,testClass) % [testClassPredicted,sparsity]=n...
function [ chromosome ] = mutation( chromosome , mutation_type) %MUTATION Mutation factory if (nargin == 1) mutation_type = 'bit'; end if (randi([1,25]) ~= 5) return; end if (strcmp(mutation_type, 'bit')) chromosome = mutation_bit(chromosome); end if (strcmp(mutation_...
%% MASCRET Quentin - Copyright 2017 % 2017-03-18 function [index, mu]=kmean(data,clusters, loop) %% initialization % choose points of feature as the starting center [n,m]=size(data); random_number=randperm(m); random_number=random_number(1:clusters); mu=data(:,random_number); %% allocation ...
function bshiftauto = shiftavg(oldbmat) %bshiftauto = shiftavg(oldbmat, avgmatrix) %Generates shift to 0. %bshiftauto : output allbmatrix with shift %oldbmat : input allbmatrix negshiftmat = suggestavg(oldbmat); bshiftauto = cell(size(oldbmat)); for mrow = 1:size(oldbmat,1); for mcol = 1:size(oldbmat,2); ...
train_label_file='label-train.dat'; train_data_file='code-train.dat'; test_label_file='label-test.dat'; test_data_file='code-test.dat'; train_x = readBinary(train_data_file); test_x = readBinary(test_data_file); train_y = readBinary(train_label_file); test_y = readBinary(test_label_file); n = 12; train_b = zeros(si...
function x = cardanos(coef) %Checking to see if there is the correct number of inputs if (length(coef) ~= 4) %Checking to see if the input is missing the x^2 term if (length(coef) == 3) opts.Interpreter = 'tex'; opts.Default = 'Yes'; ...
function [result_GLM_Full, result_LN] = ... runLearningModels(trainStimulusDesignMatrix, testStimulusDesignMatrix,... trainSpikeHistoryDesignMatrix, testSpikeHistoryDesignMatrix,... interpMatrixTrain, interpMatrixTest, trainSpikesTrain, testSpikesTrain, stimulusFilterParamsSize, binsInSecond,initStimulusFil...
% use configs structure to store configurations needed in the analysis configs = getConfigs(); subjects_list = configs.subjects_list; load( 'results/subject01_session1_avg1.mat' ); classifiers_list = fieldnames(models)'; validation_accuracies = nan(length(subjects_list) * configs.NSESSIONS, length(classifiers_list), ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % main file for analysis of strength trials (isometric and isokinetic) % Marie Moltubakk 26.10.2016 % % The scripts assume a certain structure for input files from Tracker and % Noraxon. I.e. number of and order of EMG and other channels. If these % scripts are to be used fo...
%%% This code makes the plot of epistasis in a toy metabolic network in %%% Figure 3B. Note that in this code, metabolites the labels of %%% metabolites 2 and 5 are switched relative to Figure 3B. %%% Update 21 Dec 2020 (SK). Minor modifications to the code and %%% annotations: using get_u_eu function, which itself no...
function plot_log_min_distance(h,t,H1,H2) % Plotting the L1 norm of the solution dh = abs(H1 + h(1:end/2,:) - H2 - h(end/2+1:end,:)); plot(log10(t), log10(min(dh,[],1)),'.k'); xlabel('log_{10}(t)'); ylabel('log_{10}(Min. vertical distance)'); end
% Written by Navid Lambert-Shirzad 20170113 function main_reduce_filter_ICORR2017 gaussEqn = 'a*exp(-x/b)+c-d/x'; startPoints = [2 2 2 2]; syms x pp = 0.89; %plateau percentage for SubjectIDs = 1:10 if SubjectIDs < 10 SubjID = strcat('0', num2str(SubjectIDs)); else ...
function f = tuneEKFParams_allParts(x) %Full Body LG EKF and EUL EKF for the boxing CMU data %Load up the generated model % EKFCodePath = 'C:\Users\kgwester\Documents\ResearchWork\CloudSLAM\lg_persontracking\'; EKFCodePath = 'C:\Users\kgwester\Documents\ResearchWork\MatlabWrapper\'; addpath(genpath(pwd)); addpath(EK...
% This is free software: you can redistribute it and/or modify % it under the terms of the GNU Lesser General Public License as % published by the Free Software Foundation, either version 3 % of the License, or (at your option) any later version. % % This is distributed in the hope that it will be useful, % but WITHOUT...
function vals_ = ddcGau2(fits, data) % function vals_ = ddcGau2(fits, data) % % 1 parameters: A, lapse % % Computes performance predicted by DDM with perfect accumulation. % Assumes DD to a fixed TIME (given as col 2 of data). % Thus, pct correct is fraction of gaussian above % 0 at TIME. % % at values in "...
function drawMultipleSignalMaps(map, masts, AntennaDirection, H, signalMap) % Draws signal maps stored pagewise along dimension 3 of the input % signalMap close; numMaps = size(signalMap,2); for m = 1:numMaps subplot(1, numMaps, m); drawSignalMap(map, masts, AntennaDirection, H, signalMap(:,m)); opos = get(gca, 'Outer...
clc;clear all;clf; format long; %out_file = fopen('C:\Users\Heath\Google Drive\gflash tests\Mixed_debug\cpp_interface\out.txt','r'); out_file = fopen('C:\Users\Heath\Google Drive\gprs_fromMartin\BasalCase\out_290.txt','r'); IN = fscanf(out_file, '%g' ,[6,inf])'; fclose(out_file); status = round(IN(:,1)); pres = IN(:,...
function [errors] = error_calc(pred,y) errors = 1-mean(pred==y); end
clear;clc num=1000; while 3 %只要不是0,條件就永遠成立 if isprime(num) break %如果num是質數就跳離這層迴圈 else num=num+1; end %end if fprintf('num=%d \n',num) end %end for while fprintf('2.. num=%d \n',num)
classdef SWEFaceFluxSolver1d < SWEAbstractFaceFluxSolver %SWEFACEFLUXSOLVER1D 此处显示有关此类的摘要 % 此处显示详细说明 properties end methods function [ fluxS ] = evaluate( obj, hmin, gra, nx, fm, ~ , ~) [ fluxS ] = mxEvaluateSurfFlux1d( hmin, gra, nx, fm); end end end...
function [loss] = rank_loss(ranks, Ytest) loss = 0; for i = 1:size(ranks,1) [~, idx] = find(ranks(i, :) == Ytest(i)); loss = loss + 1 - 1/idx; end loss = loss/size(ranks,1);
% angle difference between 2 vectors u and v % normalized to (-pi,pi] function da = anglediff(u, v) if (length(u) == 2) a1 = atan2(u(2),u(1)); a2 = atan2(v(2),v(1)); da = normalizeAngle(a2-a1); else da = acos(dot(u,v)/(norm(u)*norm(v))); end end
clc clear all close all SOL=@(x,y) sin(pi*x)*sin(pi*y)+1; MSOL=@(x,y) -2*pi^2*sin(pi*x)*sin(pi*y); %SOL=@(x,y) sin(pi/2*x)*cos(pi/2*y); %MSOL=@(x,y) -1*pi^2/2*sin(pi/2*x)*cos(pi/2*y); DIF=1.0; XMIN=0.0; XMAX=1.0; YMIN=0.0; YMAX=1.0; N=5; % KV's in einer Koordinatenrichtung, macht N^2 KV gesamt NN=N*N; X = linspace(XMI...
function varargout = ProjectThanhVy(varargin) % PROJECTTHANHVY MATLAB code for ProjectThanhVy.fig % PROJECTTHANHVY, by itself, creates a new PROJECTTHANHVY or raises the existing % singleton*. % % H = PROJECTTHANHVY returns the handle to a new PROJECTTHANHVY or the handle to % the existing singleton...
% Analyse en composantes principales function [coeff, score, latent] = PCA(X) % calcul de la matrice de variance/covariance n = size(X, 1); Xc = X - mean(X, 1); Sigma = (1 / n) * (Xc') * Xc; % calcul des vecteurs/valeurs propres de la matrice Sigma Sigma = (Sigma + Sigma.') / 2; [V, D] = eig(Sigma); [D, indices_tri] =...
clc, clear all, close all t = []; p = 0.1; episode = 1/p; rnd = 0; for i = 1:episode t = [t, (p / (1 - p * mod(rnd, 1/p)))]; rnd = rnd+1; end rndVec = 0:length(t)-1; figure(1) h1 = plot(rndVec, t, 'color', 'r'); legend([h1(1)], 'LEACH') ylim([0 1]) xl...
function [respuesta,error] = gaussJacobi(matriz,b,tolerancia) %https://www.maa.org/press/periodicals/loci/joma/iterative-methods-for-solving-iaxi-ibi-jacobis-method [filas,~] = size(matriz); D = zeros(filas); L = zeros(filas); U = zeros(filas); for i=1:filas for j=i+1:filas L(i,j) = matriz(i,j); end ...
path = "model_vsoc_sweep_p5a_to_40a_03\model_sim_v_vs_soc_"; D={}; for i=1:0.5:40 str_id = replace(string(i),".","p"); filename= path + str_id + ".txt"; %read data from file data = csvread(filename); dv1 = data(:,1); ds1 = data(:,2); dv2 = data(:,3); ds2 = data(:,4); ...
close all clear data_path = 'E:\AsthmaInhaler\annnotated-data\'; dats = ls(data_path); inh = 0; exh = 0; cinh = 0; % correct inhale winh = 0; % wrong inhale cexh = 0; wexh = 0; minh = 0; % miss inhale mexh = 0; % Design an FIR equiripple lowpass filter d=fdesign.lowpass('Fp,Fst,Ap,Ast',0.15,0.25,1,60); Hd = desi...
%% Current probe calibration % Load data load('current_probe_calibration.mat'); figure; plot(itest,vprobe,'b*-','LineWidth',2); ylabel('Voltaje V'); xlabel('Corriente A'); k_probe = 1/(itest\vprobe); disp(['Probe constant: ',num2str(k_probe),' A/V']); clearvars -except k_probe %% Stall current load('stall_data.mat'); f...
function trainZ = ccaFuse(trainX, trainY, mode) [n,p] = size(trainX); if size(trainY,1) ~= n error('trainX and trainY must have the same number of samples.'); elseif n == 1 error('trainX and trainY must have more than one sample.'); end q = size(trainY,2); if ~exist('mode', 'var') mode = 'sum'; % Default...
function [cechy] = wydobycie_cech(obraz) wiersz = size(obraz,1); kolumna = size(obraz,2); %% dodawanie kolumn i wierszy, jeśli obrazek mniejszy niż 9x9 dodaj_wiersz = 0; dodaj_kolumne = 0; if wiersz<9 dodaj_wiersz = 9-wiersz; end if kolumna<9 dodaj_kolumne = 9-kolumna; end if mod(dodaj_wiersz,2)==0 obraz...
function writevtk( dataset, fname_vtk, descript, n_xs, xs, n_elems, ... elems, dim, datatype, orig, spac, x_coord, y_coord, z_coord) %WRITEVTK Write a VTK File % WRITEVTK(DATASET,FNAME_VTK,DESCRIPT,N_XS,XS,N_ELEMS,ELEMS,DIM, ... % DATATYPE,ORIG,SPAC,X_COORD,Y_COORD,Z_COORD) Writes a VTK File, provided % inputs des...
function out = spdiff(Cx,rt,ct) cc=triu(Cx); [tmp itmp]=sort(cc(:)); [r c]=ind2sub(size(cc),itmp(end)); out=abs(rt-r)+abs(c-ct); end
classdef MvnInvGammaDist < MultivarDist %MVNINVGAMMADIST properties dof; ndimensions; params; prior; end methods function model = MvnInvGammaDist(varargin) [model.params.mu, model.params.Sigma, model.params.a, model.params.b] = processArgs(varargin,... '-mu', [], '-Sigm...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % el outlier tirarlo con sigmas. % hacer try catch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all close all % cargo un perfil que tenga ceros, para que el algoritmo los descarte % frame = imread('C:\Users\60069978\Documents\MATLAB\frame_umbral_102_x_270_y_600.png'); frame = im...
function [ preHi, idx ] = preHigh( nav ) %PREHIGH 计算nav序列的前高值,结果是单调增序列 % ---------------------------------- % 程刚,20150510 %% main nP = size(nav,1); preHi = nan(nP,1); idx = nan(nP,1); for i = 1:nP [preHi(i),idx(i)] = max(nav(1:i)); end end
% This generates the Voronoi cells for the cluster points % Variables to change, could be args to a function later filename = '55_4.txt'; numClusters = 12; % first we read in the data all = importdata('55_4.txt',' ',0); all = all(:,2:21); % then we do a k-mean clustering [idx,X,sumd,D] = kmeans(all,numClusters); % t...
% compute the GMSD scores for given `ref` & `dst` features. function score = compute_gmsd(ref, dst) dims = size(ref, 3); score = zeros(dims, 1); for i = 1:dims gm1 = ref(:,:,i); gm2 = dst(:,:,i); quality_map = (2*gm1.*gm2 + 255) ./(gm1.^2+gm2.^2 + 255); score(i) = std2(quality_map); end en...
%% Load data from file if exist('raw_DS', 'var') == 0 clear all; fhandle = fopen('data2', 'r'); raw_DS = textscan(fhandle, '%s %s %s %s %s %s'); fclose(fhandle); end disp('done till here') %% Create processable datasets if exist('act_DS', 'var') == 0 n_data = size(raw_DS{1},1); DS = datenum(st...
function varargout = durationListMode(filename) %DURATIONLISTMODE determines the duration of Inveon LM file % % USAGE: % duration = durationListMode(filename) % % INPUT: % o filename: The filename of the listmode (optional) % % OUTPUT: % o duration: Duration of the listmode in seconds. % ...
input = 'rarun_05.nii'; [raw h] = read_img(input); spraw = raw; for n=1:h.tdim fprintf('\rspatial smoothing ... %d', n); s = raw(n,:); s=reshape(s,[h.xdim, h.ydim, h.zdim]); s = mrfilter(s,[h.xsize, h.ysize, h.zsize]); spraw(n,:) = s(:)'; end tspraw = timesmooth (spraw); write_img('blurry.img',tspr...
I = imread('mandrill.png'); TF = fftshift(fft2(I)); TF = abs(TF); TF = log(1+TF); figure(); subplot(1,2,1); imagesc(I); subplot(1,2,2); imagesc(TF);
function OutData = eval(This,InData,Range,varargin) % eval Evaluate neural network. % % Syntax % ======= % % S = eval(M,D,Range,...) % % Input arguments % ================ % % * `M` [ nnet ] - Neural network model object. % % * `D` [ dbase | tseries ] - Input data in the form of a database object % or tseries obj...
close all %hyperIm = imread('../ortho.tif'); load('ortho_401x600.mat') hyperIm = scaledIm; %hyperIm = hyperIm(200:300, 300:470, :); hyperIm = hyperIm(:,4:end,:); % First channel in monochromatic in the 470-650 nm range panChannel = hyperIm(:,:,1); % Image coming from the VIS camera 470-650 nm visIm = hyperIm(:,:,2:17)...
raw_csv_read f_func_v fitted = @(x) device(8.805,-5.11,9.458,6.987,x); x = 0:12/40:12; B = arrayfun(fitted,x,'UniformOutput',false); E = cell2mat(B); y = abs(power(E,2)); from=25; to =50; d = data(from:to,2)+data(from:to,3); x = time(from:to); start = [ 10.75,-9.439,-1.184,3.5 ,0.033,70,130,-6] start_2 = [0.05,10,15...
cd('C:\Users\Captain Bluebear\Desktop\TP\Year 4\Semester 2 - Hillary\MA4492 - Project\MatLab') addpath('SaliencyToolbox') %batchSaliency - batch processing of lists of images. % Set the images to be processeed. Here all frames are in % the folder 'images'. images = 'images'; %The number of fixations to be calculate...
%% a) % Konstanter givna i uppgiften. gamma=[0.265,-0.995,0.882]; epsilon=0.1/max(abs(gamma)); t=linspace(0,10); % Fall 1 (Stabil rotation) ode45(@(t,omega)rotation(omega,gamma),t,[1,epsilon,epsilon]) title('Stabil rotation') %% Fall 2 (Instabil rotation) ode45(@(t,omega)rotation(omega,gamma),t,[epsilon,1,epsilon]) t...
function [ R, t ] = PL_estimate_pose( L, x_c , normalizeHartley) %DLT_PLUCKER_LINES Camera pose estimation from line correspondences using % the method follows the paper: Pribyl, B., Zemcík, P. and Cadík, M.: Camera Pose % Estimation from Lines using Plücker Coordinates, BMVC 2015, % http://dx.doi.org/10.5244/C.29.45 %...
function [img] = ColorTransform(img) %ColorTransform Summary of this function goes here % Detailed explanation goes here if size(img,3) == 3 img = rgb2gray(img); end if isinteger(img) img = double(img) / 255; end end
function cellDetections = detectCells(I, radius) % detectNuclei detect nuclei from a fluorescent image % % SYNOPSIS detectCells(I, radius) % % INPUT % I - input image % % radius - radius of the nuclei (in pixels) % OUTPUT % cellDetections - [amplitude x y] % % ip =inputParser; ip.addRequired('I', @isnumeric) ip....
% This file is a demo of UMUTracker Project.The UMUTracker is currently under active development. % Related information can be found in the paper : % % Hanqing Zhang, Tim Stangner, Krister Wiklund, Alvaro Rodriguez, Magnus Andersson % UmUTracker: A versatile MATLAB program for automated particle tracking of 2D light ...
function [Q,R] = qrcgs( A ) % QR-decomposition, Classical Gram Schmidt % (numerically unstable, Q might not be very orthogonal) % reference: Golub, Van Loan; 3rd ed; 5.2.7 % $Id$ M = size( A, 1 ); % rows N = size( A, 2 ); % cols if M < N err( 'A must have number rows >= number columns' ); end; % important: w...
function [psiAll, PhiN, En, cnsMat] = ExactDiagTimeFx(psiInit,Ts,Ham) %this function just takes the Hamiltonian "Ham" and calculates the dynamics %of the initial state PsiInit %find column eigenvectors PhiN from V(:,index) and eigenvalues En from diag(D) [V,D]=eig(Ham); %eigenvalues En=diag(D); %eigenvector...
function [freq, gains] = gain_corr_res(M, O, S1, S2, TS, L, H) %genarate expected times and gain for correlated signals + memoryless rg=10:10:400; gains = zeros(length(rg), 1); freq = zeros(length(rg), 1); res = residuals(M, [S1, S2]); j = 1; for i = rg [a, gains(j)] = corr_res(M, O, S1, S2, TS, i, L, H); fre...
function loglik = markov_loglik( x,a,K ) %likelihood sequence x with markov transition KxK matrix a nh=x(1:(end-1)) + K*(x(2:end)-1); nh=hist(nh,1:(K*K)); nh=reshape(nh,K,K); loglik=sum(sum(nh.*log(a+eps))); end
%calculate the interfacial tension of methane + n-butane at310.95K and %108 Bar %reference comp. : highest boiling point %javaclasspath('NeqSimSource.jar') % system1 = SystemSrkEos(273.15+50, 120); % %system1 = SystemPrEos(273.15+21,20.25); %system1 = SystemSrkCPAs(273.15+50, 120); % testSystem = neqsim.thermo.sy...
function [QS,Count] = Generate_Joints(N,Limitation) Nq = 4; QUp = Limitation(:,2); QDown = Limitation(:,1); %% Reachable Workspace Visualisation % MentoCarlo %Joint Angles Matrix QS = zeros(N,Nq); QLength = zeros(1,Nq); for i = 1:1:Nq QLength(1,i) = (QUp(i)-QDown(i))/N; end % QS(:,1) = (QDown(1) + (QUp(1)-QDo...
function [s1,s2,s3] = vekanal_plot_sym_surface(s, u, v, urange, vrange, varargin) %% % % file: pcz_plot_sym_surface.m % author: Polcz Péter <ppolcz@gmail.com> % % Created on 2016.09.29. Thursday, 21:30:48 % ip.visualize = true; ip.resolution = 20; ip.plotter = @surf; ip.args = {}; ip.norms = false; ip = par...
classdef TileSystem properties (Constant) EarthRadius = 6378137; MinLatitude = -85.05112878; MaxLatitude = 85.05112878; MinLongitude = -180; MaxLongitude = 180; end methods (Static) function clipped = Clip(n, minValue, maxValue) clipped = min(max(n...
function[x, y] = transform_sq_to_coords(square) x(1) = square(1); y(1) = square(2); x(2) = x(1) + (square(3)-square(1)); y(2) = y(1); x(3) = x(2); y(3) = y(1)+(square(4)-square(2)); x(4) = x(1); y(4) = y(3);
% This is a temporary placeholder for code to support Kimbro et al. (2018) Oikos
function dist = rotZ_animate(Nsides) if ~exist('Nsides', 'var') || isempty(Nsides) testN = 5:20; %testN = 5:100; % testN = 6; end plotAnim = false; plotIndiv = false; plotTimePlot = true; plotAll = false; if length(testN) > 1 plotAnim = false; plotIndiv = false; %plotAll = true; end maxdist...
classdef policyEXP3 < Policy %POLICYEXP3 This is a concrete class implementing EXP3. properties % Define member variables nbActions % number of bandit actions w eta t lastAction end methods function init(self, nbActions) % Ini...
function DoRecording(recparams) % DoRecording(recparams,blocksize) % recparams: a structure with fields % channels (vector) % scanrate (scalar, estimate---actual value will be set by hardware, % usually within 0.1% of input value) % nscans (scalar) % buffersize (scalar, estimate---actual value will be computed to m...
address1 = 'https://www.bjets.com.cn/article/jyxx/'; %address2 = '.jhtml'; j = 0; for k = 1:71, if k == 1, address=strcat(address1,'#'); [s, error] = urlread(address); else address=strcat(address1,'?',num2str(k)); [s, error] = urlread(address); end sep1 = strfind(s,'<table'); sep2 = st...
%% Matlab for Brain and Cognitive Scientists % Matlab code for Chapter 19 % Mike X Cohen % % This code accompanies the book % "Matlab for Brain and Cognitive Scientists" (MIT Press, 2017). % Using the code without following the book may lead to confusion, % incorrect data analyses, and misinterpretations of res...
function shoe_analytics() %% trya files = matlab.apputil.getInstalledAppInfo; [path,~,~] = fileparts(files(1).location); pathed = strcat(path,'\shoe_analytics\code'); limit = '27-July-2029 19:30:00' ; if datetime('now')> limit pol = [strcat(pathed,'\athletes.mat')]; delete(pol) ...
%% practice toggle button clc h = figure(1); button = uicontrol('Style','togglebutton', 'Position', ... [20,20,100,20],'String','Start-Stop Rec',... 'Callback', @toggleState);
function [projection, projectionCenter]= xpca(descrs, whiten, pca_k) %XPCA: pca descrs in column-wise whiteningRegul = 0.01; projectionCenter = mean(descrs,2) ; x = bsxfun(@minus, descrs, projectionCenter) ; projectionCenter = projectionCenter'; X = x*x' / size(x,2) ; [V,D] = eig(X) ; d = ...
clear all; close all; P = 2; L = rand(P,1)+0.5; m = rand(P,1)+0.5; t0 = 0; T = 3; N = 1000; time = linspace(t0,T,N); dt = time(2)-time(1); action = @(B,input) actionSE3N(B,input); vecField = @(sigma,p) dexpinvSE3N(sigma,f(action(exponentialSE3N(sigma),p))); %Initializations q10 = rand(3,1); q10 = q10/norm(q10,2...
function [snakeCompl, snakeNom] = get_NewNomParam(snakeCompl, snakeNom, ... snakeConst, windows, tau_Applied, dt) len = windows.numWindows; MdPrime = diag([1.5 * ones(1, len), ... ...
%% Stelling 3 % % Matlab zal tijdens het schrijven van code niet automatisch % operatoren wijzigen en aanvullen. % Antwoord = 1;
function r = plus(p,q,varargin) % get name of class classname = mfilename('class'); % check if first input is the right kind of object if(~isa(p,classname)) % check if second input is the right kind of object if(~isa(q,classname)) % both inputs are not the right kind of object so create empty % object and retur...
function [wc,p] = columncycleshuffle(post,numshuff) extend_x = repmat(1:size(post,1),size(post,2),1); extend_y = repmat([1:size(post,2)]',1,size(post,1)); wc = weighted_corr(extend_x,extend_y,post'); pp = randi(size(post,1),size(post,1),numshuff); wcs = NaN(numshuff,1); % tic for i = 1:numshuff extend_...
function [ik_sol] = RPR_IK(x, y, z, R) a = 10; b = 5; if (((z < a + b/2) && (x*x+y*y <= ((a+b-z)*(a+b-z)))) || ((z >= a + b/2) && (x*x+y*y <= (z-a)*(z-a)))) t1 = atan2(R(2,1), R(1,1)); t3 = atan2(R(3,3), -R(3,2)); d2 = 2^(1/2)*(a + b*(sin(t3)) - z); end ik_sol = [...
%------------------------------------------- %Skin Segmentation using Random Forests %Authors: Andrew Mendez and Oliver Nina % %Last Updated: 4/25/14 %main function %-------------------------------------------
function [a, ae] = getML_LIPModelroc99(Monk, recompute) % fit LIP roc areas at 99.9% coh to a piecewise-linear model savepath = ['/work/mirror_jeff/code/matlab/tmp-mat/getML_LIPModelroc99_' Monk '.mat']; if recompute a = getML_txt([Monk 'TRain_LIP.txt']); fn = a.data{strcmp(a.name,'dat_fn')}; ses...
%[s_read_DWI6] read, save and show DWI data in LIST/DATA format. % % % Last modified % 2011.04.09. % This script is generated and modified for using [f_read_listdata2.m]. % 2011.04.17. % This script is generated and modified for using [f_read_listdata3.m]. % 2011.04.18. % This script is generated and m...
%% get_eco_types % copies ecotypes from AmPeco.html to global eco_types %% function get_eco_types(localPath) % created 2018/04/12 by Bas Kooijman, modified 2018/06/02, 2019/12/29, 2020/08/26, 2020/08/31 %% Syntax % <../get_eco_types.m *get_eco_types*>(localPath) %% Description % sets global eco_types by reading from ...
function [sigx, sigy] = sigma_parax_liny(x, y, xnorm) % SIGMA_PARABOLIC uses a parabola for the variance at each x value % and has a linearly increasing variance in y value. % % INPUT: X -- the x-values (in SuPP) % Y -- the y-values (in SuPP) % % OUTPUT: SIGX -- the corresponding sigmax given t...
function [resim2] = Median( resim) filtreBoyutu=3; [row,col,katman]=size(resim); if(katman>1) resim=rgb2gray(resim); end genisleme=(filtreBoyutu-1)/2+1; baslama=((filtreBoyutu-1)/2); resim2=zeros(row+genisleme,col+genisleme); [row1,col1]=size(resim2); for i=2:row1-genisleme for j=2:col1-genisleme ...
function [value_activation, varargout] = activation(net,nLayer,input,func) % Berechnet die Aktivierung(Outputsignal) eines jeden Neurons in der % gewählten Schicht. input=input(:); % [calc1,meann , stdd] = internal_state(net,nLayer,input,func); % varargout = {meann,stdd}; calc1 =...
function [X_new,Fitness_new,PS_SUCCESS_FLAG,Count]=MyPatternSearch(CalculateFitnessFunction,X_old,fitness_old,TH_num,Count) % function [X_new,Fitness_new,PS_SUCCESS_FLAG,Count]=MyPatternSearch(CalculateFitnessFunction,X_old,fitness_old,TH_num,Count) % Input: % X_old:初始点 % fitness_old:初始点适应度值 % TH_num:...
clear close all clc %%%%仿真参数%%%%%%%%%%%%%%%%%%%%%%%%%%% N_rece = 1;%接收天线数目,每个用户为单天线 N_trans = [16,64,256];%发射天线数目 N_user = 15; SNR=-10:2:30;%仿真信噪比a SNR_linear=10.^(SNR/10);%线性信噪比 SNR_Len=length(SNR);%仿真信噪比的数量 N_Len=length(N_trans); Pn=1./SNR_linear;%噪声功率(假设信号功率为1) C_csit=zeros(SNR_Len,1);% C_mf=zeros(SNR_Len,N_Len);...
%% datdir = ['D:\documents\ucb\singapore\data\PMsensortest\']; dat = importdata([datdir 'CREST_02262013\pmdata.par']); t = dat(:,1)/1000.0; v = dat(:,2); while ( v(1) == 1 || (v(1) == 0 && v(2) == 0) ) t = t(2:end); v = v(2:end); end PW = t(2:2:end) - t(1:2:end-1); PWs = t(1:2:end-1); PWe = t(2:2:end); twind = ...
%% parameters M = 1.096; m = 0.109; b = 0.1; l = 0.25; I = 1/3*m*l^2; % I = 0.0034; g = 9.80; %% use F A1 = [0 1 0 0; 0 -((I+m*l^2)*b)/(I*(M+m)+M*m*l^2) m^2*g*l^2/(I*(M+m)+M*m*l^2) 0 0 0 0 1 0 -(m*l*b)/(I*(M+m)+M*m*l^2) m*g*l*(M+m)/(I*(M+m)+M*m*l^2) 0]; B1 = [0 (I+m*l^2)/(I*(M+m)+M*m*l^2) 0 m*l/...
%----------------------------------------------------------------------- % Job saved on 23-Jul-2015 16:14:41 by cfg_util (rev $Rev: 6134 $) % spm SPM - SPM12 (6225) % cfg_basicio BasicIO - Unknown %----------------------------------------------------------------------- matlabbatch{1}.spm.meeg.preproc.downsample.method ...
% setup Installing IRIS. % % Requirements % ============= % % * Matlab R2014a or later. % % % Optional components % ==================== % % * The Optimization Toolbox is needed to compute the steady state of % non-linear models, and to run estimation. % % * LaTeX is a free typesetting system used to produce PDF ...
function c = Reminder(day) % Add error checking here switch(day) case WeekDays.Monday c = 'Department meeting at 10:00'; case WeekDays.Tuesday c = 'Meeting Free Day!'; case {WeekDays.Wednesday WeekDays.Friday} c = 'Team meeting at 2:00'; case WeekDays.Thursday ...