text
stringlengths
8
6.12M
function [res, strTrials, Events2plotDelay]=getPeriEventHist( generalProperty, imagingData, BehaveData) % extract behavioral data stats % [labels, examinedInds, eventsStr, labelsLUT] = getLabels4clusteringFromEventslist(BehaveData, ... % generalProperty.labels2cluster, generalProperty.includeOmissions); Events2plo...
% Calculate area average PDSI and Fractional Area in Drought. % THIS VERSION: Calculate these time series over entire Mediterranean % domain %% Start Clean clear all close all clc % New OWDA Version map_txt2='MED_1'; % If 1, save figure to eps file save_figure=1; %% Parameters % Temporal yr_range=[1100 2012]'; %...
function results = compute_trackplacement( ... config, show, results, num_tracks ) if nargin < 4 num_tracks = length(show.indexes)+1; end % compute the placement of the tracks and evaulate our performance [~, best_begin] = find_tracks( ... num_tracks, show.CostMatrix ); resu...
% Task %dimensions (choose between 2 or 10) d = 10; % d= 2; % set a parameter a = 0.25; % set b parameter, choose either 2 or 10 dimensions %b = [1;1]; %c = [4;4]; b = [1;1;1;1;1;1;1;1;1;1]; c = [4;4;4;4;4;4;4;4;4;4]; % genereate one set of test and train examples examples. [x_values, y_values] = data_generator(400...
% This is just counting up totals for gender, ages, and preferences of piece based on the %variables specific to our study survey = cell2mat(QuestionnaireDataFINAL(2:end,12:14)); subject = QuestionnaireDataFINAL(2:end,1); SEX = LogSheetFINAL(2:end,4); male = strcmp(SEX,'M'); SEX_temp(male) = 1;female = strcmp(SEX,'...
function [sssLRI] = lri(data,period) % Function to calculate the linear regression indicator of a data set. % (The end point of the regression not the slope) % 'data' is the vector to operate on. The first element is assumed to be % the oldest data. % 'period' is the number of periods over which to calculate the ...
function EDB2plotpath(eddatafile,reflpathsfile,plotoptions) % EDB2plotpath - Plots a model which is given in an eddatafile % and one or more of the paths in an edreflpathsfile. % % Input parameters: % eddatafile The input file. % reflpathsfile The file with reflpaths. % plotoptions The row in the reflp...
function [filterResponse] = extractFilterResponse(img, LoG) %Using replicate filter method %to avoid false blob detection at the outer pixels filterResponse = imfilter(img, LoG, 'replicate');
function [xshifts, yshifts, correlation_thresholds] = ... track_subpixel_wholeframe_motion_varythresh(... movref, refframe, maxshift, correlation_threshold, min_samples, showFigures) %[xshifts,yshifts]=track_subpixel_wholeframe_motion(movref,refframenum,maxshift); %find the offsets (xshifts,yshifts) of the movi...
function [Fet, nFeatures] = LoadFetSubset(FileName,Subset) % [Fet, nFeatures] = LoadFetSubset(FileName,Subset) % % A simple matlab function to load a .fet file % [BufSize, Subset] = DefaultArgs(varargin,{inf, []}); BufSize = inf; if ~exist('Subset','var') Subset = []; end Fp = fopen(FileName, 'r'); if Fp==-1 ...
function res = SM(x1, x2) id1 = (x1 ~= 0); id2 = (x2 ~= 0); % res = sum(id1 & id2) / sum(id1 | id2); res = 100*sum(~xor(x1 ~= 0, x2 ~= 0))/numel(x1); % res = sum(id1 & id2);% / numel(x1); end
% clear % pd1=makedist('Normal'); pd2=makedist('Normal'); pduni=makedist('Uniform'); % % DEFINE DOMAIN AND GRID % IN A REAL APPLICATION, this comes from outside % UNITS: m % NX = # of grid lines; (NX-1) is the number of cells % NY = same in y-dir % NX=57; NY=57; XMAX=200.0; XMIN=0.0; YMAX=200.0; YMIN=0.0; DX=(XMAX-XMIN...
function [mt_cov, p_obs, T, p_obs_un] = ... create_emission_for_chunks(rho, rho_er, self_transition, mt_seq, ... er_seq, varargin) % Create emission structure for chunks. % Create probability of observation and movement time covariances % according to chunk. % % Parameters: % rho : correlation within...
%% clean up if exist( 'gds_interface', 'var' ) % turn off if running try gds_interface.StopDataAcquisition(); catch end delete( gds_interface ); clear gds_interface; end restoredefaultpath CloseMaster disp( mfilename('fullpath') ); experiment.number = 2; %% options options.resetPort = true...
function score = simulate_ida(w,b1,rewards,next_state) % in addition to parameter values, simulate ida takes in next_state % and rewards cell arrays % index i in next-state vector provides the state to which i leads % rewards provide the reward at states 5 and 6 % both are cell arrays. index 1 of cell is training ph...
% ADVISOR Data file: FC_TT_FC.M % % Data source: % % Data confidence level: % % Notes: This file can be used to define a fuel cell powerplant % based on technical targets. DO NOT EDIT THIS FILE!!! % % Created on: 02/17/99 % By: Tony Markel, National Renewable Energy Laboratory, Tony_Markel@nrel.gov % % Revisio...
function xmuestart = Eddington() % use accept-reject method func = @(mu) 5/2.*(2/5+3/5.*mu).*mu; number_samples = 1; accepted_samples = zeros(1,number_samples); k = 0; l = 1; while k < number_samples X = accept_reject(func); if length(X) > 0 xmuestart = X; ...
function [ nb ] = get_nb_elets( tab ) %UNTITLED Summary of this function goes here % Detailed explanation goes here nb = 0; for i = 1 : length(tab) if tab(i) ~= 0 nb = nb + 1 ; end end end
function result = get_class_index(dataset, class_id) indices = find(dataset.training.class_ids == class_id); if (numel(indices) ~= 1) error(sprintf('error in get_class_index: %d class indices found', numel(indices))); end result = indices(1);
%solve_pdat solve a cuter problem specified in a pdat struct % % Usage: % slv = solve_pdat(pdat,options,io_opt) % % Input: % pdat = problem specification structure % options = solver options structure % io_opt = input/output options structure % % io_opt fields: % print_flag = 1 for simple print to screen, 0 ...
function SuppFigure3A(flyResp,stimulusInfo,general_parameters) % This function plots the data in Supp Figure 3A of Agrochao, Tanaka et al. % (2020) Mechanism for analogous illusory motion perception in flies and % humans. margarida.agrochao@yale.edu % The input flyResp has dimensions (number of cell types x number of ...
function [sigEV, sigIV]=generate_signal(p,storedPhase,varargin) q=inputParser; addParameter(q,'TE',p.TE,@isnumeric); %target echo time addParameter(q,'Y',p.Y(end),@isnumeric); %target blood oxygen saturation addParameter(q,'Hct',p.Hct,@isnumeric); %target haematocrit addParameter(q,'permeable',false,@islogical); ...
function s=border_detect_resize_32_20(i) %i=im2double(i); b=sum((1-i).^2,3); st = regionprops( double( b > .5 ), 'BoundingBox' ); if(st.BoundingBox) rect = st.BoundingBox; s=imcrop(i,rect); end s=imresize(s,[32 20]); end
function plotCut(matrixI,frames,timeUnit) blank = questdlg('Please select a directory (or make a new one) in which to save all traces',... 'Select Directory','Ok','Ok'); saveDir = uigetdir; if ismac slash = '/'; else slash = '\'; end goOn = 1; i = 1; timeSeries = ...
function Mk = efc_delayMin( C, T_max, gamma, K ) l = 1; DL = gamma(2,:); Mk = ones(K,1) * 1 / T_max; CB = C - sum(Mk); while CB > 0 if CB >= K * (DL(l+1)-DL(l)) Mk(:,1) = Mk(:,1) + (DL(l+1)-DL(l)); CB = CB - K * (DL(l+1)-DL(l)); l = l + 1; els...
function x = populate( ) % populate Define input arguments for IRIS functions and store them in irisinp.parser.Container. % % Backend IRIS function. % No help provided. % -IRIS Macroeconomic Modeling Toolbox. % -Copyright (c) 2007-2014 IRIS Solutions Team. %-----------------------------------------------------------...
function [out] = l_OR(in_dat) %L_OR Summary of this function goes here % Detailed explanation goes here out = 0; for i=1:length(in_dat) out = out|in_dat(i); end end
function startup() % genPath = {'piotr-structured-edges-pami', 'rgbdutils', 'utils'}; addPath = {'nyu-hooks', 'scripts', 'mcg', 'utils', 'caffe/matlab/caffe/', 'rgbdutils'}; genPath = {'structured-edges', 'rcnn'}; for i = 1:length(addPath), addpath(addPath{i}); end for i = 1:length(genPath), addpa...
function scans_to_process = LONG_smooth_images( scans_to_process,prefix, fwhm) %LONG_smooth_imagese - smooth change images before stats % % Syntax: scans_to_process = LONG_smooth_changemaps( scans_to_process) % % Inputs: scans_to_process - array of objects of class LONG_participant % prefix - prefix for fi...
function Merge_params %Merge multiple parameters file global DataSave global ParamsSave global recobj global sobj % file info, select .mat file if exist('dirname', 'var') [dirname, ~, ext, fsuf, ~] = Get_File_Name(dirname); else [dirname, ~, ext, fsuf, ~] = Get_File_Name([]); end %% files = subdir(fullfile(d...
function [cx,cy] = ENO_Interpolation_Setup (Order, dx, dy) cx = zeros(1,Order+1); cy = zeros(1,Order+1); for n = 1:Order+1 cx(n) = (n-1)*dx; cy(n) = (n-1)*dy; end
function varargout=atx(ring,varargin) %ATX computes and displays global information % %BEAMDATA=ATX(RING,DPP,REFPTS) % %RING: AT structure %DPP: relative energy deviation (default: 0) %REFPTS: Index of elements (default: 1:length(ring)) % %BEAMDATA is a MATLAB structure array with fields % % From atlinopt: % % ...
function [compressed_image] = compression(image, Z) compressed_image = zeros(size(image)); % This works only for square images intervals = (0:8:size(image)) + 1; for i = 1:(size(intervals')-1) for j = 1:(size(intervals')-1) current_x = intervals(i):(intervals(...
%% RUN THE MARKOV MODEL transitions = [0,0.1:0.05:0.65,0.75:0.05:0.9,1]; lookahead = 1:20; tic; for l = 1:max(size(lookahead)) for t = 1:max(size(transitions)) global exp_payoff_minzoo global exp_payoff_maxzoo global exp_payoffs exp_payoffs = ones(140,6...
% Copyright is with the following author(s): % % (c) 2011 Juraj Oravec, Slovak University of Technology in Bratislava, % juraj.oravec@stuba.sk % (c) 2011 Monika Bakosova, Slovak University of Technology in Bratislava, % monika.bakosova@stuba.sk % -------------------------------------------------------------------------...
function [ CSTAdMat CSThresh] = CST(M) % Function computes the Cluster-Span Threshold of a complete weighted % adjacency matrix % % INPUT: M - M complete weighted adjacency matrix for the network % % OUTPUT: CSTAdMat - The binary network from the Cluster-Span Threshold % % A = (sort(M(:))); for i = 1:...
function [beta0,Eevol] = initialize_active_contour(Sinit,Sprior) I=Sinit.I; % Log-transformed image T=Sinit.T; scalefac=Sinit.scalefac; cmax=Sinit.cmax; nrow=Sinit.nrow; switch Sinit.type case 'manual' % Initialize as hand segmentations via imfreehand [~,beta0]=hand_segment(exp(I...
function [ status, messages ] = op_PSDiffusion( data_handle, option, varargin ) % OP_PSDiffusion fit 1D gaussian over time % 1D gaussians are fitted to line scan at the point source % Parameters DT vs T are extracted from the gaussian fits % Robust linear fit is applied to find the gradiant of DT/T => D % Appli...
function [t_fd,lat,lon] = getFlightData(fn,year,month,day) % This function takes in: % filename % year, month, and day (beginning of the week in question). % Returns the lat, lon, and local time in second from Jan 1, 1970 load(fn) % Load the flight data sod = GPS(:,4)/1000; ...
function v = cp_R(p) % CP_R - Species non-dimensional heat capacities. % % This method returns an array containing the pure species % standard-state heat capacities at constant pressure. % v = thermo_get(p.tp_id,38);
function errorCubeV4(x_final,y_final,z_final,epsilonFinalPosition) %The purpose of this function is to generate a cube that illustrates the %permitted error window centered about the final point %x_,y_,z_final describe the final spatial postion, epsilonFinalPosition is %the upper bound on the error %Define the 12 lin...
function p = psnr(x,y, vmax) % psnr - compute the Peack Signal to Noise Ratio % % p = psnr(x,y,vmax); % % defined by : % p = 10*log10( vmax^2 / |x-y|^2 ) % |x-y|^2 = mean( (x(:)-y(:)).^2 ) % if vmax is ommited, then % vmax = max(max(x(:)),max(y(:))) % % Copyright (c) 2004 Gabriel Peyre m1 = max...
function person = personDetectionAllFramesNoColorBack(dm, thres, kinects) %{ Compute the mask with the person using only background subtraction with depth infromation. It is used only when no blue gown or pink gloves available. It needs a first frame with the person far from the doctor location. In...
clear; close all; % clc; Copy_of_test_synthdata; lambda = [1e-4, 1e-3, 1e-2, 1e-1, 1, 10, 100]; mu = [0.1, 1, 10, 100, 1e3, 1e4, 1e6]; % lambda = [0.001, 1]; % mu = 1e3; Nl = length(lambda); Nm = length(mu); E_rec = zeros(length(mu), length(lambda)); O_rec = zeros(length(mu), length(lambda)); Full_rec = zeros(leng...
function error = error_norm(param, sigma, N0, Nf, tf) P = num2cell(param); [g_mu] = deal(P{:}); % our parameters a & b cell_growth_rates = normrnd(g_mu,sigma,N0,1); N_cells = ones(N0,1); for j = 1:length(cell_growth_rates) N_cells(j,1)= exp(cell_growth_rates(j).*tf); end sum_Ncells= sum(N_cells); error = (sum...
function logger = simulate(obj, t0, x0, tf, options, varargin) % Simulate the hybrid dynamical system % % Parameters: % t0: the starting time @type double % x0: the initial condition states @type colvec % tf: the terminating time @type double % options: the ODE options @type struct % va...
function [ cf,rgma ] = STORM( ap,rga,rgo,coor,ut,doy ) %STORM foF2 storm-time correction factor % % SUBROUTINE STORM(ap,rga,rgo,coor,rgma,ut,doy,cf) %---------------------------------------------------------------------- % Fortran code to obtain the foF2 storm-time correction factor at % a given locatio...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Numerische Mathematik fuer Physik und Ingenieurwissenschaften 2020 %%% %%% Programmierabgaben (Praktischer Teil des Uebungungsblattes) %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ...
function [a1,ax,ay,w] = est_tps(ctr_pts, target_value) [r,c] = size(ctr_pts); % derive K K_inter = subtract(ctr_pts,ctr_pts); %disp('K_inter size'); %disp(size(K_inter)); K = U(K_inter); %K(isinf(K)) = 0; K(isnan(K)) = 1; K(K==0) = 1; %disp('K size'); %disp(size(K)); % derive P col = ones(r,1); P = [ctr_pts col]; % der...
function fitlinreg(X,varargin) %FITLINREG Fit regression line to points. % %F = FITLINREG(X) returns a function F such that y = F(x) are the %y-coordinates of in the regression line. %F = FITLINREG(X,'PARAM1','PARAM2',...) specifies one or more of the %following paramaters: % Name Value Explanation % 'showcoef...
function [ locs1, locs2] = matchPics( I1, I2 ) %MATCHPICS Extract features, obtain their descriptors, and match them! warning off; %% Convert images to grayscale, if necessary [i1_rows, i1_cols, i1_channels] = size(I1); [i2_rows, i2_cols, i2_channels] = size(I2); if i1_channels == 3 im1_gray = rgb2gray(I1); else ...
x = input('Give me a number, buddy: ') a = x + 1; fprintf('Hello World') n = 5; price = 2.71; total = n * price; fprintf('%d item at %.2f each \nTotal = $%5.2f\n', n, price, total); fprintf('%d a, %d b, %d c', a, b, c); fprintf('%d a, %d b, %d c', a, b); fprintf('%d a, %d b, %d c', a, b, c, d);
clc clear all; %close all; %Start by generating the trajectory with inputs: final position in 3-space, %the number of discretization steps, and the function type %The function type is a power law scaling with the parameter worldParams = getWorldParams(); myDir = pwd; idcs = strfind(myDir,filesep); topDir = myDir(1...
function [ret] = pcz_persist_display_status(persist,msg) %% Script pcz_persist_display_status % % file: pcz_persist_display_status.m % author: Peter Polcz <ppolcz@gmail.com> % % Created on 2017.08.25. Friday, 12:21:36 % %% if isfield(persist, 'file') pcz_dispFunction('Persistence for `%s` %s [run ID: %d, %s]'...
% Calculate forward kinematics (homogenous transformation matrices) for fixed-base % %RN% (for one body) % Use Code from Maple symbolic Code Generation % % Input: % %INPUT_QJ% % link_index [1x1 uint8] % index of the body frame to be returned (0=base). % %INPUT_PKIN% % % Output: % Tc_mdh [4x4] % homogenous transfo...
function output = std_median(input) output = sqrt( nansum( power( abs(input - median(input,'omitnan')),2 )) / (length(input(~isnan(input)))-1) );
conn = database.ODBCConnection('himanshu','himanshu','123'); if(isempty(conn.Message)) disp('Database connected') else disp('Cannot connect') disp(conn.Message) return; end curs = exec(conn,'SELECT * FROM last'); curs = fetch(curs); disp(conn.Message) data = get(curs,'Data'); display(data); close...
%% モデルの回転平行移動量の乱数生成 % 各モデルについて number 個ずつ乱数生成 % 生成結果をそのままプログラムにコピペできるように整えてコマンドウィンドウに表示 % % 入力 : Models / 3次元ボクセルモデルのセル配列 % Number / いくつ乱数を生成したいか % % 出力 : 3次元空間からモデルがはみ出さない回転平行移動量 % % %% function [RotAzis, RotEles, Translation] = RotationTranslation(Models,Number) %%% セル配列じゃなかったら場合 if not(iscell(Models)) ...
function [ runtime ] = phase_1_function(N,M) addpath('munkres') R = 0.5; max_v = 1; t0 = 0; max_allow_dist = 2*R*sqrt(2); dist_scale = max_allow_dist*N; full_points = zeros(2*N,2); full_points(1,:) = rand(1,2)*dist_scale; for i = 2:2*N seed_flag = true; pull_vect = full_points(1:i-1,:); while seed_fl...
function [index_removal index_shift] = get_shifting_vectors(Kmin, Kmax, k_dim, a_dim, n, combs, non_null_lin_indices, full_to_reduced_map, sys_dims_single_state) % Index shifters index_shift = cell(n,n); % each index (k,a1,..,an) of a tensor has a corresponding decomposed linear index % j(i). The question is wh...
%% AUTHOR: OLUWASEGUN SOMEFUN: <oasomefun@futa.edu.ng> (c.) 2020 % Please, Retain this Copyright Information in any Customization, Modification or % Redistribution %% Customize as it fits your purpose % Live Serial DAQ Plotting script for Arduino-Matlab Interfacing %% VERSION 1.0 -> 01.26.2020. % % Visualizes real-time...
function [ CC, RateA, RateB ] = CorrCoefYG( SpikeTrainA, SpikeTrainB, kernel, time_series ) %UNTITLED Summary of this function goes here % Detailed explanation goes here % % SpikeTrainA/B is two sparse logical row vectors, coloumn index is time step % [0 0 1 1 1 0 1 0 0 0; % 1 0 0 0 0 0 1 0 0 0] % % Kernel is row ve...
function repref_drawRecognition2way(window, color_text, color_left, color_right, imageLocs) %% draw 2 circles above image Screen('FillOval', window, color_left, imageLocs.circle_dfarleft); Screen('FillOval', window, color_right, imageLocs.circle_dfarright); %% draw text labels Screen('TextFont', window,...
clear load('mseqAM_150_bits10.mat'); fs = 48828; [Tones_f, ERBspace] = Get_Tones(8,2,1500,8000); tone_freq = Tones_f(1:8); stim = mseq_tone_coherence(tone_freq,fs,mseqAM); t = 0:1/fs:length(stim)/fs-1/fs; figure,plot(t,stim); soundsc(stim,fs);
add_base_paths; default name = ['piecewise-quadratic']; default n = 256; % nbr vertex default m = 800; metric = 'hessian'; metric = 'structure'; displist = []; ntests = 8; sigma_structure = 12*n/512; alpha_list = linspace(2,4,ntests); epsilon_list = linspace(1e-5,1e-2,ntests); use_lloyd = 1; err = zeros(nte...
%% Init clear, clc, close all %% List Availables Serial-Ports device = "usbmodem"; [status,cmdout] = system('ls /dev/tty.*'); devices = split(string(cmdout),'/dev/'); for i = 1 : length(devices) if (devices(i) ~= "") res = strfind(devices(i),device); if(~isempty(res)) device = "/dev/"...
function dy = simple_pendulum_deriv(t,x) global k m M g l dy=zeros(4,1); mu=m/(m+M);Kappa=k/(m+M); dy(1) = x(2); dy(2) = (mu*l*x(4)*x(4)*sin(x(3))+mu*g*sin(x(3))*cos(x(3))-Kappa*x(1))/(1-mu*cos(x(3))*cos(x(3))); dy(3) = x(4); dy(4) = (-mu*x(4)*x(4)*sin(x(3))*cos(x(3))+Kappa/l*x(1)*cos(x(3))-g/l*sin(x(3)))/(1-m...
% clear all; FEATURE_DIR='../dataset/zalando/tps/women_top/'; DATA_ROOT='../dataset/zalando/women_top/'; SEG_DIR='../dataset/zalando/segment/women_top/'; file_ind all_images = textscan(fopen(sprintf('../LIP_SSL/human/list/zalando_%02d', file_ind)), '%s\n'); all_images = all_images{1}; n_control = 10; h = 256/2 w = 192...
function func2(x) sqrt(x)
%Seyit Yiğit SIZLAYAN / 1876861 %%INIT clc; % close all; haptic_experiment; N = length(angPos); % Number of samples % z = [angPos';gyro_angVel']; % Measured signal angPos = angPos - mean(angPos); % around zero r = 0.3; %m xPedal = r*sind(angPos); xPedalDot = r.*cosd(angPos).*gyro_angVel; X_hat=zeros(3,N); % State Es...
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % loadRoundModel.m %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Function that load a model of the round length: % % T_round(B) = T_per_round + B * T_per_slot % % The model can be calibrated very precisely for a given implementation of % TTW. ...
%% Problem Set 1 % Ian Doarn / % Problem Set 1 / % 8-31-2017 / %% Problem 1 % % a) $\frac{\sqrt{41^2-5.2^2}}{e^5-100.53}$ % % b) $\sqrt[3]{136}+\frac{ln\left(300\right)}{8}$ disp("a) " + (sqrt(41^2-5.2^2))/(exp(5)-100.53)); disp("b) " + (nthroot(3, 136) + (log(300)/8))); %% Problem 2 % % a) $cos\left(\frac{7\pi }{9}...
function plotRF( obj,varargin ) params.trace_opt = 17; params = getParams(params,varargin); keys = fetch(obj); for ikey = 1:length(keys) key = keys(ikey) key.trace_opt = params.trace_opt; cluster = fetch1(RFMap(key,'rf_opt_num=6 and masknum = 1'),'on_rf'); [v1o,v2o,v1i,v2i] = fetch1(StatArea(key),'...
list = dir('Air-Gap'); powernum = 12; numFiles = length(list); dataFolders = zeros(1,numFiles); for i = 1:numFiles dataFolders(i) = contains(list(i).name,'2017'); end fileCount = 1:numFiles; goodfiles = sum(dataFolders); fileNum = fileCount(logical(dataFolders)); hdpe = 0; macor = 0; ecco = 0; for k = 1:16 for...
function shMUpd(h, M) % Show matrix in 2-D space. % % Input % h - figure handle % F - image, h x w % % History % create - Feng Zhou (zhfe99@gmail.com), 12-29-2008 % modify - Feng Zhou (zhfe99@gmail.com), 10-09-2011 set(h.M, 'CData', M);
function [ mesh ] = read_mesh_file( N, type, casename ) %READ_MESH_FILE Summary of this function goes here % Detailed explanation goes here % 读取二维几何网格 switch type case ndg_lib.std_cell_type.Tri cell = ndg_lib.std_cell.tri(N); mesh = ndg_lib.mesh.tri_mesh(cell, 'file', casename); case ndg_lib....
function [c, d] = fprintf(this, fileName, varargin) % fprintf Write VAR model as formatted model code to text file. % % Syntax % ======= % % [c, d] = fprintf(v, fileName, ...) % % % Input arguments % ================ % % * `v` [ VAR ] - VAR object that will be printed to a model file. % % * `fileName` [ char | cel...
function [y,Fs] = Wavereader(file) % [y,Fs] = Wavereader(file) % Inputs: % file = file name for wav file % Outputs: % y = time series of wav file % Fs = sampling rate of wav file % Info: % By: Matthew Luu % Last Edit: 8/16/2021 % wav file reader to display properties a...
function out = sbxRemoveEdges() %UNTITLED2 Summary of this function goes here % Detailed explanation goes here % Left, right, top bottom out = [50, 70, 5, 5]; end
function y=sphsur(n,m,phi,theta) % SPHSUR calculates the spherical surface function? Kugelflaechenfunktion % % function y=sphsur(n,m,phi,theta) % % p=legendre(n,cos(theta)) m=abs(m); p(m+1) y = sqrt((2*n+1)/(4*pi)*fac(n-m)/fac(n+m))*p(m+1)*exp(i*m*phi); return end 
function opts = init_MSLapSRN_opts(scales, depth, recursive, gpu) % ------------------------------------------------------------------------- % Description: % Generate all options for MS-LapSRN % % Input: % - scale : SR upsampling scale % - depth : number of conv layers in one pyramid level % ...
%Aziza Hayupratiwi - 1301150440 %fungsi ini tidak memperbarui centroid %karena data uji menggunakan hasil centroid terbaik dari data train function [centroid,cluster] = function_kMeansUji(data, centroid) %membuat matriks datax1 cluster yang berisi 0 %jika cluster ditaruh pada main menu, matriks yg dihas...
function y = ten3(N) n= 1:500; sig=sin(0.3*pi*n) + sin(0.7*pi*n); sig1=conv(sig,ten2(N,1)); %hamming sig4=conv(sig,ten2(N,4)); %bartlett sig5=conv(sig,ten2(N,5)); %SQUARE subplot(4,2,1); plot(sig); title("original signal"); subplot(4,2,2); plot(abs(fftshift(fft(sig,1000)))); ...
clear all; % ------------------------------------------------------------------------- % Description: % Script to demo MS-LapSRN for one image % % Citation: % Fast and Accurate Image Super-Resolution with Deep Laplacian Pyramid Networks % Wei-Sheng Lai, Jia-Bin Huang, Narendra Ahuja, and Ming-Hsu...
sEEG=[];cEEG=[];rcEEG=[];ciEEG=[];rciEEG=[];fwsEEG=[];fwrsEEG=[]; fsEEG=[];frsEEG=[];fiEEG=[];friEEG=[]; clear Feature* rFeature* iEEG=[];fwriEEG=[]; rsEEG=[]; riEEG=[];fwiEEG=[]; sy=[]; iy=[]; rsy=[]; riy=[]; Rs=[];Rrs=[]; spike=[]; Ws=[];Nwls=[];Wsr=[];Ns=[];Nr=[];s=[];r=[]; Wr=[];Nwrls=[];Wrs=[];nI=[];nR=[]; schanne...
% computes a clustering solution total cost function cost = compute_cost_pc(points, centroids) cost = 0; % compute clustering solution cost NP = length(points(:,1)); NC = length(centroids(:,1)); for p = 1:NP % distance to point from each centroid d = distance(repmat(points(p,:), NC , 1),...
% calculate rate of HCO + O2 -> CO + HO2 % Updated 7/14/06 AEP % Based on JPL Data Evaluation #15 % rate=kO2HCO(T,M) function j=kO2HCO(T,M) j=5.2e-12.*exp(0../T);
function [nb,kpdf,lnpdf,segL] = burstDurHistHMM(dataX,fsamp,bins,minbs,winmark,burstinds,dataC) dataX = decimate(dataX,5); XH = (abs(hilbert(dataX))); if nargin>6 dataC = decimate(dataC,5); end fsamp = fsamp/5; %% Resample WinMark winMarkInds = ceil(find(winmark)/5); %these are the transitions winMarkRS = zeros(size...
function CalculateCNNFeature() %========================================================================== % usage: calculate the CNN feature given the image directory % % inputs % rt_img_dir -image database root path % rt_data_dir -feature database root path % % outputs % database -directory for the calculat...
clear all; clc %% Testing extract_v3 with multiple sets of artificial data generated by %% synthesize and calculating the covariance matrix. Results are compared %% to the analytical calculation of the covariance matrix. % Forming column vectors x and t. All t0's < tstart and t1's > tfinal. t0_1=0 ; t1_1=10 ...
function chirpfr4(fr,n,samp,fr_end,t_n) #plot the correlation values of template and signal at various phases #noise added is 0.1*max of the template #{ fr - template fr, n - duration of the signal, samp - sampling frequency, fr_end - end frequency, k - increase in fr per sample of chirp signal, k= (fr_end-...
function spc_maxProc_offLine global spc; global gui; page = str2double(get(gui.spc.spc_main.spc_page, 'String')); if isempty(page) page = 1; end spc.page = page; %Calculate just current Channel. stack_project = []; for i = 1:length(spc.stack.image1) stack_project = [stack_project, reshape(sum(spc.stack.image1...
clear; block_dim = 6; a = randi(10,[block_dim,block_dim]); a = a'*a; b = a+a; A = zeros(block_dim*11,block_dim*11); for i = 0:10 if(i == 0) A(1:block_dim,1:block_dim) = a; continue; end A(1+(i*6):1+(i*6)+5, 1+(i*6):1+(i*6)+5) = b; if(i>0) A(1+(i*6):1+(i*6)+5, 1+(i*6)-6:1+(i*6)-1...
/*! \mainpage FROST Matlab Code Documentation * * * * See also: <a href="inherits.html">Class Hierarchy</a> */
function [days, K_disc]=stima_kdiscreti(data,kspan,window,K0_disc,pnt) % % [days, K_disc] = stima_kdiscreti(data,kspan,window,K0_disc,options) % % Per ogni punto di kspan integro su una finestra, dove i parametri sono % descritti nella struttura window, e ricavo il valore del parametro di controllo k. % Trovo ...
addpath('../libsvm-3.17/matlab/'); addpath('../HMMall/HMM/'); addpath('../HMMall/KPMstats/'); addpath('../HMMall/KPMtools/'); addpath('../HMMall/netlab3.3/');
function ans = fibo_add1(C) [X,Y] = size(C); [c,len] = image_row(C,X,Y); c = uint64(c); l = uint64(1:len); c = c .* l; sum = 0; for j = 1:len sum = sum + c(j); c(j) = c(j) + sum; end p = uint64(len:-1:1); sum = 0; c = c .* p; c = mod(c,256); for j = len:-1:1 sum = sum + c(j); c(j) = c(...
%function [ current ] = rtd_current( AV ) clear; clc; close all; q =1.602e-19; um = 1e-6; nm = 1e-9; eV = 1.6*10^-19; hbar =1.0545718e-34; me = 9.110e-31; h = hbar*2*pi; um = 1e-6; nm = 1e-9; me = 0.063*me; %me = 0.0919*me; kB = 1.38 *1e-23; left_contact_width = 5; right_contact_width = 5; barrier_width = 2; gap_wid...
function [x] = SST(A, b) % determinarea dimensiunilor matricei [n m] = size(A); % calcularea ultimului element din vectorul solutie x(m) = double(b(m)) / A(m, m); % structura repetitiva in care se calculeaza restul vectorului x for j = m - 1 : -1 : 1 s = 0; % suma solutiilor care deja sunt stiute (d...
function Dates = find(X,Func) % find Find dates at which tseries observations are non-zero or true. % % Syntax % ======= % % Dates = find(X) % Dates = find(X,Func) % % Input arguments % ================ % % * `X` [ tseries ] - Input tseries object. % % * `Func` [ @all | @any ] - Controls whether the output `Da...