text
stringlengths
8
6.12M
function [results]=AMIGO_OED(input_file,run_ident,opt_solver); % AMIGO_OED: performs optimal experimental design % %****************************************************************************** % AMIGO2: dynamic modeling, optimization and control of biological systems % % Code development: Eva Balsa-Canto ...
function [v,w]=FHN2d(time); % solves 2D FHN eqns. with periodic boundary conditions using Euler method. %FHN looks like: dv/dt=-w-v*(v-a)*(v-1)+D*(d^2/dx^2)v+I % dw/dt=e*(b*v-g*w-d) % time is length of time dx=0.02; % space step (cm), a myocyte is about 200 microns dt=0.1; % time step (ms) % NB:...
function removeDefaultAcls(obj, dirPath) % REMOVEDEFAULTACLS Removes all default ACL entries from a directory % % Example: % dlClient.removeDefaultAcls('/my/directory/path') % % Copyright 2018 The MathWorks, Inc. import com.microsoft.azure.datalake.store.ADLStoreClient; % Create a logger object logObj = Logger.get...
function [path] = shortestpath(G, s, t, varargin) path = constructPath(pred, targ); if ~isnumeric(s) && ~isnumeric(t) path = G.NodeProperties.Name(path).'; end function p = constructPath(pred, t) p = []; tnext = c(t); if ~isnan(tnext) while tnext ~= 0 p(end+1) = t; t = tnext; ...
tic; clc; clear all; close all; S = [0.5045 - 0.0217i, 0.6874 + 0.0171i, 0.3632 + 0.1789i, 0.3483 + 0.1385i, 0.2606 - 0.0675i, 0.2407 + 0.1517i]; S_real = real(S); S_mag = abs(S); N = 6; g = [1,0; 0.866,0.5; 0.5,0.866; 0,1; -0.5,0.866; -0.866,0.5]; b0 = 0.1; [D,D11_array,D12_array,D21_array,D22_ar...
type = 'forefinger'; session = 1; basedir1 = 'data/subject'; out_dir1 = 'feature/subject'; downsample_factor = 0.1980/0.4235; %for getting [70x100] depth map for matching basedir2 = ['/session' num2str(session) '/' type '/set']; for subjectID = 1:2 for setID = 1:2 disp([num2str(subjectID) ',' num2st...
function [] = chi_main_proc(basedir, rfid, pflag, varargin) %% [] = chi_main_proc(basedir, rfid, pflag, [Dtime]) % This function drives the main chi processing % of a single raw-files based on the given flags % % INPUT % basedir : unit directory % rfid : raw-file name % pflag : ch...
function handles=CC_calc_properties(varargin) handles=varargin{1}; selected_cluster=varargin{2}; spikeData=handles.spikeData; spikeMatrix=handles.spikeMatrix; ClusterAllocation=handles.ClusterAllocation; parameters=handles.parameters; T=spikeMatrix(:,2); sel=ClusterAllocation==selected_cluster; handles...
TT = timetable(date,subtax); TT2 = retime(TT,'quarterly','mean'); TT3 = timetable(date,subtax); TT4 = retime(TT,'yearly','mean'); UU = timetable(date,subtax); UU2 = retime(TT,'quarterly','min'); UU3 = timetable(date,subtax); UU4 = retime(TT,'yearly','min'); subplot(2,2,1) bar(quarterly_date,quarterly...
function genHeatMaps(cellList, anaList, outputFolder, varargin) %% Parse input. p = inputParser; p.addRequired('cellList',@(x) (ischar(x) && length(x)==6) || iscell(cellList)); p.addRequired('anaList',@(x) ischar(x) || iscell(cellList)); p.addRequired('outputFolder',@(x) ischar(x)); p.addParameter('VoxelSize',[15...
function bvhResults(dataSet, experimentNo) % BVHRESULTS Model Demonstration of modelling of BVH files. [bvhStruct, Y, frameLength, velocityIndices] = bvhLoadData(dataSet); bvhResultsDynamic(dataSet, experimentNo, 'bvh', bvhStruct, velocityIndices)
function ANA=sml_subj(subjname,fig,block,trial) if nargin<2 fig=0; end; datafilename = ['data/sml1_' subjname '.dat']; outfilename = ['analyze/sml1_' subjname '.mat']; ANA=[]; D=dload(datafilename); if (nargin<3) s=1; else if (nargin<4) s=find(D.BN==block & D.TN==1); else s=find(D.B...
% called by unifySignalsAll function maxEnergyIndex = printSignalEnergyPerAxis(name, signal, lbl) name lbl energyX = sum(signal(:,1).^2); energyY = sum(signal(:,2).^2); energyZ = sum(signal(:,3).^2); energyVec = [energyX energyY energyZ]; maxEnergyIndex = find(energyVec == max(energyVec)); fid = fopen('energyPer...
function [inputSignals, inputBus, t_end] = PowerSplitHEV_DirectInput_inputs(nvpairs) %% Input Signals for Power-Split HEV Model with Direct Input % Copyright 2020-2021 The MathWorks, Inc. arguments nvpairs.InputPattern (1,1) {mustBeMember(nvpairs.InputPattern, {... 'all_zero' ... 'power_split_drive' ......
classdef DataRepository < handle properties(Constant) end properties sequences; csv_suffix; end methods function obj = DataRepository(csv_suffix) obj.sequences = {}; %obj.LK_CONFIG_NAME =...
function [Wfd, beta, Fstr, iternum, iterhist] = ... smooth_monotone(x, y, wt, Wfd, zmat, Lfd, lambda, ... conv, iterlim, active, dbglev) %SMOOTH_MONOTONE smooths the relationship of Y to X by fitting % a monotone function of the form % f(x) = b_0 + b_1 D^{-1} e...
function [ edgList ] = remove_edges( input_edgList, edges ) edgList = input_edgList; for i = 1:size(edges,1) edge = edges(i,:); remove = [edge; flip(edge)]; edgList = setdiff(edgList, remove, 'rows'); end end
function [epsilon_stats,epsilons] = drawTrajs(trajs,N,randOn, smoothOn, ... colorscheme,minGap) figure(); epsilons=0:30:150; epsilon_stats=zeros(1,length(epsilons)); if nargin < 6 minGap = 30000; if nargin < 5 colorscheme = 'uniform'; if nargin < 4 smoot...
function granger_2D_baseplus_stats_only(g1,g1_f,labelconditions,freqrange,eq_range) allscreen() labelconditions=labelconditions([1 4]); F= [1 2; 1 3; 2 3] ; lab=cell(6,1); lab{1}='HPC -> Parietal'; lab{2}='Parietal -> HPC'; %lab{3}='Parietal -> HPC vs HPC -> Parietal'; lab{3}='HPC -> PFC'; lab{4}='PFC -> HPC'; %lab{...
function C = comm(A,B) % commutator of two matrices C = A*B - B*A; end
function [ data ] = Matrice_Information(baseApp,n) %UNTITLED2 此处显示有关此函数的摘要 % 此处显示详细说明 for i = 1:5 data(i,:) = baseApp{i}(n,:); end end
function buildRecognitionSystem() % Creates vision.mat. Generates training features for all of the training images. load('dictionary.mat'); load('../data/traintest.mat'); % TODO create train_features save('vision.mat', 'filterBank', 'dictionary', 'train_features', 'train_labels'); end
% closedLoop.m % Constants global ts; center = 0; % Format: {time, visStim} % [Mode, K0, K1, K2] visStim0 = [1, 0, 0, center]; visStimN = [1, 0, -6, 0]; %visStimN = [2, 90,3,0,0,-3,0]; LaserOn = '0000'; LaserOff = '0000'; olf1 = '0000'; olf2 = '0000'; histogramBounds = [1,120]; trialStructureList = [.....
%Ag: antígenos %N: número de dados de entrada (antígenos) %dim: dimensão dos dados %Ab: anticorpos %r: raio mínimo %E: raio que define a vizinhança para o cálculo da densidade local %R: vetor com o raio de cada anticorpo %μ: taxa de mutação %decaimento: constante de decaimento da taxa de mutação function Ab =...
function func = steam_calculation_functions(varargin) if ~isempty(varargin) func.pressure_interpolator = @pressure_interpolator; func.getSaturatedValues = @getSaturatedValues; func.getSuperheatedValues = @getSuperheatedValues; func.satliquid_update = @satliquid_update; func.s...
function [x, fx, X_sample, F_sample, result] = policySearchGeneralMDP(nr_arms, nr_balls) work_dir=cd; toolbox_dir=[work_dir,'/MatlabTools/']; GPO_dir = [toolbox_dir,'/Gaussian_Optimization/']; addpath(work_dir) addpath(toolbox_dir) addpath(genpath(GPO_dir)) % Direct Policy Search ER_hat=@(w) evaluateGeneralMDP([w(:)],n...
function [ q_prod ] = quat_mult( q1, q2 ) % QUAT_MULT Product of 2 quaternions (scalar on top) % This function calculates q1 * q2 a = q1(1); b = q1(2); c = q1(3); d = q1(4); e = q2(1); f = q2(2); g = q2(3); h = q2(4); % From Wikipedia: % http://en.wikipedia.org/wiki/Quater...
% Messwerte einlesen load Batteriesensor.mat; % Berechnung der Konstante c2 über inverse t-Verteilung % mit 9 Freiheitsgraden c2 = tinv(1-1e-5,9); % Berechnung der Prognoseintervalle nach Gleichung \eqref{eq:fivehundredfiftyfour} ProgObenNeueShunts = mean(NeueShunts')' + ... std(NeueShunts')'*...
N = 5; A = zeros(N,N); numberOfMatrices = floor(N*log(N)); N = N + 1; %Calculates average of NlnN matrices outputMatrix = randomFill(A,N); for n=1 : (numberOfMatrices - 1) temp = randomFill(A,N); outputMatrix = outputMatrix + temp; end outputMatrix = outputMatrix / numberOfMatrices; %export matrix to excel f...
function [model] = matLearn_kernel_Laplace(options) % h will be the variance of the kernel, determines the amount of % contribution of neighbouring points. model.h = options.h; model.predict = @predict; end function [w] = predict(model, z) h = model.h; w = (1/h) * exp(-abs(...
load cities.mat % categories: each row is a category % names: each row is a city % ratings: each row is a city, each col is a category [n,d] = size(ratings); scores = zeros(n,d); for i = 1:d cat = ratings(:,i); score = (cat - mean(cat)) / std(cat); outliers = find(score > 4); % Show th...
%% ======================================================================== % In practice, the histogram technique can be useful for obtaining a quick % visualization of data in one or two dimensions but is unsuited to most % density estimation applications. % Two widely used nonparametric techniques for density...
%transmit all float in cell into string function r = num2str_cell(data) idx = cellfun(@isfloat,data); r(idx) = num2str(data); end
function [z, T2ML, phi, Dk, soe, soe_3s, soe_twm, soe_twm_3s,k_SDR_VC, t, S, CapH20, FreeH20, k_TC] = build_nmr_txt_file(name) % convert raw data files to text files in format to be used by % NMR_script_main % read in data files in1 = [pwd '\bstrp_dat_VC_raw\' name '\' name '_SE_decay' '.txt']; in2 = [pwd '\bst...
function [sol] = jmaDoL1(fname_fwd,lambda2,srcSpace,srcCor) % % An example on how to compute an L1-norm inverse solution % % fname_inv - Name of the inverse file % % lambda2 - The regularization factor. lambda^2 ~ 1/SNR (POWER!) % ex. 10/1 Power SNR -> lambda2 = .1; % ex. 10/1 Amplitude SN...
function IterativeMethods() filename = 'data.txt'; data = importdata(filename); x = data(:,1); z = data(:,2); d = [z(:)]; G = [ones(length(x), 1) x(:) x(:).^2]; a = -2:0.05:2; b = -2.0:0.05:2; c = -1.0:0.05:1.0; m_naught = [0 2.0 -0.5]'; [mx, my, mz] = sphere; r...
%------------------------------------------------------------------------------------------- % make_amipFuture4K.m % % I ran into problems with this because it was written to be used with Matlab 2009. % However, matlab 2009 does not read NetCDF 4 files, only NetCDF 3. % % This script opens a file with historical sst ...
function [Qest] = estimateQMLE(Tr,k) %estimateQMLE Estimate a transition matrix based on the count of %transitions % Qest = estimateQMLE(Tr) : if Tr is the count matrix of a markov chain, % and k the number of node in the graph then Qest is the resulting % estimated matrix Qest = Tr ./ repmat(sum(Tr, 2), 1, ...
clear all close all clc folder = 'Test Images\'; files = dir(strcat(folder,'*.jpg')); file_list = {files.name}; num = size(file_list, 2); for i = 1:num name = file_list{i}; idx = strfind(name,'.') - 1; image = imread(strcat(folder,name)); lane_detection(image, strcat('Results\',name(1:idx))); end
function [ pre ] = readUItree( src,event,pre,tree ) %readUItree - get the values of the stuff within it... % James S. McKenzie, Imperial College London, 2014. % Don't touch these at all! tree1 = tree.tree; root = tree1.getPathForLocation(1,1); node = root.getLastPathComponent; % Number of children nodes numN = node...
% % Define the global variables for the workspace and inizialize them with % the size specified by problem_size. We need that info because model % inference will found only observed transitions, and we cannot say % anything about unobserved ones. % function startup_iter(problem_size, tol, min_ei, LB, UB, nBins, log_fil...
function Korrespondenzen = punkt_korrespondenzen(I1,I2,Mpt1,Mpt2,varargin) % In dieser Funktion sollen die extrahierten Merkmalspunkte aus einer % Stereo-Aufnahme mittels NCC verglichen werden um Korrespondenzpunktpaare % zu ermitteln. %% Input parser p = inputParser; %zwei Grauwert-Bi...
function [b y1 mw]=cwscale(y,par) % b field [mT] % mw GHz opt.temp=''; % Ensure power scaling option if isfield(opt,'power')==0; opt.power='n'; end if isfield(par,'Gain')==1 Gain_dB=par.Gain(1:end-2); % dB Gain_dB=str2num(Gain_dB); % dB Gain=10^(Gain_dB/20); % number els...
function [list_of_image_names, image_classes, all_classes] = get_images_from_subdir(dir_name) listing = dir(dir_name); list_of_image_names = cell(1); image_classes = cell(1); all_classes = cell(1); pic_count = 0; class_count = 0; for i = 1:numel(listing) if or(or(strcmp(listing(i).name,'.'),strcmp(listing(i...
function convmat = polyconv(c1, c2) % POLYCONV computes products of polynomials defined by columns of % coefficient matrices C1 and C2 % Last modified 3 April 2002 [ord1, n1] = size(c1); [ord2, n2] = size(c2); deg1 = ord1 - 1; deg2 = ord2 - 1; % if the degrees are not equal, pad out the smaller matrix with 0s ...
function ydot = sys_model(t, y, p) a = p(1); b = p(2); c = p(3); d = p(4); nu = p(5); omega = p(6); x1dot = d*nu*y(1,1) + a*y(1,1)^3; x2dot = omega + c*nu + b*y(1,1)^2; ydot = [x1dot;x2dot]; end
% Note that quaternions in Tsiotras are written as: % q = (qVec, qScal) % This has been handled here function obj = matQuatMult(mat, quat) obj = Quaternion; [rows,cols] = size(mat); if rows == 4 && cols == 4 M11 = mat(1:3, 1:3); % 3 by 3 M12 = mat(1:3, 4); % 3 by 1 M21 = mat(4, 1:...
% % Dados da camera alpha=75*pi/180; % Dados da geometria S0=0.20; S1=0.20; S2=0.20; save('data.dat','alpha','S0','S1','S2')
function strOut = VigenereDeCrypt(STR,keystr) % strOut = VigenereDeCrypt(STR,keystr) % Inputs: STR = a string of upper-case text (alphabet: A, B, ..., Z) % keystr = a string of lower case text (alphabet: a, b, ..., z) % Output: s = a string of corresponding lower-Case plaintext(alphabet: a,b, ..., z) % resultin...
function y = ball_strike_single_unit_stats_single_session_downsample(session, green_or_cyan) % Add the current path addpath('./') % Set some parameters num_reps = 10; percentiles = [80,85,90,95]; % Set some defaults desired_block_number = 1; get_single_flash_responses = 1; calculate_choice_proba...
function unwrappedPhase = my_unwrap(phase) k = 0; % initialize k to 0 unwrappedPhase = phase; diff = phase(2:end) - phase(1:end-1); for i = 1:(size(phase)-1) unwrappedPhase(i,:) = phase(i) + 2*pi*k; % add 2*pi*k to unwrapped phase if diff(i) >= pi % if the phase difference > +pi, k...
function [r, dr] = ComputeCorrelationBasis(point, neighs, sd_rad, options) %% ComputeCorrelationBasis % Use: Computes the correlation basis and its gradient for the Moving Kriging Interpolation. % % Syntax: [r, dr] = ComputeCorrelationBasis(point, neighs, sd_rad, options) % % Input: % point - The coordinates of t...
function [outputArg1,outputArg2] = ReceiveCallback(obj,event) % callback function of serial port % 此处显示详细说明 global s fid; out = fread(s,1024,'uint8');%读取数据 fprintf('%X ',out); %一个字符占三位输出,%c字符,%d整型 fprintf('\n'); fprintf(fid,'%X ',out); % 写入文件中 fprintf(fid,'\n'); end
function initStim global stiPar scr stiPar.gaborstd = .8; stiPar.gaborf = 1.5; stiPar.apersiz = 2.1; stiPar.gaborsiz = 1.9; stiPar.gaborpsiz = angle2pix(scr,stiPar.apersiz); stiPar.gaborangle = [0 90]; stiPar.sinsiz = .8; stiPar.gaborPosition = [scr.center(1)-angle2pix(scr,10) scr...
function u = sol_heat_eq(a, l, X, phi, N, t1, x_sz, t_sz) x = linspace(0, l, x_sz); X_val = zeros(length(x), N + 1); for i = 1:(N + 1) X_val(:, i) = X(x, i - 1)'; end nrm = trapz(x, X_val .^ 2); idx = find(nrm < 0.000001); nrm(idx) = ones(size(idx)); A = trapz(x, X_val .* repmat(...
classdef dc < qes.waveform.waveform % dc % Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences % mail4ywu@gmail.com/mail4ywu@icloud.com methods function obj = dc(length,level) obj.jWaveform = com.qos.waveform.DC(length, level); end end end
%************************************************************************** % GCV denoising %************************************************************************** % % [USAGE] % [dn] = gcvThresh(data,opt) % % [INPUTS] % data: a structure including the information of input data % opt: ...
%% THIS FUNCTION WILL PLOT BARS WITH ERRORBARS AND ADD SIGNIFICANCE ASTERISKS % above the bars. function [p_values handles] = errorplot(matrix,txt_legend,legendstyle) % Get means, errors and perform ttests. ind = 1:size(matrix,2); m = mean(matrix); e = ste(matrix); [h1 p_values] = ttest(...
%HessEigQR: Compute all eigenvalues of a matrix using the QR algorithm % and deflation. The matrix is first reduced to Hessenberg form and the % QR step is implemented using Givens rotations. % % Usage: % >> D=HessEigQR(A); % % Note that this code only works if all the eigenvalues of the matrix are % real. For a genra...
function [h1, h2] = umts_ddc_filter_conf1(Quantize, Nfft, ShowPlots) if (nargin<3) ShowPlots = 0; end if (nargin<2) Nfft = 32768; end Fs = 61.44; % First Decimation Filter Hd = ddc_conf1_h1; h1 = Hd.Numerator; H1 = 20*log10(eps + abs(fftshift(fft(h1, Nfft)))); if Quantize h1 = xquantize(h1, 18)/2^17; ...
Buna {{name}}, Ne e dor de tine! Din prietenie iti oferim 5% discount la produsele pe care le-ai lasat in cos la www.shop-usa.ro Discountul il poti revendica folosind codul promo: {{promocode}} Codul este valabil 24 de ore. Pentru a beneficia de discount, nu uita sa adaugi codul in campul "Cod Promotie" in pagina...
function matnum = splitMatTrades(path2data, outdir, nrecords, matnum, opt) % SPLITMATTRADES Splits mat files by number of records % % SPLITMATTRADES(PATH2DATA, [OUTDIR], [NRECORDS], [MATNUM], [OPT]) % - PATH2DATA directory where .mat and .idx files to split are % - OUTDIR defaults to PATH2DATA if unspecif...
function inCurvs_mod = group6(inCurvs) % group6.m - Rotate all angles to be from 0 to 180 deg (curvelets have no % direction, so we just need 0 to 180, not 0 to 360) % Inputs % inCurvs = list of curvelet centers and angles % % Optional Inputs % % Outputs % inCurvs_mod = modified list of curvelet angles % % By Je...
function [ang,unitary] = rotMat2Eaa(R) %function [ang,axis] = rotMat2Eaa(R) % That given a rotation matrix returns its respective euler principal column axis and angle in radians. I = eye(3); t = trace(R); ang = acosd((t-1)*0.5); if ang == 0 %If angle equals 0 axis is not moving, so axis = [0, 0, 0] axis = [0 0 0...
% Definition der Funktion idcalc zur Berechnung des Diodenstroms als Funktion % von Parametern function [id] = Idcalc(beta,u); % Auflösen des Parametervektors beta iscalc = beta(1)); utcalc = beta(2); ncalc = beta(3)); % Berechnung des Diodenstroms id = iscalc*(exp(u/ncalc/utcalc)-1)*1000;
%Método Iterativo de Muller: clear clc format long %----------------------------------------- x0 = 2.; tol=1e-15; x=fMuller(x0,tol)
function [ ] = loadSimulation( ) %LOADSIMULATION Summary of this function goes here % Detailed explanation goes here delete('monitoring.txt'); delete('dataset.dat'); delete('indicators.dat'); DCConfiguration2vm(); for l = 1:20 for i = 1:5 assessment([l,5]); end end for l = 1:20 for i = 1:5 ...
% set up the environmental pathing addpath(genpath('../InverseOC/')); addpath(genpath('Common/')); addpath(genpath('../Common/')); addpath(genpath('../Utils/')); addpath(genpath('../Logic/')); addpath(genpath('../Libraries/Robotics_Corke/')); addpath(genpath('../Libraries/rl')); addpath(genpath('../Libraries/brewerm...
function [v] = mgpcg(f, mask, vsz, tol, maxit, mgopts, verbose) %MGPCG Multigrid preconditioned conjugate gradient for Poisson's equation % with homogenous Dirichlet BCs. % % -Delta u = f, for x in mask % u(~mask) = 0 % % [v] = MGPCG(f, mask, vsz, [tol], [maxit], ...
function [xDes,u,t] = ptPathGenerator(simTime) % clear all; close all; clc; lW = 1.1; fS = 15; x0 = [0;0;0]; delT = 0.01; % simTime = 15; T = simTime / delT; t = 0:delT:simTime; t1 = 0:delT:15-delT; t2 = 15:delT:simTime-delT; u1 = [10 + 0 * t1 ; 0.4 * sin( pi / 7.5 * t1 )]; u2 = [10 + 0 * t2 ; - 0.4 * sin( pi / 7.5 *...
function rmse_vals = calc_rmse(rmse_fct, feature_win, feature_recon, param) rmse_vals.q = rmse_fct(feature_win.q, feature_recon.q, param.win_length); rmse_vals.dq = rmse_fct(feature_win.dq, feature_recon.dq, param.win_length); rmse_vals.ddq = rmse_fct(feature_win.ddq, feature_recon.ddq, param.win_leng...
function al_sleepInstructions(taskParam) %AL_SLEEPINSTRUCTIONS This function runs the instructions for the % "sleep" version of the cannon task % % Input % taskParam: Task-parameter-object instance % % Output % ~ % Extract test day and cBal variables testDay = taskParam.subject.testDay; cBal = taskPara...
function [ Final ] = SML( ML, N, img ) N = floor(N/2); MML = padarray(ML,[N,N,0]); Final=zeros(size(ML)); for i = 1:100 for l = 1: size(img,1) for m = 1:size(img,2) a=N+l;b=N+m; sum = 0; for p = a-N:a+N for q = b-N:b+N ...
% rerun_grey_listed % program to rerun a grey listed float either after grey listing or after % removal from the grey list. % % this requires the dbdat structure as well as the starting and % ending profile numbers. It then goes and generates the right argos % download to use and reprocesses all intervening profiles...
function tracks = getDisplacement(tracks,tsamp) % % Calculate mean square displacements as a function of time-interval delta t. % % Created by Alex Robson. % Commented and modified by Isabel October 2011. % If you use this code please acknowledge Alex Robson and Isabel Llorente-Garcia in your % publications. % % % The...
%% C: low amplitude rythmic behavior wave = importSignal('trial_701 Tupaia Doughboy 9-27-2001 cricket'); figure plot(wave(6900:10900), 'k'); set(gcf, 'Position', [100, 100, 1063, 797]); imagewd = getframe(gcf); imwrite(imagewd.cdata, 'figs/3C.tif', 'Resolution', 300); %% B: orphan spikes wave = importSignal('GA7-15-...
function [] = label_trackstart(indir, outfile, keyframefile) %-------------------------------------------------------------------------- % % Copyright (c) 2014 Jeffrey Byrne % %-------------------------------------------------------------------------- %% Defaults if ~exist('outfile','var') || isempty(outfile) outfil...
% Sample rate Fs = 16000; % Sin wave setting, one row [Freq, start time, end time] for one sin wave. % both start and end time are in seconds Sins = [500, 0, 1; 1000, 1, 2; 2000, 2, 3 3000, 3, 4]; tones = zeros(1, max(Sins(:,3)*Fs)+1); for n=1: size(Sins, 1) N = [0:(Sins(n,3)-Sins(n,2))*F...
%% Polynomial Regression on 2D data % Question 2(a) clear; clc; close all; %% importing data data = importdata('./data/24_3.txt'); size(data) x1 = data(:,1); x2 = data(:,2); x3 = data(:,3); x4 = data(:,4); x5 = data(:,5); x6 = data(:,6); x7 = data(:,7); x8 = data(:,8); y = d...
% example_usage.m % % Code here shows an example usage of the visualization tools currently works on mac and linux! % % 2020 % Kevin Aquino <aquino.km@gmail.com> % % MATLAB path from freesurfer (you dont need freesurfer installed just the folder) freesurfer_matlab=['/Applications/freesurfer/matlab/']; filExist=whic...
function [f, x, y] = kernelDensity2D(data, varargin) %[f, x, y] = kernelDensity2D(data, x, y, nXPoints=25, nYPoints=25, sigma=1, weights) %This function does a data smoothing using a gaussian kernel. It is %similar to ksdensity except that it takes a 2D data vector instead of a %1D. % %The first parameter is...
pkg load symbolic function resultado = predictor_corrector(str_funcion, a, b, n, x, y) % Metodo Predictor-Corrector para aproximar la solucion de un problema de valor inicial % :param str_funcion: string con la funcion que se debe evaluar % :param a: Extremo inferior del intervalo % :param b: Extremo ...
function [bitnum,len]=DCHuffmanEncoding(sequence) % the dc encoding in the text bool temp=sequence; tmpvalue=abs(sequence); if (tmpvalue==0);amplitude=1;codelen=3;codenum=2;% codenum=010 elseif(tmpvalue==1);amplitude=1;codelen=3;codenum=3;% codenum=011 elseif(tmpvalue >= 2 && tmpvalue <= 3);amplitude= 2;c...
load('twomoons_sk.mat') n = length(fea); % data normalization feastd = std(fea); feastd(feastd == 0) = 1; % some pixels are 0 in all images fea = (fea - mean(fea)) ./ feastd; % number of sets of samples n_sets = 1000; % number of samples in each set n_samples = 20; sigma = 0.2; % the sigma is important! default is 1 ...
%% MMSP2 - Lab 5 % Exercise 1 - DCT/KLT comparison clear close all clc %% 1) Load the image 'lena512color.tiff' and extract the luminance component im = imread('lena512color.tiff'); R = double(im(:,:,1)); G = double(im(:,:,2)); B = double(im(:,:,3)); %luminance è CL dell'RGB attaverso una matrice di trasformazione...
function split (trainX) Xt=trainX(1:6000, :); save('Xt.mat','Xt'); end
function sgmga_aniso_normalize_test ( dim_num, level_weight ) %*****************************************************************************80 % %% SGMGA_ANISO_NORMALIZE_TEST calls SGMGA_ANISO_NORMALIZE. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 27 November 2009 ...
function [ P ] = ConvHomogen( PN1 ) %CONVHOMOGEN Summary of this function goes here % Detailed explanation goes here a=size(PN1); P=[PN1' ones(a(2),1)]'; end
function [y,cons] = P1(x) % Test function if x <= 100 y = -exp(-(x/100).^2); else y = -exp(-1) + (x-100)*(x-102); end % constraints cons=[];
%% pendulum_forced_A135_A144_A1465_poincare.m % Purpose: a matlab script that solves the forced motion of a pendulum and % plots only points where force and motion are in phase %% define function & constants function pendulum_forced_A135_A144_A1465_poincare % initial condition theta0 = 0.2; % theta0 = theta(0) dtheta0...
function MPIparams = setMPIParams(Physicsparams, rs) MPIparams.Rs = rs; % slew rate vector [x,y,z] (T/s) % gradients (T/m) (current scanner) MPIparams.Gxx = 4.8; MPIparams.Gyy = 2.4; MPIparams.Gzz = 2.4; MPIparams.Bp = 10e-3; % Drive field (T) MPIparams.f_drive = 10e3; %...
% encrypt('MUHAMADRIZKYFAJARFEBRIAN^_^Ditambahin_bEn_tAMBAh_PanjanG_daN_Angel','A1120171049225'); decrypt('STG`L`CQHYJXE`P`QEDAQH`MCHS`SA`GHMADMS`LA`NO`MI`MFC`M`MFKK','A1120171049225'); function v = vigenere % Square 27 on a side count = 58; % Map letters to numbers, A=1, B=2, ... SPACE=27 a...
% This code solves the model of Graham and Wright (2010, JME) % Incomplete Information Version Using two equation system: % c_{t} -E_{it} [c_{t+1} - (1-beta*(1-delta))*r_{kt+1}] = 0 % r_{kt} = (Pa(z)/Q(z))*a_t + (Pc(z)/Q(z))*c_t % Solve for Equilibrium 1 where idiosyncratic consumption and capital features random wa...
function [LineList] = CompleteRoadNetwork(LineList) % find lines which have unconnected endpoint endLines = LineList([LineList.nconn] == 1); for i=1:size(endLines,2) for j=1:size(LineList,2) defl1(j) = 0; defl2(j) = 0; dist(j) =...
clc clear imgPath = 'D:\电子科大上课课件\电子科大上课课件\综合课程设计\数字字母训练集\4\'; imgDir = dir([imgPath '*.jpg']); % 遍历所有jpg格式文件 k=1; for i = 1:length(imgDir) % 遍历结构体就可以一一处理图片了 img = imread([imgPath imgDir(i).name]); %读取每张图片 im = imresize(img,[32 16]); im1 = im2bw(im); im2 = reshape(im1,512,1); out = im2dou...
function [ outImg ] = ICV_partition_images( inputIm , ws, idx, idy) % Function: ICV_partition_images % Input: % inputIm: Input image % ws: Window size % idx, idy: specific window % Output: % outImg: Output image size_im = size(inputIm); outImg = zeros(ws, ws); for i=1:ws:size_im(1)-w...
function [T,S]=load_ts_metoffice(ncfile, GRDfile, StartDay, EndDay) % % LOAD_TS_metoffice: Loads T,S data from the UK Met Office datasets % % [T,S]=load_ts_metoffice(ncfile, GRDfile, StartDay, EndDay) % % This function loads temperature and salinity profile data from the UK Met % Office Hadley Centre, quality contro...
% 纯跟踪(Pure Pursuit)法 % 作者:Ally % 日期:20210429 clc clear close all load path.mat %% 相关参数定义 RefPos = path; targetSpeed = 10; % m/s Kv = 0.1; % 前视距离系数 Kp = 0.8; % 速度P控制器系数 Ld0 = 2; % Ld0是预瞄距离的下限值 dt = 0.1; % 时间间隔,单位:s L = 2.9; % 车辆轴距,单位:m % 计算参考航向角 ...
function [dist1, dist2] = dist_orig_match(cdata, cand_matchlist) view1 = cdata.view(1, 1); view2 = cdata.view(1, 2); matches = cand_matchlist; pts1 = view1.feat(matches(:,1), 1:2); pts2 = view2.feat(matches(:,2), 1:2); n1 = size(pts1,1); n2 = size(pts2,1); dist1 = zeros(n1,n1); dist2 = zeros(n2,n2);...
classdef EmFitEng < FitEng % Abstract EM Fitting Engine properties diagnostics; verbose = true; end properties(Access = 'protected') nrestarts; convTol; maxIter; end methods(Access = 'protected', Abstract = true) ...