text
stringlengths
8
6.12M
function d = display(a) % DISPLAY - % disp(' '); disp([inputname(1),' = ']) disp(' '); disp([' ' char(a)]) disp(' ');
function filter_upd_pmb=TPMB_all_projection_cov_oos_round(filter_upd,T_alive,Nx,k,Lscan) %This function obtains the best fitting trajectory PMB to the updated %trajectory PMBM based on KLD minimisation %This version includes the covariance matrix for hypotheses that consider dead trajectories %It is also tailored fo...
function [ I ] = gammaCorrectImage( I, gamma ) % Tao Du % taodu@stanford.edu % Feb 12, 2015 % % Do gamma correction for image I. % Input: I: a height x width x 3 image. % gamma: a scalar, typically 2.2. % Output: I: the corrected height x width x 3 image. The range is (0, 1). % Use gamma = 2.2 by default. if na...
function [value, isterminal, direction] = event_function1pop(t,x,beta, gamma, mu, alpha,lambda,tol1) Z = TwohostOnepopODE(t,x,beta, gamma, mu, alpha,lambda,tol1); %this function just checks see if the ode45 has reached equilibrium or not %if the norm of the derivative values is less then tol1, it is assumed %eq...
function [perfusionMap,perfusionMap_filtered,perfusionMap_prefiltered] = calculatePerfusion(ASLmeas,ASLm0,ignore) % CALCULATEPERFUSION Is used for ASL scans. It is not very optimized! % Temporary function, do not use this for any real research. % USAGE: % [perfusionMap,perfusionMap_filtered,perfusionMap_prefiltered] .....
function delg = gradsigmoid(z) # delg = gradsigmoid(z) returns the gradient of the sigmoid function # evaluated at z. # It computes the gradient of the sigmoid function evaluated at z. # where z is a matrix/vector/scalar. If z is a vector or matrix, gradsigmoid returns # the gradient for each element. t = sigmo...
%set global constants global showPlots syncBits syncSymbols Lh if ~exist('GSMtop','var') error('You need to execute GSMsim_config while in GSM config folder') end showPlots=1; %use 1 to show plots Lh = 4; %the assumed channel dispersion. It will determine %the length of the impulse response estimated b...
function F = EstimateFundamentalMatrix(x1, x2) %% EstimateFundamentalMatrix % Estimate the fundamental matrix from two image point correspondences % Inputs: % x1 - size (N x 2) matrix of points in image 1 % x2 - size (N x 2) matrix of points in image 2, each row corresponding % to x1 % Output: % F - s...
function output=rereference_CAR_median(data,mode,badChannels,permuteOrder,channelReference,channelsToUse) % Function to either common average, or median rereference, % while excluding bad channels. % % data is either time x channels, or time x channels x trials % bad_channels is a list of bad channels as output % leave...
function writeMIP(reader,v) %writemip Takes a reader and videowriter and writes the maximum intensity %projection of each timepoint to videowriter for time = 1:reader.getSizeT mip1 = calculateMIP(reader,1,time); mip2 = calculateMIP(reader,2,time); frame = cat(3,im2double(mip1),im2double(mip2),zeros(size(mip...
function v = kinetics_get(n, job, a, b, c, d, e, f) % KINETICS_GET - get kinetics attributes % if nargin == 2 v = ctmethods(40, n, job); elseif nargin == 3 v = ctmethods(40, n, job, a); elseif nargin == 4 v = ctmethods(40, n, job, a, b); elseif nargin == 5 v = ctmethods(40, n, job, a, b, c); elseif ...
fc_tools.utils.cleaning() N=10; options={'perm',@(A) colamd(A)}; [bvp,info]=fc_vfemp1.examples.setBVPCondenser2D01(N,2); fc_vfemp1.examples.print_info(info) fprintf('*** Solving %s\n',info.name) [U,SolveInfo]=bvp.solve('time',true,options{:}); fprintf(' -> ndof (number of degrees of freedom) = %d\n',length(U)); fc_...
function[ infoRatio ] = InfoRatio( nav, benchmark) %这个函数用于计算Information raio %[ infoRatio ] = infoRatio( nav, benchmark,) %nav: 净资产 % benchmark:基准净资产 % —————————— % 唐一鑫 20150511 %% main delta = evl.nav2yield(nav)-evl.nav2yield(benchmark); sigma = std(delta)*sqrt(365); infoRatio = (evl.annualYield(nav)-e...
function [ ] = createDIMACSfile( bubStructList ) % CREATEDIMACSFILE Summary of this function goes here % This function takes in list of Bubbles (struct) obtain from MSER. % Arcs are created, and additional information are formed and % converted to DIMACS format which is then write into a text file. % The text file ...
function makeCubicPerms rowIdx = 1; for i = -3:3 if i == 0 i = i + 1; end for j = -3:3 for k = -3:3 for m = -3:3 perm{rowIdx,1} = i; perm{rowIdx,2} = j; perm{rowIdx,3} = k; perm{rowIdx,4} = m; rowIdx = rowIdx+1; ...
% 神奇的函数系列,可以用于将手拍图像处理的和扫描一样的骚操作、 %% demo I = imread('printedtext.png'); figure imshow(I) title('Original Image') %以上输入原始图像并展示(实际操作只需前两句) BW = imbinarize(I,'adaptive','ForegroundPolarity','dark','Sensitivity',0.4); %暂时没搞懂的最核心的一句,先放着 figure imshow(BW) title('Binary Version of Image') %嗯结果,被阴影挡的看不起的地方也可以扫的非常...
% Function: % [shape, pglobal, visible] = faceAlign(img, Model, l_shape, b_opm) % % Usage: % This function localizes facial landmarks in a facial image or tracks % the facial landmarks in an image sequence. For tracking, each frame of % a video is sent as an input image and the tracked facial landmarks in % ...
basepath='C:\Users\60069978\Documents\MATLAB\medicion37\radio6\'; files=dir(fullfile(basepath,'*.png')); for q = 1:2 L=length(files)/2; %porque tengo dos capturas de cada radio radio=nan(L,1); Profiles=nan(2048,L); k=0; for f = files' I=imread(fullfile(basepath,f.name)); ...
load('genesPhenes.mat') fout = fopen('ggi_weighted.txt', 'w'); [row, col, v] = find(GeneGene_Hs); nData = size(row); genes = 12331; total_values = nData(1) fprintf(fout, "%d %d\n", genes, total_values); formatSpec = "%d %d %f\n"; for iData = 1:total_values if mod(iData,10000) == 0 disp('10000 data complete...
function [S0,P0,P1] = kf_SWR(Y,Q,R,Sm,SI,PI,T); % [S0,P0,P1] = kf_SWR(Y,Q,R,Sm,SI,PI,T); % This file performs the forward kalman filter recursions for the Stock-Watson-Romer model. % Y is inflation % Q,R are the SW state innovation variances % Sm is the standard deviation of the measurement error % SI,PI ar...
% ------The configuration structure-------% cfg=[]; cfg.layout=layout32; cfg.comment='no'; cfg.layout.pos([33 34],:)=[]; % The stucture consists of 34 channels and -COMNT AND -SCALE labels are removed cfg.layout.width([33 34],:)=[]; cfg.layout.height([33 34],:)=[]; cfg.layout.label([33 34])=[]; %--------T...
classdef Plane < DynSys properties % Angular control bounds wMax % Speed control bounds vrange % Disturbance dMax end methods function obj = Plane(x, wMax, vrange, dMax) % obj = Plane(x, wMax, vrange, dMax) % % Constructor. Creates a plane object with a u...
function resultS = result_settings % Min no of observations for computing cohort fit resultS.fitMinObs = 15; end
function qx = quantfilt1(x, quantile, span, varargin) % % qx = quantfilt1(x, quantile, span, [tail_option]) % % quantfilt1() is a span-order quantile filter for one-dimensional arrays % quantile is the proportion of the window data whose value is returned at the center of each window %...
%% supposed to fix the timing issues function t = fixTiming(t) for i = 1:(length(t)) check = t(i,1); count = 0; while (check == t(i,1)) && ((i+count) <= numel(t)) count = count +1; if (i+count) < numel(t) check = t(i+count,1); end end for j = 2:count ...
% Fonction cible pour le système de Mackey - Glass % ************************************************ if ~exist('outTitle','var') disp('Fonction cible'); else if outTitle disp('Fonction cible'); end end %% 1 - Paramètres %% 1.1 - Délai if ~exist('tau','var') tau = 17; drapTau = 0; else ...
function [data] = pitot_remove_waves(data) %% dt = diff(data.time(1:2))*3600*24; %_____________________low pass 100 sec______________________ f_low = dt/30; data.spd = qbutter(data.spd,f_low); data.Pdym = qbutter(data.Pdym,f_low); data.V_cal = qbutter(data.V_cal,f_low); data.U = qbutter(data.U,f_low); dat...
load 'input_data/ACTEWAGL/helm_input_wd.mat';Result_File='forecast_result/ACTEWAGL/layer1/helm_forecast_result_wd.csv'; NumberofHiddenNeurons=148; %load 'input_data/ACTEWAGL/helm_input_lwd.mat'; Result_File='forecast_result/ACTEWAGL/layer1/helm_forecast_result_lwd.csv'; NumberofHiddenNeurons=208; %load 'input_data/ACT...
function out = donotch(data,sr) % applies notch filtering at 60 and 120 Hz to a time series % data is a matrix of data (to be filtered along first non-singleton % dimension -- i.e., each column a variable) % sr is the sampling rate (in Hz) dt = 1/sr; %%%%%%%% apply notch filter %%%%%%% % notch at 60 Hz wo = 60/(sr/2)...
classdef ExperimentReportGenerator < handle properties exp_file_list; exp_id; exp_hostname; end methods function obj = ExperimentReportGenerator(exp_id,exp_hostname,dir_prefix) if nargin<=1 exp_ho...
function [fits, sems, th] = getML_psyPerformanceDD(fn, recompute) % use [fits(:,i),sems(:,i)] = ctPsych_fit(@ddExp3, d(:,1:3), d(:,4)); % to get behavioral threshold if nargin < 1 return; elseif nargin < 2 recompute = 1; end if recompute a = getML_txt(fn); fname = a.data{strcmp(a.name,'dat_...
% XXXXXXXXXXXXXXXXXXXXXXXXXXX sus_cri XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX % % Author : Susanti % Date : Aug 1 2014 % Function : % Syntax : sus_cri(data_input, net) % % % Algorithm - % XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX function y = sus_cri(data_inpu...
%% select_01 % finds booleans for occurences of members of taxon among members of taxon_src % function [sel, taxa_src] = select_01(taxon_src, taxon_sel) % created 2016/04/12 by Bas Kooijman, modified 2017/06/14 %% Syntax % [sel, taxa_src] = <select_01.m *select_01*>(taxon_src, taxon_sel) %% Description % Finds boole...
function [fvt] = ftWav(ft,t) %evaluates the time component of the control corresponding to the specified %basis function no. ft %ftLin uses as basis the (hirarchical) ordered subspace of piecewise linear %functions %ATTENTION: ftLin uses te, which has to be defined accordingly to runIoMap te = 0.1; tif = sqrt(1/te); ...
function w = gen_hermite_compute_weights_np ( order, np, p ) %*****************************************************************************80 % %% GEN_HERMITE_COMPUTE_WEIGHTS returns the weights of a Generalized Hermite rule. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % ...
%penyelesaian kasus menggunakan metode WP clc;clear; %untuk membersihkan jendela command windows opts = detectImportOptions('wp_123190133.xlsx'); %mengimport data excel opts.SelectedVariableNames = (3:5);%mengambil data dari kolom 3-5 data1 = readmatrix('wp_123190133.xlsx',opts); %membaca matrix dari data opts...
function [attIFest wIFest] = oneStepEstimator(attIF, wIF, Tsample) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here attIFest = attIF; wIFest = wIF; end
startup; compile; matlabpool open 4 clusters = [1 3 4] families = textread('families.txt', '%s') for i = 1:size(families) for j = 1:3 families{i} n = clusters(j) train_a_model(families{i},n) end end
function b = fn_interprows(a,subrate,method,extrap) % function b = fn_interprows(a,subrate[,method[,extrap]]) %--- % interpolate to account for delays between different rows % demultiply frames according to subrate [default=1] % method and extrap arguments are as for interp1 function % Thomas Deneux % Copyright 2006-...
function result = is_cart_coordinate_data(x,y,z) if is_double(x) && length(x) == 1 && isreal(x) &&... is_double(y) && length(y) == 1 && isreal(y) &&... is_double(z) && length(z) == 1 && isreal(z) result = 1; else result = 0; end
%% Current Experiment experiment.clock = cell(1,2); experiment.clock{1} = clock; experiment.session = ['S' num2str(experiment.number,'%02u') '.' datestr(now,'yy.mmm.dd.HH.MM.SS')]; experiment.direct = [ direct.DataResultsRoot experiment.session '\' ]; mkdir( experiment.direct ) experiment.dataFile = [ experiment.dir...
function InteractiveSimDlg % This function creates a msgbox when "Interactive Simulation" is checked from the SimSetupFig global vinf if exist('Interactive_msg.m') assignin('base','dont_show',0); [vdoc_image,vdoc_image_map] = evalin('base','imread(''advisor.bmp'',''bmp'')'); interactive_description_msg=['By...
% Save_IterSummary - Saves data from each run to file % Called by: Save_Run % Calls: (none) % V02 - 12/30/2013 VC % ©MathEcology, LLC 2013 - Colleen R. Burgess %-------------------------------------------------------------------------- function Save_File(filepath, filename, colbasename, data) % SAVE_FILE Saves data ...
function rg = vectorToGrid(vec, nh) rg = zeros(nh, nh); for j = 1:nh; for i = 1:nh; rg(i, j) = vec( ( j-1) * nh + i ); end; end; end
DRUG = 'etazolate'; SAVE = 0; lat = 40; winsize = 100; db = loaddb; f = figure; set(f, 'visible', 'off'); % iterate over all cells cells = unique(db.cell); %cells = {'romeo0344'}; sigs = []; signs = []; basal = []; for celln = 1:length(cells) fprintf('----> %s\n', db.cell{celln}) % iterate over all etazolat...
function [err, errP] = emo_nnError(errorType, Y, T, RAW_ERROR) % % Input: % RAW_ERROR : % errorType : (optional) error calculation % 1 : abs(error) % 2 : sum-squared error (divided by 2) % (default: 2) % % Output: % err : The error calculation^M % errP: gra...
function imgOut = filterGabor(imgIn,sigX,sigY,f0,phi,sizeW) [rows cols ~] = size(imgIn); % Preparacion de la imagen a = (39-1)/2; for i=1:rows aux2(i+a, 1:a ) = imgIn(i, a:-1:1 ); aux2(i+a,cols+1:cols+a) = imgIn(i,end:-1:end-a+1); end for j=1:cols aux2( 1:a, j+a) = imgIn( a:-1:1, ...
function Moments = uq_student_PtoM(nu) % Moments = UQ_STUDENT_PTOM(Parameters) returns the values of the % first two moments (mean and standard deviation) of a Student's t % distribution based on the specified degrees of freedom nu if nu <= 1 mu = nan; sigma = nan; elseif nu > 1 && nu <= 2 mu = 0; sig...
%% Paweł Antkowiak %Projekt 4 %Aparatura clear clc close all %% Obliczenia dw=1;%[m] dn=0;%[m] p0=8e5;%[Pa] kr=240e6/1.65;%[Pa] c1=0.002; c2=0.001; c3=0.0008; err=1; g(1)=15e-3; i=1; while err>1e-5 dz(i)=dw+2*g(i); beta(i)=dz(i)/dw; om(i)=dn/sqrt(dz(i)*g(i)); z(i)=wspz(om(i)); g1(i)=p0*dz...
close all; clear all; % Load data datafile = 'C.mat'; load(datafile); data = rawStarData; x_data = data(:,1:4); y_data = data(:,5:8); % Check for missing stars x_check = x_data == 1023; y_check = y_data == 1023; data_check = x_check & y_check; numStars = 4-sum(data_check,2); ndata = size(data,1); x_da...
%% %EP 501 Homework 2 %Julio Guardado clc; clear; close all; %% Problem 1, Part a: first root of 0 order bessel function %define function and setup rho = linspace(0,20,200); eta = .01; maxit = 100; tol = 1e-9; f_rho = besselj(0,rho); %plot function to find initial guess figure(1); plot(rho,f_rho) xlabel('\rho'); yla...
function [ tomoAngles, z ] = tomoAngleCircluarGeometry( geom, scanAngle, z ) % compute tomographic angles for circular geometry tomosynthesis system % % Meng Wu at Stanford University % 2013 if nargin < 3 z = - 250: 1: 250; end % detector size ldet = geom.detSize(1) * geom.detSpacing(1); % half scan angle beta =...
path_n='E:\GSK\ActCh\P10_sc_disect'; EIT_fname = 'CR_EIT019_T_EIT_85uA_6kHz_20s_200ms_Prt1_ref1_CRUSHED.vhdr'; Prt_name='Prt_1.txt'; map_p=[ 3 4 7 8 9 12 13 14 15 16 19 21 22 23 26 27 28]-1; % Montage map_=[ 3 4 7 8 9 12 13 14 15 16 19 21 22 23 26 27 28]; % Actual numbering EP_cutoff =...
function level_difference = leveldif(left_X,right_X) % function level_difference = leveldif(left_X,right_X) % % LEVELDIF evaluates the interaural level difference by the following method. % The transfer functions of the external ears are filtered by a % ROEX-filter (see EARFILT) with the...
function [] = checking_data_saving_time(File_name) %input %sample calling: % wifi_reader_fazlay('1', '.\Kamran_Pass\Kamran_Pass_3.dat', '100', '13000', '0', '0.8', '200', '300', '0.055','0.063', '0.055','0.063','2','4','1','1','Authenticate_Ali') Mov_avg_Len = 1; % Averaging readings over Mov_avg_Len*0.4ms Param = 'L...
function varargout = edl_siglib(varargin) % UNCLASSIFIED: Ed Limbaugh's personal signal processing toolbox. % library = edl_siglib(); % --> library.sinc_no_pi(x) % --> library.time2scans(N, Fs) % --> y = edl_siglib('sinc_no_pi', x); % --> ... many other handy functions. % By default, we'll return a (library)...
function h=min_L1_norm(X,w_init,Y,lambda,max_iter) n=size(X,1); gamma=n/2/norm(X'*X); not_converged=true; w=w_init; iter=1; while not_converged w_next=soft_thresholding(w-2*gamma/n*X'*(X*w-Y),lambda*gamma); err=sum((X*w_next-Y).^2+lambda*sum(abs(w_next))); err_prev=sum((X*w-Y).^2+lambda*sum(abs(w))...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Symmetry Based Analysis of Facial Expressions Partially Occluded Due to Head Motions % Version : 1.0 % Date : 01.2.2017 % Author : Mehdi Ghayoumi %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
function [B,x,y,zx,zy]=VL(T,P,z,comp) K=zeros(size(z,2),size(z,2)); K=zeros(size(z,2),size(z,2)); R=8.314; kz=zeros(size(z))+1e+6; kz=(comp.Pc./P.*exp(5.37.*(1+comp.w).*(1-comp.Tc./T))); [B,x,y,zx,zy]=twophaseVL(T,P,comp,K,z,kz) function [B,x,y,zx,zy]=twophaseVL(T,P,comp,K,n,k) R=8.314; n1=.5; er1=1; er2=0; a=1; kk=50...
function [S,I,R] = SIR-PC(So,Io,Ro,a,b,t,n) %asigancion de datos iniciales h=t/n; S(1)=So; I(1)=Io; R(1)=Ro; s=So; i=Io; r=Ro; for j=1:n S(j+1)=S(j)+(h*0.5)*(s+b*S(j)*I(j)*h); I(j+1)=I(j)+(h*0.5)*(i+I(j)*(b*S(j)-a)*h); R(j+1)=R(j)+(h*0.5)*(r+a*I(j)*h); [s,i,r]=Predictor(S(j+1),I(j+1),R(j+1),a...
%% PlacePiece % Author - Tanishq Jain % Uses the piece id and background color to determine the image tranform % to be used so as to merge with background square % Argument -bg_color = background tile color 0:black,1:white % square_state = % 0 - Empty % 1 - pawn % 2 - rook % 3 - knight % 4 - bishop % 5 - queen % 6 - ...
% this file is to create database clc; clear all; close all; d={'P1','P2'}; FD=vision.CascadeObjectDetector; kk=1; h=waitbar(0,'Please wait creating database'); for dd=1:length(d) F=dir(d{dd}) F=char(F.name) sz=size(F,1)-2; for ii=1:sz str=F(ii+2,:); cd(d{dd}) I=imread(str); ...
function a=find(lib,X,Y) t = 0; p = lib.path; for x = 1:length(p) s = p(x); if sum(s.xc == X & s.yc == Y) % if sum(s.yc == Y) t = t+1; a(t) = s; end end [a.xc' a.yc']/1e3 a.xc(1)-7493 a.xc(3)-5743 a.xc(2)-5743 a = library([],lib.name,lib.units,a);
clc; close all; clear all; %% DATOS mu = 398600; % km^3/s^2 rT = 6371; % km 637 i = deg2rad([5, 46]); % rad rP = rT + 600; % km w = 2*pi/86164; % rad/s R_GEO = (mu/w^2)^(1/3); %% Apartado A ri = rP; rf = R_GEO; % Ciruclar vci = sqrt( mu/ri ) vcf = sqrt( mu/rf ); % Elpi...
function [number] = read_train(root,ni,n) % ni为读取图片张数,n为文件夹数目 %========读取负样本的图片========% out_Files = dir(root);%展开,out_Files存储64个文件名包括.,..。 tempind=0; imglist=cell(0); %========按temp的要求读取文件数========% for i = 1:n+2; if strcmp(out_Files(i).name,'.')|| strcmp(out_Files(i).name,'..') else rootpath=strcat(ro...
close all clear clc nat_frequencies = []; damping_ratios = []; % loop through all tests in exp3 for i = 1:10 fp = strcat('Rectilinear/exp3_test', num2str(i), '.txt'); data=textread(fp,'','headerlines',22); %reads text file time=data(:,1); %time vector disp=data(:,5)...
function [] = pricing_tf_design_3() clear all; rehash sigma = 0.3; r = 0.05; T = 60; S0 = 1; %% 生成二叉树根 pricer = BinomialPricer; % pricer.set_params_from_optPricer(oi); %% 手动设置参数 pricer.T_ = T; pricer.S_ = S0; pricer.u_ = exp(sigma * sqrt(1/365)); pricer.d_ = exp(-sigma * sqrt(1/365)); pricer.r_ = r; ...
function [fig] = plot_Turb(basedir, pflag, is_visible, runname) % plot_Turb.m % % load Turb.m and plot all of the variables that have been processed %%%%%%%%%%%%%%%%%%% DEFINE PARAMETERS %%%%%%%%%%%%%%%%%%% % RUNNAME % Name of folder in which Turb.mat is saved (folder within ../proc/) % For example, if Turb.mat is i...
function varargout = make_zstackView(varargin) % MAKE_ZSTACKVIEW MATLAB code for make_zstackView.fig % MAKE_ZSTACKVIEW, by itself, creates a new MAKE_ZSTACKVIEW or raises the existing % singleton*. % % H = MAKE_ZSTACKVIEW returns the handle to a new MAKE_ZSTACKVIEW or the handle to % the existing si...
function [reconstructed_vid] = stripes2frames(vid_tensor,parameters) X = vid_tensor.data; % [p,q]- size of the frame p = vid_tensor.frame_size(1); q = vid_tensor.frame_size(2); patch = parameters.patch; K = size(X,3); reconstructed_vid = zeros(p,q,K); for k = 1:K for i=1:p/patch for j=(i...
classdef TrialInstruction < WBTrial properties screenNum = 0; end methods function start(this) % CREATE THE INSTRUCTION SCREEN ti = WBTextDisplay('INTRO TEXT', '', 24); %ti.xLoc = 50; ti.text = {'As this experiment is about multita...
function varargout = spectrum2pulse(omega_in,field_in,M) % omega_in: angular frequencies % field_in: field in spectral domain (can be complex) % M: string describing the field mask in the spectral domain as a function of frequency. Use % 'omega' to refer to angular frequency as the independent ...
% Load training set and validation set clear all; dataDir = 'cifar-10-batches-mat'; load(fullfile(dataDir, 'data_batch_1.mat')); data_train = data; label_train = labels; for i = 2:5 load(fullfile(dataDir, ['data_batch_' num2str(i) '.mat'])); data_train = [data_train; data]; label_train = [label_tra...
function [ ] = demo_aggregate( image_file_path, landmarker, frontalization,AutoChoose) % This function takes in the location of the image, the techniques of % landmarker, that can be one of the following : % -'dlib' % -'ZhuRamanan' % -'CMR' % % the possible options of frontalization are : % -'Hassner' % -'Vito' % De...
function plot_errorfunction(matrix1, matrix2, opts) figure('visible', opts.figure_windows); error_calculation = (matrix1 - matrix2) ./ matrix2; imagesc(error_calculation); colorbar; % hold on; print('output/error_calculation', '-dpng'); end
function [normim, normtform, xdata, ydata] = imnorm(im) % % Implementation of the image normalization part of: % 1. P. Dong, J.G. Brankov, N.P. Galatsanos, Y. Yang, and F. Davoine, % "Digital Watermarking Robust to Geometric Distortions," IEEE Trans. % Image Processing, Vol. 14, No. 12, pp. 2140-2150, 2005....
[x,y] = fmincon('func1',ones(4,1),[],[],[],[],zeros(4,1),[],'func2');
function [ mean_distance, std_distance, distances ] = pp_slanding_11( scanpath1, scanpath2, ff_flags ) if nargin<3, ff_flags=[0 1]; end [ mean_distance, std_distance, distances ]=pp_slanding( scanpath1, scanpath2, ff_flags ); end
clear; close; clc; x= linspace(1/2,5,50); y2=sqrt(2*x+1)-sqrt(2*x-1)-1; plot(x,y2,'LineWidth',4) grid P = [5/8 0]'; text(P(1)+0.2,P(2)+0.05, 'P') hold plot( P(1),P(2),'ro','LineWidth',4) xlabel('x'); ylabel('y'); print -deps -color ee16b1015.eps
function [ smap ] = saliency_bmsalt( input_image, input_path ) if size(input_image,3)<3 input_image(:,:,2)=input_image(:,:,1); input_image(:,:,3)=input_image(:,:,1); end imwrite(input_image,'default.png'); system('/usr/bin/python3 saliency.py -i default.png'); smap=imread('default_saliency.png'); smap=mat2gr...
global robots robotIds = [528 314 871]; [~,numberOfRobots] =size(robotIds); Kp =12*3; Ki =8*3; Kd =5*3; E_k = [0;0;0]; e_k_1 = [0;0;0]; dt=0.20; %200ms t=1; while t<5*5 t = t+1; for i = 1:numberOfRobots k = find(robots(:,1)==robotIds(1,i)); if isempty(k) continue...
[sum1] = sumtorial(4); [sum1_soln] = sumtorial_soln(4); % sum1 => 10 % [sum2] = sumtorial(14); [sum2_soln] = sumtorial_soln(14); % sum2 => 105 % [sum3] = sumtorial(56); [sum3_soln] = sumtorial_soln(56); % sum3 => 1596
function doFlag(source,eventdata,ID,flag) % Set a mask file to ignore a sensor, used for sensors with only bad data global metadata panels const data if nargin<4 Selection = listdlg('Name','Flag sensor','PromptString','Select flag type','ListString',const.sensorFlags,'SelectionMode','single','OKString',...
function homogenDataTest(data_miss,data_full,varargin) %HOMOGENDATATEST test homogeneity of meteorological data % Input time series (with missing data and the one used to filled the missing % periods) must not be of identical length. Important is only that bot time % series are overlapped and use identical time resol...
function fitness=m_Fitness(pop) %% Fitness Function %y=xsin(3x)在[-1,2]上,最大值也不会超过2 %所以计算函数值到2的距离,距离最小时,即为最优解 %适应度函数为1/距离 fitness = zeros(1,100); for n=1:size(pop,2) fitness(n)=1/(2-m_Fx(pop(:,n))); end end
function overlay_bits = dicom_has_overlay_bits(info) %DICOM_HAS_OVERLAY_BITS Return overlay bit positions in pixel cells. % Copyright 1993-2003 The MathWorks, Inc. % $Revision: 1.4.4.1 $ $Date: 2003/01/26 05:58:39 $ % Overlay data requires one or more OverlayBitsAllocated attributes to be % set (60xx,010...
% mixed_logit_estimator: estimation/identification of underling distribution of random coefficients % of a simple example binary logit model under alternative distributions for % unobserved heterogeneity global nqp qw qa data; data=load('choice_data.dat'); % load the da...
% anova2 for area analysis rep = 1; % exp1 exp2 exp3 % treated % untreated format long % aream = [0.00198642 0.0015094;6.88708e-06 5.15011e-06;1.17804e-05 5.21541e-06 ]; aream = [0.00198642 0.0015094;6.88708e-06 5.15011e-06;1.17804e-05 5.21541e-06 ]; % 0.00198642 0.0015094 % 6.88708e-06 5.1...
% Library of general math operations % % Author : Jonathan EDEN % Created : 2018 % Description : classdef GeneralMathOperations methods(Static) function P = PolynomialFit(X,Y,degree) CASPR_log.Assert(size(X)==size(Y),'X and Y must be vectors of the same size'); l_x = ...
function [aika,dekohinoitu] = dekohinoi(signaali) % Poista kohina mittaussignaalista. Signaali on pystyvektori. % Palautusarvoina ovat aikavektori (keinotekoinen) ja % kohinavapaa signaali. % % Kohina poistetaan diskreetin Fourier-muunnoksen avulla. % Signaali muunnetaan taajuustasoon ja siita leikataan korkeat % taaj...
clear all; close all; clc; ver = '2'; [y,m,d] = datevec(date()); timestamp = [num2str(m),'-',num2str(d),'-',num2str(y)]; locnum = 2; if locnum > 1 dataFolder = ['../../Data/data_multi_v',ver,'_',timestamp]; movieFolder = ['../../Data/movie_multi_v',ver,'_',timestamp]; else dataFolder = ['../../Data/data...
function ConvertHStoNbands(local_HS_data,local_HS_label,local_size_data,local_size_label,label_dimension,data_dimension,local_stride,chunksz,local_amount_hd5_image,filename) %% global variable to determine the numbers of images included by each hdf5 file global FILE_COUNT; global TOTALCT; global CREATED_FLAG; ...
function DY = DiscreteDY( N ) Nvert = (N+1)*(N+1); h = 1./N; iidx = zeros(2*Nvert, 1); % Speicherplatz für alle Werte reservieren jidx = zeros(2*Nvert, 1); % Insgesamt besitzt die Matrix genau zwei values = zeros(2*Nvert, 1); % Einträge je Zeile (also je Knoten) % Zunächst: iidx0, jidx0, values0 bestimmen, s...
function [PIM, DIM] = MakeDichromatIms(im) % Digitally simulating dichromat vision % Reshape to 3xN, each column is a pixel rgb = reshape(im, [], 3)'; rgb = (double(rgb) / 255) .^ 2.2; % Protanopes rgb_p = 0.99502 * rgb + 0.003974; % Deuteranopes rgb_d = 0.957237 * rgb + 0.0213814; % LMS transform matrix M = [17.88...
function [S2NR, T_axis, S2NR_mean] = s2nr_call(filename, NFFT , ... RTH, alpha, sigma) % S2NR call procedure % usage: % [S2NR, T_axis, S2NR_mean] = s2nr_call(filename, NFFT , RTH, % alpha) % NFFT: fft window size % RTH: reliability threshold % alpha: fft window...
function x = quadraticSymbolic(coef) %Checking to see if there is the correct number of inputs if (length(coef) ~= 3) x = 'Null'; return else %Generate the y values from cardanos formula in symbolic form x = quadratic(coef(1),coef(2),coef(3...
function [P,i,F ] = getPSat( T,P0, NC, Comp, XF, solveEOS, corr ) F = 1; i = 0; P = P0; Pold = P0; dx = 1e-06; h = 1.0; corr = 1.0; while ( (F > 1e-8) && (i < 100) ) if ( P > 0 ) findMinZ = 1; [ ~,~ , fug_l] = solveEOS(T,P,XF,findMinZ,NC,Comp); ...
addPaths % Load the well log input_dir = './wlogs/'; output_dir = './grlogs/'; mkdir(output_dir); las_files = dir(strcat(input_dir, '*.las')); count = 0 for f = 1:size(las_files)[1] try wlog = read_las_file(strcat(input_dir, las_files(f).name)); gr = strcmp(wlog.curve_info(:...
clear, clc format long, format compact f = @(x) 512*x^10 - 5120*x^9 + 21760*x^8 - 51200*x^7 + 72800*x^6 ... - 64064*x^5 + 34320*x^4 - 10560*x^3 + 1650*x^2 - 100*x + 1; dfdx = @(x) 5120*x^9 - 46080*x^8 + 174080*x^7 - 358400*x^6 + 436800*x^5 ... - 320320*x^4 + 137280*x^3 - 31680*x^2 + 3300*x - 100; seps = findS...
% statisticResult path = './result'; labelpath = 'E:\data\MNIST\testlabel'; n = 0; a = 0; c = 0; for i = 1:10000 if mod(i,100) ==0 disp(i) end label = imread([path,'\',int2str(i),'.png']); im = imread([labelpath,'\',int2str(i),'.png']); im = double(im); label = label(:,1:28); n = n + leng...