text
stringlengths
8
6.12M
function X_h = kalmanDeconv(model,X) %% Decovolution by using Kalman Filter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Input: % model: model structure % consists of A, G, C, S, mu0, P0 % A: coefficient matrix of source variable % G: covariance of source's noises (Q = diag(G)) % ...
function [ meanExtLocBgd, stdvExtLocBgd,result] = ... extendedLocBgd( S,traceNo,nFrames,minTraceLen ) %-------------------------------------------------------------------------- % % extendedLocBgd.m: % Calculates the mean local spot background intensity for short time % traces. % % Description: % This ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% Chongyi Li, Chunle Guo, Wenqi Ren, Runmin Cong, Junhui Hou, Sam Kwong, Dacheng Tao , "An Underwater Image Enhancement Ben...
% Solves a simple advection problem by Kurganov & Tadmor Scheme % with Superbee limiter % du/dt+d/dx[F(u)]=0; F(u)=v*u % Variables clearance clear all % Domain extension xleft=0; xright=1; % Physical paramaters % Advective velocity vvalue=1; uvalue=1; % BC's uleft=uvalue; uright=0; % Time-step dt=0.001; % Number ...
% file handleing creation of matrice A and A^-1. % calling file where constants are declared. constants_sin; % making matrix A A = zeros(nt,nx); A(1,1) = 1; A(nt,nx) = 1; for i=2:1:nt-1 A(i,i-1) = a; A(i,i) = b; A(i,i+1) = c; end % making matrix B which is inverse of A B = inv(A);
function [plot_density]= graph_density(data,nodos,control_distance_ij,C, interval) %% Description: %Visualization of graph density X variation of Small distance to set the %best thershold of graph % %% Input: %data: vector column with data %nodos: nodos of cycles %control_distance_ij: intervals coords of cycle...
function [value] = zf_Binary_Decimalism(bin2_8) % % 函数说明:将二进制数组转换成十进制整数 % % 输出:bin2_8(二进制数组) % % 输入:value(十进制整数) value = 0; len = length(bin2_8); num_len=len-1; if bin2_8(8)==0 %0代表正式 for i=1:num_len value= value + bin2_8(i)*(2^(num_len-i)); end else for i=1:num_len value= val...
function out = getMinuteDataFromDB(tableName) % Copyright 2011, The MathWorks, Inc. % All rights reserved. % Set preferences with setdbprefs. s.DataReturnFormat = 'numeric'; s.ErrorHandling = 'store'; s.NullNumberRead = 'NaN'; s.NullNumberWrite = 'NaN'; s.NullStringRead = 'null'; s.NullStringWrite = 'null'...
% Chesapeake_25ft_1994 % Note: Modified Vee Hull % Aidan Gerkis % 2020-11-12 Boat = BoatModel; % Known values Boat.mb = 2041.2; % Boat mass (kg) Boat.l = 7.52; % Boat length (m) Boat.b = 2.82; % Beam length (m) Boat.beta = 14; % Deadrise Angle (degrees) Boat.maxdraft = 0.33; % Max draft (m) % Estimated...
function [ a, b ] = getwords( inputImg ) %getwords 获取单独的字 % 通过行列的投影,找到分割点,分割字符 inputImg = ~inputImg; %% 求图象大小 [rows, columns] = size(inputImg); %% 初始化 rowhist = ones(1, rows); % 存储每行为黑的个数 columnhist = ones(1, columns); %% 循环计算 for c = 1 : columns % 先分割列 columnhist(1, c) = sum(inputImg(:, c)); end ...
% load some real test data cases = dp_load_cases('lab_kitchen1', 56); c = cases(1); [ny nx nf] = size(c.pixel_features); [gny gnx ns] = size(c.wall_features); wvec = zeros(1, nf*3 + ns*2 + 2); % setup some mock weights %weights = make_weights(zeros(nf, 3), zeros(ns, 2), 0, -1); weights = unpack_weights(wvec, nf, ns);...
function [model,controller]=ReactionCurve(t,y,u) % REACTIONCURVE Process Reaction Curve approach to approximate high-order % systems by a first-order-plus-timedelay model using step % response data. This model can be used to design a PID % controller % [mo...
function rho = rho_air_calc(h) height = [-1000 0 1000 2000 3000 4000 5000]; rho_air = [1.347 1.225 1.112 1.007 0.9093 0.8194 0.7364]; rho = spline(height,rho_air,h); end
function plotPOMDP(results) % Get the data X1 = results.plot.belief_space; YMatrix1 = results.plot.alpha_values; YMatrix2 = results.plot.action_values; ymatrix3 = results.plot.policy_belief'; % Create figure figure1 = figure('Color',[1 1 1]); % Create subplot subplot1 = subplot(2,2,1,'Parent',figure1,'...
function w = spectrum(varargin) % SPECTRUM/SPECTRUM Spectrum class constructor % % Fields are: % x Array of x values % y Array of y values % e Array of standard errors % [If length(x) = length(y)+1, then x values are taken as histogram bin boundaries. % If le...
% Disclaimer: IMPORTANT: This software was developed at the National Institute of Standards and Technology by employees of the Federal Government in the course of their official duties. Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public...
%angulos en grados, deformaciones en microstrain function e = roseta(a1, a2, a3, e1, e2, e3) a1 = deg2rad(a1); a2 = deg2rad(a2); a3 = deg2rad(a3); %encontrar deformacion xx, yy y xy syms exx eyy exy eqn1 = (exx + eyy) / 2 + (exx - eyy) / 2 * cos(2 * a1) + exy * sin(2 * a1) == e1; eqn2 = (exx...
%% EEG?? Questionares %{ 12 total questions: 1) How would you feel about this feedback? (Correct Easy (green) Response) 1 = Terrible, 9 = Great 2) Does this feedback tell you about your performance 1 = Yes 0 = No 2 = I don't know 3) How would you feel about this feedback? (Incorrect Easy (red) Response) 1 = Terrible, ...
function switch2bpm(bpm_number) % Selects a bpm on the cytec multiplexor board % % INPUT: % bpm_number - the number of the bpm being selected. e.g. 4 for bpm 4 % % % Written October 2017 % By Levon ad = getad; if ~ad.simFlag cytec_mux_controller(num2str(bpm_number)); end end
%% Miniproject Code KUKA kuka=RobotConnectorKUKA; offsetX=411.69; offsetY=-285.27; offsetZ=340.12; offsetC=180; homex=50; homey=450; homez=50; %% %robotClearBuf(kuka) %A=getPosition(kuka) %robotClearBuf(kuka) %getJoint(kuka) %openGrapper(kuka) positionX=homex; positionY=homey; positionZ=50; orientationA=0; orient...
function scenario = Intersection_Scenario_1() % createDrivingScenario Returns the drivingScenario defined in the Designer % Generated by MATLAB(R) 9.6 and Automated Driving Toolbox 2.0. % Generated on: 22-Aug-2019 14:31:47 % Construct a drivingScenario object. scenario = drivingScenario; % Add all road segm...
clear; clf; % Introducerea punctelor definite t=[0,0.3,0.8,1.1,1.6,2.3]'; y=[0.5,0.82,1.14,1.25,1.35,1.4]'; % Se reprezinta cu O-uri negre puntele date plot(t,y,'Ko'); hold on; %Generarea matricei coeficientilor sistemului A=[ones(size(t)),exp(-t),t.*exp(-t)]; % Rezolvarea sistemului de ...
path = '/home/amanda/Dropbox/trabalho/doutorado/testes/aplicacoes/precipitação/data/'; for i = 1 : 86 folder_name = strcat('s', int2str(i)); mkdir(path, folder_name); movefile(strcat(path, 's', int2str(i), '.csv'), strcat(path, folder_name)); end
function drawArc(x,L,dir) r1=L/35; r2=L/17; hdiv=50; divs=linspace(-90,90,hdiv); x_=zeros(hdiv,1); y_=zeros(hdiv,1); i=1; for theta=divs x_(i)= x + r1*cosd(theta); y_(i)= r2*sind(theta); i=i+1; end plot(x_,y_,'Linewidth',3.5,'color',[0.2 0.4 0.8]); if dir>0 x0=x_(end); y0=y_(end); else...
function r = residuals(K, platform_to_camera, p_model, uv, weights, yaw, pitch, roll) base_to_platform = translate(0.1145/2, 0.1145/2, 0.0)*rotate_z(yaw); hinge_to_base = translate(0, 0, 0.325)*rotate_y(pitch); arm_to_hinge = translate(0, 0, -0.0552); rotors_to_arm = translate(0.653, 0, -0...
function out= SYNBAD_integra(input_file) eval(sprintf(input_file)); n_real = inputs.model.n_real_var; n_int = inputs.model.n_integer_var; idx = inputs.design.idx; vy = inputs.simulate.var_circuit; tspan=inputs.simulate.tspan; eval(sprintf('par = %s;',inputs.model.def_param_function)); x = vy(1:n_rea...
function [freqVals,psdST,psdBL,baseCorrectedLog10PSD, theta, RHO] = checkGoodTrials(subjectName, expType, stimType) saveFolder = '/home/me/GammaHarmonicData/savedData'; if isfile(fullfile(saveFolder,[subjectName expType stimType '.mat'])) load(fullfile(saveFolder,[subjectName expType stimType '.mat']))...
function AnalyzeRigidRotOutput %% set images and params folder locations xtPlotFolder = 'G:\My Drive\data_sets\nn_RigidRot\natural_images\xt'; filterFolder = 'G:\My Drive\data_sets\nn_RigidRot\saved_parameters'; param_list = dir(filterFolder); params = load(fullfile(filterFolder,param_list(end-...
function Tava = getThrustAvailable(Tsl, h) %GETTHRUSTAVAILABLE Returns thrust available at given altitude based on sea %level thrust and density ratio: [~, ~, ~, rhoSL] = atmosisa(0); [~, ~, ~, rho] = atmosisa(h); Tava = Tsl * rho / rhoSL; end
function [ varargout ] = surfn( varargin ) % SURFNF macro for surf with no edge % type 'help surf' for more information if(nargout == 0) surf(varargin{:},'EdgeColor','none'); else varargout{:} = surf(varargin{:},'EdgeColor','none'); end end
function uuid = createRepo(dvid, alias, description) postData = struct; if exist('alias', 'var') postData.alias = alias; end if exist('description', 'var') postData.description = description; end resp = dvid.sendPostRequest( ... 'api/repos', postData, 'json...
% You can use this skeleton or write your own. % You are __STRONGLY__ suggest to run this script section-by-section using Ctrl+Enter. % See http://www.mathworks.cn/cn/help/matlab/matlab_prog/run-sections-of-programs.html for more details. %%load data load('data'); % read in da...
bns = 51; ll = 10; rl = 50; allt = []; allp = []; allg = []; allf = []; alle = []; allc = []; allfe = []; allfc = []; alla = []; allw = []; alln = {}; bp = '/Users/wmcfadden/activ_llc/'; cd(bp); files = dir; files = {files.name}; for f = files if(strfind(f{1},'_scr') ) code = strsplit(f{1},'_'); ...
function out_data = us2signed(in_data, Nbits) % Transform the Nbits fixed-point unsigned representation of signed data to the original signed % representation, assuming the input is 2's complementary format. % in_data: Nbits fixed-point unsigned representation % out_data: The original signed data; % Nbits: Number of ...
% Controller parameters % kja 060802 % Special version to simulate windup and antiwindup % For windup set kt=0 for antiwindup set kt=2; global kp ki kt global theta_d %kp = 1; ki = 0.5; % controller gains kp = 0.3; ki = 0.1; kt=0.05; % controller gains a=-0.0142;b=1.3785; %a=0.004;b=3.61; w0=0.4;z=1; kp=(2*z...
function T = timeDilation(t, v) %timeDilation % this function takes as input a vector of Nt values for the time on % the spaceship (in seconds) as well as a vector of Nv values of the % velocity (in meters/second) and computes a matrix of size Nt × Nv % that contains the corresponding time (in seconds) on ea...
%========================================================================= % % Program to demonstrate the spurious regression problem % using correlation coefficients % %========================================================================= clear all; clc; RandStream.setDefaultStream( RandStream('mt19937ar','s...
usematlab = true; %% % weekly close price of NSYE, data provided with GRETL load nysewk.mat; n = size(nysewk); y = 100 * log( nysewk(2:n) ./ nysewk(1:n-1) ); data = y; plot(y); %% %%%%%%%%%%%%%%% Unconstrained maximization of logL %%%%%%%%%%% % note that the objective has a minus sign in front, as fminunc % minimiz...
function varargout = ADEPTm_GUI(varargin) % ADEPT-m is a simulation toolbox for researching photovoltaic cells. % Creates main page menu and calls other modules to build the other % menus after their respective buttons are clicked on. close all; global CONST CONST = A_const; % Initialization tasks mInputArgs =...
function CorrectRealSenseFrames_KalmanFilter(depthStackFile) %________________________________________________________________________________________________________________________ % Written by Kevin L. Turner % The Pennsylvania State University, Dept. of Biomedical Engineering % https://github.com/KL-Turner %__...
function [Hausdorff_dist,tp,tn,fp,fn] = validation_metrics(img,GT) % This function take segmentated image and the groud truth as the % inputs and output the hasudorff distance, true positive, true % negative, false positive, false negative. Hausdorff_dist = 0; if size(img) ~= size(GT) error(...
% THIS FUNCTION IS PRIVATE AND SHOULD NOT BE CALLED BY OUTSIDE CODE! % 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 [] = Recei...
function [Grid] = build_grid(Grid) % author: Evan Carnahan % date: 10/20/19 %HW1 Q3 (1) % Description: % This function computes takes in minimal definition of the computational % domain and grid and computes all containing all pertinent information % about the grid. % % Input: % Grid.xmin = left boundary of the domain ...
function varargout = printsize(varargin) % VL_PRINTSIZE Set the print size of a figure % VL_PRINTSIZE(R) sets the PaperPosition property of a figure so % that the width is the fraction R of the current paper page width. % % VL_PRINTSIZE(FIG,R) opearates on the specified figure FIG. % % This command is useful t...
function [n_Transcripts,n_Promoters]=HL_transcripts_and_promoters n_Transcripts = 4; n_Promoters = 8;
function y=G_conjugado_b(n) M=zeros(n,n); a=zeros(1,n); b=zeros(1,n); c=zeros(1,n); d=zeros(1,n); xo=ones(1,n); for i=1:n for j=1:n if j==i M(i,j)=0.6; a(j)=0.6; if(i==1) M(i,j)=0.8; ...
% Clear all variables clear; % Create serial object global ser ser = serial('COM4', 'BaudRate', 115200); set(ser, 'Parity', 'none'); % Open connection fopen(ser); % Wait for startup pause(5); % Open GUI untitled % Send initialization data output_str = sprintf('%d %d %f %f %f', 800, 0, 0.59, 0.05, 0.05); fprintf(se...
function [nK Admittanz]=admittance_matrix(filename) %% data [Ndleitung measure baseMVA] = network_data(filename); nK=max(max(Ndleitung(:,1:2))); %% dimension_leitung_daten=size(Ndleitung); nL=dimension_leitung_daten(1); r_matrix=zeros(nK); x_matrix=zeros(nK); for i=1:n...
function ytfrmpara2(data) global YThdeg2; global YTvdeg2; global hObject1 handles1; global scanstat2; global proflag2; global yt2; global lidar2cnt; global startangle2; global endangle2; global paravalue; global flag_SFMODE; YTResolution = str2num(paravalue.yt.ytresolution); switch data(4) % 获取云台状态 ...
function varargout = DPABI_Standardization(varargin) % DPABI_Standardization MATLAB code for DPABI_Standardization.fig % DPABI_Standardization, by itself, creates a new DPABI_Standardization or raises the existing % singleton*. % % H = DPABI_Standardization returns the handle to a new DPABI_Standard...
function T_new = advection_diffusion_solver(T, ... % Temperature matrix u, ... % x-velocity matrix v, ... % y-velocity matrix dt, ... % time step ...
% Octave4.4.1 % 线性回归模型,使用矩阵化的梯度下降法 % 学习率 alpha = 0.00000001; % 输入及输出,均为m维的向量 X = load('featureX.dat'); Y = load('priceY.dat'); m = length(X); % 为输入添加全1列 X = [ones(m,1) X]; % 参数theta theta = [1 1]; % 假设函数 h = X * theta'; % 损失函数 J = (h - Y)'.^2 * ones(m,1) /2 /m; % 梯度下降,矩阵表示 i = 1; J=[]; while i<= 300, tmp = (X * the...
function [f,x,p] = discrete_normal(n,mu,sigma,width) % Creates equally spaced approximation to normal distribution % n is number of points % mu is mean % sigma is standard deviation % width is the multiple of stand deviation for the width of the grid % f is the error in the approximation % x gives the location o...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Standard Reference Material for LA-ICP-MS: % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % by David L. Jones % % This file is part of the FATHOM Toolbox for Matlab and % is released under the GNU General Public License, version 2. % Data compiled in file 'S...
function output = cnnFC( input, weight_matrix, bias ) %CNNFC 全连接层运算,实际上为矩阵乘法运算 % input:一个1*n的向量,表示输入 % weight_matrix:一个m*n的矩阵,表示权值 % bias:一个1*n的向量,表示偏移 % output:一个1*m的向量 [~,k] = size(input); %输入向量转为1*n形式 if k~=1 temp = weight_matrix*input(:); else temp = weight_matrix*input; end output = temp + bias; ...
i= 0; currSceneEnd=0; clear comps; while currSceneEnd~=size(B,2) clear A bedNums=0; bedNums2=0; currSceneStart=currSceneEnd+1; currSceneEnd=currSceneStart+1; currSceneName=B{currSceneStart}{1}; while (currSceneEnd<=size(B,2)&&isequal(B{currSceneEnd}{1},currSceneName) ) cur...
% This script shows the categorisation profiles of subjects and models, % averaged over sequences. In particular, it shows that different models % with different representations have different categorisation profiles. % % Copyright (c) 2020 Maxime Maheu % Whether to average over sequences or not avgseq = false; % Ge...
clear all; close all; clc; load refnames_all inpath = 'E:\databaserelease2\databaserelease2\'; distortion = {'jp2k'; 'jpeg'; 'wn'; 'gblur'; 'fastfading'}; dsize = [227 233 174 174 174]; num=1; s = size(distortion); for u =1:1%s(1) for v =1:1%dsize(u) count = sum(dsize(1:u-1))+v; cnt(num)=...
function sim_mat = get_nbr_sim(adj) adj2 = adj*adj; deg = sum(adj,2); n = size(adj,1); sim_mat = zeros([n,n]); for i = 1:n for j = i+1:n sim_mat(i,j) = adj(i,j) + adj2(i,j)/(deg(i) + deg(j)); sim_mat(j,i) = sim_mat(i,j); end end end
function[BIAS,MAE,RMSE]=enkf_lorenz96_test(n,N,ipv,r,nac,reps,ts) % Function for testing diferent estimates of forecast matrix in EnKF % usinf lorenz96 model. % % in: % n : length of state % N : number of ensemble members % nac : number of assimilation cycles % reps: number of replications ...
global baseParameters fparam parami nbin Acell calP2X7 iparam parami baseModel pMax pMin; pMax=containers.Map(); pMin=containers.Map(); %Create a cell array of strings with the names of the parameters. paramNames={'k1','k2','k3','k4','k5','k6','k7','k8','k9','k10','k11','k12','k13','k14','k15','k16','k17','k18','k19...
function [files_in]=adni2_grab_rawmnc(input_folder,demographic) input_folder = '/home/danserea/database/adni2/rawdata/'; demographic = '/home/danserea/svn/projects/adni2/main_scandate_demographic.csv'; [tab,labx,laby] = niak_read_csv(demographic); % check the files tab_files = {}; subjects = dir([input_folder '/su...
function L = fd_laplacian(side) % FD_LAPLACIAN build a finite difference laplacian for a regular grid. % % L = fd_laplacian([h,w]) % L = fd_laplacian([h,w,t]) % % Inputs: % dims number of nodes along height (and width and depth) % Outputs: % L prod(side) by prod(side) Laplacian with negative ...
clc, clear all setNum = 1; imNum = 57; liNum = 0; I = loadDtuImage(setNum,imNum,liNum); load('DTU\results1200x1600\vl-dog-5-10\features_001-057-00') load('DTU\results1200x1600\vl-dog-5-10_cellhist-gray-go-m-1.2599-1-concentric polar-8,2-17-box-Inf,Inf-gaussian-1,1-pixel-gaussian-2,2-gaussian-2.5-8\descriptors_001-057...
% ************************************************************************* % File Name : plotVec2D.m % Author : Dingjiang Zhou % Boston University, Boston, 02215 % Create Time : Sat, May. 25th, 2013. 04:42:09 PM % Last Modified : % Purpose : the parameters used to r...
%% legend_string=cell(1,ndays); for i=1:ndays legend_string{i}=sprintf('Day %i',i); end legend_string_df=cell(1,ndays-1); for i=1:ndays-1 legend_string_df{i}=sprintf('Day %i-%i',i,i+1); end % plot com for each day overlaid figs.com=figure('position',[400 400 300 300],'paperpositionmode','auto'); h=plot(com./...
function template_pRF(session_dir,subject_name,pRF_dir,data_file) % Takes the output from Mathematica template fitting (Benson, 2012;2014), % seperates into individual maps, transforms back to .nii.gz, and % converts polar angles back to radians. % % Written by Andrew S Bock Feb 2015 %% Set defaults if ~exist('pR...
function screening_plot(X, Objhandle, Range, xi, p, Labels) % Generates a variable elementary effect screening plot % % Inputs: % X - screening plan built within a [0,1]^k box (e.g. with % screening_plan.m) % Objhandle - name of the objective function % Range - 2xk matrix (k - number ...
function matrix = sparse2matrix(cellvec) % first element of the received cell is the size of the space matrix, so create it with the % default value specified by the second element of the cellvec % cellvec{1}(1), first element, first element of the array % cellvec{2}, second element of the cell representing the defau...
clear d=11; % dimension m=1; % number of constraints N_data=120; % sample size n_outer=1000; % outer test size N_test_data=10000; % test size delta=0.05; epsilon=0.05; rng(123) % LP setting load('c_sigma_for_11.mat')...
function sum = CountNumberOccurencesOfX( sequence, x ) sum = 0; for i=1:length(sequence) if(sequence(i) == x) sum = sum + 1; end end end
%% series-series syms k syms Zs; syms RL; syms RL1; a= -4*k; b=2*(1+k)^2*RL; c=-4*k*Zs^2-(1+k)^2*RL^2; ans=solve(a*RL1^2+ b*RL1+ c,RL1); kx=[]; fo=150e3; wo=2*pi*150e3; Ls=68e-6; Cs= 1/(wo^2*Ls); RL= 64; M=17e-6; RL1k=[]; for k=0:0.01:1 kx=[kx k]; RL1=[]; wRL=[]; for f=1e5:1e3:2e5 ...
%% rick_actions_heatmaps_all_phases_v4 %v4: edited for 2019-14 %v3: Adding back in mean/sem compiling for prism, also changed to jet %v2: changing labeling+numbering for publication. % built from rick_2019_06_means_heatmaps_all_phases_v3 %to merge 2018-07 in with it %v3 make sure the arrays get cleared %v2 making h...
const sieve <- object sieve const supported <- 100 process var PrimeArray : Array.of[Boolean] <- Array.of[Boolean].create[supported] % All numbers are prime for i : Integer <- 2 while i < supported by i <- i + 1 PrimeArray[i] <- true end for PrimeArray[0] <- false...
clear all; close all; home; %% % ###################### % ##### Parameters ##### % ###################### % v/b = Average use rate % The default setting (v=2, b=100) assumes that, % on average, items are used 2 times within 100 time units. v = 2; b = 100; % Suppose an item has been used n times wi...
function BW = adaptive_water_flow(I) %ADAPTIVE_WATER_FLOW Summary of this function goes here % I: image to be binarized % BW: binarized image BW = binarization(I, 121, 0.34, 'sauvola'); %Remove largest component CC = bwconncomp(~BW); numPixels = cellfun(@numel,CC.PixelIdxList); [~,idx]...
%% load data close all; clear all; load('train_oldfaithful.mat'); n = length(t); x = [ones(n,1) , x]; % represent bias as w_0 -> need 1st column = 1 %% plot data with color figure() subplot(1,3,1) axis equal hold on; colormap(winter) scatter(x(:,2),x(:,3),[],t) %% plot seperating line as well % a + bx + cy = 0 % cy = ...
function result = ex_FreeViewPic(e) % ex file: ex_FreeViewPic % % Active fixation tasks for any stimuli % % XML REQUIREMENTS % runline: a list of strings which correspond to other parameter names. % This list of names is used to construct the custom set command to the % slave % NAMES: all the parameters listed in r...
function run_wake_simulation(paths, modelling_inputs, ow_behaviour, stl_flag) % Takes the geometry specification, adds the setup for a wake simulation and % runs a wake field simulation with the desired calculational precision. % % paths (structure) : Contains all the paths and file locations. % modelling_inputs (struc...
function [para] = px_spm8_convert(fdp,para) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % FORMAT px_spm8_convert(fdp,para) % %%FORMAT px_spm8_convert(ip,op,idt,ht,dt) % fdp.scan full data path, e.g. ip = '/Volume/DataRaw/Sub001/*.dcm'; % para.op output data path, e.g. ...
GENERATORS = [[1 0 1]' [1 1 1]']; code_rate = 1/2; NUM_BITS = 10; % Generate some random bits full_bits = randn(1, NUM_BITS) > 0; fprintf('Input Bits:\t'); disp(full_bits); fprintf('====================================================\n') encoded_bits = encode(full_bits, GENERATORS); fprintf('Encoded Bit...
function p = depth2pressure(d,latitude) % p = depth2pressure(d,latitude) % Convert depth (in meters) to pressure in Pascals. % d is depth in m % latitude in degrees % Returns: % p is the pressure in Pa % % Based on the Leroy and Parthiot (1998) formula. See: % http://resource.npl.co.uk/...
#! /bin/octave -qf m = scanf("%d", 1); n = scanf("%d", 1); A = zeros(m, n); b = xb = zeros(m, 1); c = zeros(1, n); global base = zeros(m, 1); global is_base = zeros(n, 1); for j = 1:n c(j) = scanf("%f", 1); endfor for i = 1:m for j = 1:n A(i, j) = scanf("%f", 1); endfor endfor for i = 1:m b(i) =...
function plotDMC_caf(res) % plotDMC_caf(res) numBins = size(res.caf, 2); hold on, box on plot(1:numBins, res.caf(1, :), '-og', 1:numBins, res.caf(2, :), '-or') xlim([0.5 numBins+0.5]); ylim([0 1.1]); xlabel('RT Bin'), ylabel('CAF') xticks(1:numBins) legend('Comp', 'Incomp', 'Location', 'southeast')
function status = Xu2DPmatrixFromCalPhantom_ver2(config_pmatrix_name,config_fbp_name,s_date) if nargin == 2 s_date = []; else end status = 0; %% pmatrix_para = XuReadJsonc(config_pmatrix_name); N_bbs = pmatrix_para.NumberOfBBs;% number of bbs in the phantom delta_theta = pmatrix_para.AngularInterval;%estimated a...
% script to perform soft fits to traces using existing HMM parameters clear close all % ID variables % project = '20190514_eveBAC2spot'; project = '20190613_eveGtMut_eS1'; dataPath = ['../dat/' project '/']; figPath = ['../fig/' project '/']; mkdir(figPath); % load trace data load([dataPath 'nucleus_struct.mat']) % lo...
function [data_features,im_r,im_c] = read_data(input_file) pixel_data = imread(input_file); % Split r,g,b planes of the image [im_r,im_c,im_l] = size(pixel_data); % Linearize image data data_features = reshape(pixel_data,[im_r*im_c,im_l]); end
ngname1 = 'comp.windows.x'; ngname2 = 'comp.graphics'; load_20nggeneral;
%% Cleanup close all clc %% labelFontSize = 20; ticksFontSize = 20; lineWidth = 4; % feature('locale') %% % Variables' names: var_name_list = {'P upstream (bar)',... % 1 'P downstream (bar)',... % 2 'W (kg/h)',... % 3 'Reg...
function [rtilde] = mfun(r,A_sym,ms,m) %mfun %This function takes as input r (which pcg sends in) %and outputs r ?; hence, affects the solving Mr ?=r without %knowing M, by taking one iteration of this symmetric-Gauss Siedel method %on original matrix system Ar ?=r with initial guess r ?^0=0 % Detailed explanatio...
% This code reproduces the analyses in the paper % Urai AE, Braun A, Donner THD (2016) Pupil-linked arousal is driven % by decision uncertainty and alters serial choice bias. % % Permission is hereby granted, free of charge, to any person obtaining a % copy of this software and associated documentation files (...
function sl_customization(cm) cm.ExtModeTransports.add('lrt.tlc', 'serial', 'ext_serial_win32_comm', 'Level1'); end
% pConservedInteractionList(Search,SubsProb) returns a cell array of % conserved pairwise interactions. When SubsProb = 1, it appends a % list of substitution probabilities. function [Text] = pConservedInteractionList(Search,SubsProb,Verbose) if nargin < 3, Verbose = 0; end [i,j,k] = find(triu(Search.Edge)); ...
function [negL,delta] = NegLogLik(data_avgd_f,num_samples,data_dim,order,subsets,lambda) % MaxEnt log likelihood of data using parameters lambda % assumes data is the output of f applied to a data matrix num_patterns = 2^data_dim; % calculate Z and dist_avgd_f Z = 0; dist_avgd_f = 0; for i = 1:num_patterns % can thi...
% Kelvin Zhang, Arvind Ganesh, February 2011. % Questions? zhangzdfaint@gmail.com, abalasu2@illinois.edu % % Copyright: Perception and Decision Laboratory, University of Illinois, Urbana-Champaign % Microsoft Research Asia, Beijing % % Reference: TILT: Transform Invariant Low-rank Textures % Zh...
classdef desktop % % Class: % sl.ml.desktop % % desktop = com.mathworks.mde.desk.MLDesktop.getInstance; % http://www.mathworks.com/matlabcentral/newsreader/view_thread/155225 % http://www.mathworks.com/matlabcentral/fileexchange/16650-setfigdockgroup properties end ...
clear all; close all; [images, labels] = getMNISTdata(); % gets images and labels close; net = alexnet; inputSize = net.Layers(1).InputSize; %for i = 1:length(images) for i = 1:200 disp(i) img = images(:,i); resizeFactor = inputSize(1)/length(img)^0.5; img = reshape(img, 28, 28); img ...
% siec z bloku simulinka gensim(net, 0.001); x = [0;0;0;0;5;0]; y = 0; sim('ssn_neural_network_test_simulink_vs_matlab.slx') % siec z workspace matlaba 'net' z = ssn_simulate(0,0,0,0,5,0);
function [step] = final(soln, loads, material, geom, step, tt, cohesive) % Given converged solution, including Fourier coefficients sk, the average particle stress % Sigma_p and the interfacial strain Eps_int, this routine calculates displacements, stresses, % strains, cohesive tractions and cohesive damage %disp...
%% Illustration of 3D PCA % This code illustrates PCA for a 'toy' example. % PCA gives a way to approximate an N-point vector % by an M-point vector with M < N. %% Make data for example L = 200; % number of data points % generate data for example C = [1 2 -1; 2 2 1; -2 0 2]; X = C * randn(3,L); % display data plo...