text
stringlengths
8
6.12M
% script to test complementary output filter gain structure vel_state = 0.0; pos_state = 1.0; vel_demand = 0.0; pos_demand = 0.0; dt = 0.01; buffer_delay = 30; vel_state_history = zeros(1,10000); pos_state_history = zeros(1,10000); time = [0:dt:9999*dt]; vel_correction = 0; pos_correction = 0; omega = 1.0/(...
function [ ic ] = draw_ellipse_func( pos, ori, ellipse, res ) x = pos(1); y = pos(2); theta = ori; a_e = ellipse(1); b_e = ellipse(2); beta = linspace(0,2*pi,res)'; r = a_e*b_e./(sqrt(b_e^2*cos(beta).*cos(beta)+a_e^2*sin(beta).*sin(beta))); v = r .* cos(beta); w = r .* sin(beta); R = [cos(theta) -sin(theta); si...
function network = myclassify(data, filled) architecture = menu('Neural Network Architecture:','Associative Memory + Classifier', 'Classifier Only'); act_fun_option = menu('Type of Activation Function: ', 'Binary', 'Linear', 'Sigmoidal'); dataSet = menu('Training Data size : ', '500','750') validat...
% sim�trica clc; clear; %A = [ 4 2 2 1; 2 -3 1 1; 2 1 3 1; 1 1 1 2] % gera uma matriz sim�trica aleat�ria: % N = 5 % A = randi(10,N,N) - 1; % A = A - tril(A,-1) + triu(A,1)' A = [ 7.5431 -6.9605 5.3938 6.1428 9.0157 -6.9605 -1.3556 8.3287 -4.5111 -5.7096 5.3938 8.3287 5...
function [f, df, m, p] = energy3_2D(centers, radii, point, index, tangent_gradient, P, view_axis, rendered_data, distance_transform, gradient_directions, settings) D = settings.D; H = settings.H; W = settings.W; [~, m, dm, variables] = compute_projection_jacobian(centers, radii, tangent_gradient, point, index, P, view_...
clear clc close all % check compression and shear to meet the failure critiria n=65; t=0.0023; t_s=0.0027; h=0.116; E=73e9; L=0.5; [sigma_cri,sigma_mb,As_1]=stringer(n,t,t_s,h,E); sf=2.3108e+05; %maximun shear flow D=3; % Fuselage diameter qs=sf/(2*pi*D); % shear flow sigma_ms=qs/t; b=pi*D/n; y=KS(b,L); sigma_scri=y...
function [xyz,C,rest]=GamutColorCheck(type,varargin) %GAMUTCOLORCHECK Checks input for graphical output routines % Part of the OptProp toolbox, $Version: 2.1 $ % Author: Jerker Wågberg, More Research & DPC, Sweden % Email: ['jerker.wagberg' char(64) 'more.se'] % $Id: GamutColorCheck.m 23 2007-01-28 22:55:34Z ...
function locations = sample_grid_location(imgsz, sample_step) if(length(sample_step)==1) sample_step = [sample_step,sample_step]; end imgh = imgsz(1); imgw = imgsz(2); [x,y]= meshgrid(3:sample_step(1):imgw,3:sample_step(2):imgh); locations = [x(:),y(:)];
% This script generates the RT curves for varying parameters and % it saves results into a structure % exgauss_str = genExGaussFitVsXvar('epsilon.eps_str', 0.0:0.05:0.7, 25); % exgauss_ctx = genExGaussFitVsXvar('epsilon.eps_pfc', 0.0:0.05:0.7, 25); function exgauss = genExGaussFitVsXvar(x_var, x_range, part_num) ...
function out = binsumImage(in, bin) % TODO: evaluate omission in favor of imresize. % Rebins image by summing bin(1)xbin(2) pixels together along x and y % dimension, respectively. Starts at upper left corner. Rebinned image will % have floor(size(in)./bin) pixels. % % out = binsum(in, bin) di=0; if isa(in, 'dip_imag...
function [newclim1, newclim2]=dualcolormap(colormap1, colormap2, ax1, ax2, notaxes) % [newclim1, newclim2]=dualcolormap(colormap1, colormap2, ax1, ax2, % notaxes) % %For a two window plot, this sets a new colormap for each plot. You need %to specify the two colormaps and the two axes handles % %KIM 02/06 if nargin...
im = imread('sample.jpg'); im = uint8(im); im_out_matlab = imresize(im, 0.5); im_out_gau_skip = uint8(zeros(128,128)); gau = [1 2 1]'*[1 2 1]/16; im_out_gau = imfilter(im, gau, 'replicate', 'same'); for row_i = 1:2: 256 for col_i = 1 :2: 256 row_o = (row_i + 1)/2; col_o = (col_i + 1)/2; ...
function [post_samp,dsk] = ALDfixed(X,k,postsumm,fig,a,b,alpha,numSteps,var) %% Model-based inference of landmark locations (given fixed # of landmarks) %% Inputs % Required: % X = sample of two-dimensional curves (all curves should be re-sampled to % the same number of discretization points if they vary) % k = f...
function [RMS,SPIKES]=stan_mu_proc(DATA,FS,varargin) if nargin<2, PARAMETER_FILE=[]; end if ~isa(DATA,'double') DATA=double(DATA); end SPIKES=[]; RMS=[]; if isempty(DATA) warning('No data found...'); return; end tau=.005; nmads=10; gauss_sd=.005; param_names=who('-regexp','^[a-z]'); % parameter are all values...
% canny edge detection % gradient for canny image % stroke width detection % connected component grouping. clc; clear all; close all; I=imread('2.jpg'); imshow(I); I1=rgb2gray(I); ed=edge(I1,'canny',0.4); [gx gy]=gradient(double(ed),0.5); gm=sqrt(gx.^2+gy.^2);%计算每一点的梯度大小 gdp=atan2(gy,gx);%计算每一点的梯度方向 figure; imshow(gm)...
function [predict] = myNaiveBayes(data_train, data_class, data_test) % Naive Bayes - For continuous features % % Binary Classification: 1 positive label and 0 negative label % % Input: data_class: Training set labels, Nx1. % data_train: Training set, NxM. % Output: data_test: Test set. % % Author: William T. ...
clc clear all close all tic %img=imread('E:\Projects\uni-karshenasi\PROJECT\Documents\4_Our Code\Matlab\Test.jpg'); v = VideoReader('Test.mp4'); counter=0; while hasFrame(v) counter=counter+1; img = readFrame(v); TRL=1; TRH=1; TCL=1; TCH=1; for irow=1:1:720 for icol=1:1:1280 R=img(irow,icol,...
function[L] = getLaplacian(n,h) %[L] = getLaplacian(n,h) % if nargin==0 n = [32 32]; h = [1 1]./n; x = h/2:h:1; [X,Y] = ndgrid(x); u = cos(pi*X(:).*Y(:)); Lapu = -pi^2*(X(:).^2+Y(:).^2).*u; Lap = feval(mfilename,n,h); Laput = Lap*u; figure(1); clf; subplot(1,3...
function y = Fun_Linearization1(y0, dt, tend) t = 0:dt:tend; size1 = numel(t); y = zeros(1,size1); y(1) = y0; for i = 2:size1 y(i) = ( y(i-1) + ( 7 * (dt/2) * ( 2 - (y(i-1)/10) ) * y(i-1) ) ) / (1 + (7*y(i-1)/10)*(dt/2)) ; end
function [FeatureTimestamps, Features] = CalculateFeatures(featuresToCalc) % [FeatureTimeStamps,Features] = CalculateFeatures(featuresToCalc) % % input string list of featurenames % % output % FeatureTimeStamps = timestamps % Features = set of features MCS = MClust.GetSettings(); MCD = MClust.GetData(); nFeat = ...
function [mu] = nancirc_mean(alpha) % Wrapper for the circ_mean function, found in the Circular Statistics % Toolbox for Matlab, by By Philipp Berens, 2009 % berens@tuebingen.mpg.de - www.kyb.mpg.de/~berens/circStat.html % % Written by Andrew S Bock Jan 2015 %% Find circ_mean of non-nan values in each row m...
function y=zuisuxiajiang() clc; clear; syms x_1 x_2 x_3 x_4; fun=(x_1-1)^2+(x_3-1)^2+100*(x_2-x_1^2)^2+100*(x_4-x_3^2)^2; x=[-1.2;1;-1.2;1]; epsilon=0.001; count=0; g=gra(fun,x(1),x(2),x(3),x(4)); flag=norm(g); while (flag>=epsilon) Mini=lamb(fun,x(1),x(2),x(3),x(4)); a=x-Mini*g; f2=subs(fun,[x_1,x_2,x_3,x...
clear all close all clc addpath('../models/proprietary/R2016b/FM') addpath('..') smallDrivelineSimScape_oscSpring_flex_config model_file_name = 'smallDrivelineSimScape_oscSpring_flex'; open_system(model_file_name); %% Run conversion script rtwbuild(model_file_name) %% out = system(['python ../run.py ' model_file_n...
function [ sgolayfiltered ] = savitzkyGolayFilter( ecg_signal ) %A Savitzky–Golay filter is for the purpose of smoothing the data and it % increases the signal-to-noise ratio without greatly distorting the signal. order = 3; % order of the polynomial used for smothing framelen = 11; % frame length sgolayfiltered = sg...
% % clear % % clc % op = '/Volumes/Data/PX/TAConnect/Demo'; % dp = fullfile(op,'FunImgARCWF'); % % dp = '/Volumes/Data/PX/TAConnect/Demo/FunImgA/'; % para.op = fullfile(op,'TCMatrix');%output path of the time series .mat file. % para.mn = 'ROI264.nii'; % para.vt = 'r'; % par...
% Generate data as NxD in the Matlab style, but will tranpose it for DPMM call. % Just a few well-separated Gaussian blobs. N = 60; X1 = vertcat(mvnrnd([-10,-10], eye(2), N/3), ... mvnrnd([10,10], eye(2), N/3), ... mvnrnd([0,0], eye(2), N/3)); y = vertcat(zeros(N/3,1), ones(N/3,1), 2*ones(N/3,...
function G=melp_gain(s,vbp1,p2) % Оценивание усиления % ВХОДНЫЕ ПЕРЕМЕННЫЕ: % s - входной сигнал % vbp1 - вокализованность первой полосы % p2 - дробное значение ОТ % ВЫХОДНЫЕ ПЕРЕМЕННЫЕ: % G(1) - усиление для первого подкадра % G(2) - усиление для второго подкадра k=1; Ltmp=p2; Lfr=...
opts = spreadsheetImportOptions("NumVariables", 11); % Specify sheet and range opts.Sheet = "Sample_GENESIS"; opts.DataRange = "A4:K100"; % Specify column names and types opts.VariableNames = ["VarName1", "Date", "Day", "CourseCode", "Module", "Leads", "Leads1", "Leads2", "SessionSlot", "SessionTime", "Commen...
function crc = CRC_32_maker(data) %data_bin_size = 4 * size(data, 2); data_bin = ''; for i = 1:size(data,2) dc = dec2bin(hex2dec(data(i))); for j = 1:4-size(dc,2) dc = strcat('0', dc); end data_bin = strcat(data_bin, dc ); end %data_bin = dec2bin(hex2dec(data)) %for i = 1:data_bin_size-size(data...
%this script,load the file salesMetformin.dat %as salesMetformin.dat file has 2 row, therefor x taking 1st row and y taking %2nd row, plot it with red star and red line %labels the x and y axis with given labels %grid on load salesMetformin.dat; x=salesMetformin(1,:); y=salesMetformin(2,:); plot(x,y,'r*-') xlabel('...
% Creates a matrix of particles with velocities function velocities = ... InitializeParticleVelocities(numberOfParticles, numberOfVariables, xmin, xmax) velocities = zeros(numberOfParticles, numberOfVariables); for i = 1:numberOfParticles for j = 1:numberOfVariables velocities(i,j) = rand * (xmax - xm...
%Created by Derek Yu 7/5/2019 %Script directly averages a circle and a square % given descrete x, y values for a circle period = 1/100; %create a box x = [0:period:1, ones(1,101), 1:-period:0, zeros(1,101)]; y = [zeros(1,101), 0:period:1, ones(1,101), 1:-period:0]; %create a circle tt = (0:length(x)-1).*2*pi./lengt...
function X = sgplvmInitialiseLatentPointFromShared(model,Xs,index_out,type,N,verbose) % SGPLVMINITIALISELATENTPOINTFROMSHARED Initialise latent location given observation(s) % FORMAT % DESC Initialise latent location for given observation(s) % ARG model : sgplvm model % ARG Xs : shared latent location % ARG index_out ...
function c = colorbrew( i ) % % Nice colors taken from % http://colorbrewer2.org/ % % David Duvenaud % March 2012 c_array(1, :) = [ 228, 26, 28 ]; % red c_array(2, :) = [ 55, 126, 184 ]; % blue c_array(3, :) = [ 77, 175, 74 ]; % green c_array(4, :) = [ 152, 78, 163 ]; % purple c_array(5, :) = [ 255, 127, 0 ]; ...
% Esta vista recibe como entrada 2 puntos entre los cuales estará el % conjunto de datos function inputLayout(file) % construir la vista hs = build(150,500); % mostrar la 'figura' de la vista hs.fig.Visible = 'on'; % -------------------------subfunciones-------------------------------- % "build"...
classdef FOR_LOAD < ESTIMATOR_CLASS properties state result rigid_num self end methods function obj = FOR_LOAD(self,varargin) obj.self= self; if ~isempty(varargin) if isfield(varargin{1},'rigid_num') ...
function [ f ] = subject( S ) %SUPERVISION Summary of this function goes here % Detailed explanation goes here f = 1:size(S); f = f'; for i = 1:size(S) f(i) = str2num(S(i,19:20)); end end
function endpoints = getEndpoints(obj, treeIdx) %Returns a list of endpoints contained in the tree. % INPUT treeIdx: Index of the tree of interest in obj. % OUTPUT endpoints: endpoints (as node idx) edges = obj.edges{treeIdx}; biEdges = [edges; fliplr(edges)]; leftEdges = biEdges(:,1); binvec = min(leftEdges):1...
function y = knn(X, X_train, y_train, K) %KNN k-Nearest Neighbors Algorithm. % % INPUT: X: testing sample features, P-by-N_test matrix. % X_train: training sample features, P-by-N matrix. % y_train: training sample labels, 1-by-N row vector. % K: the k in k-Nearest N...
function [idx, components_all] = cut_corr_matrix(corr_matrix,data,threshold, threshold2) if ~exist('threshold2') threshold2 = 0.9; end warning off; adj = corr_matrix; % components = sparse(ones(size(adj,1),1)); % if avg_center_gene_corr(data(components(:,1)==1,:))>threshold % isleaf = 1; % ...
function BehavStats=all_behavior(RAWblocks, RAWCued, plot_region, plot_sub_figures, perform_stats, Colors) %% interspersed vs blocks %subselect sessions of interest if strcmp(plot_region,'Both') RAW=RAWblocks; else for i=1:length(RAWblocks) name=char(RAWblocks(i).Region); regio...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright 2021, Diogo Costa, diogo.pinhodacosta@canada.ca % This file is part of WebCrawler tool. % This program, WebCrawler tool, is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public Licens...
function [y]=fun(k,x,Aa,Ab) % y0=k(1); A_1=k(1); t2_1=k(2); A_2=k(3); t2_2=k(4); % y=y0 + (A_1)*(exp(-x./t2_1)) + (A_2).*(exp(-x./t2_2)); y=(A_1).*(exp(-x./t2_1)) + (A_2).*(exp(-x./t2_2));
function value = convert2ColumnIndex(columnName) columnName = upper(columnName); value = 0; for i = 1 : length(columnName) delta = int8(columnName(i)) - 64; value = value*26+ delta; end
function [basis_cell Lfd_cell quadvals_cell, nbasis] = MakeBasis_cell(... range,norder,knots_cell,nquad,dvalue,lambda0,LFD_pen_order) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Adapted from function MakeBasis and spiffed up to hide a for loop which % gives cell array results for al...
% shrinkageDemoBaseball shrinkageDemoBaseballData() % load data Y = data(:,1); p = data(:,2); n = 45; x = sqrt(n)*asin(2*Y-1); % arcsin transform d = length(x); xbar = mean(x); V = sum((x-xbar).^2); B = (d-3)/V; shrunkTransformed = xbar + (1-B)*(x-xbar); % Efron-Morris shrinkage shrunk = 0.5*(sin(shrunkTransformed/sqr...
function [ length ] = calcLength() % function [] = calcLength() % % The purpose of this function is to calculate the length of each % track element in order to calculate the length of the entire track. % % input: ---------------------------- % % output: ---------------------------- % % Author: Keith Covington % Rya...
%{ SHASHWAT SINGH 2017KUCP1054 PROGRAM TO PLOT A UNIT CIRCLE FILE NAME : shash_circle.m %} clc clear all close all aa = 0:0.0001:1; xx = cos(2*pi*aa); yy = sin(2*pi*aa); plot(xx,yy) title('UNIT CIRCLE') grid on
function ONDist = orgNucNormToMaxSelectFrame(orgptloc, posnuc, frames ) % function of normalized organelle to Nucleus distance % input: % (1) orgptloc: 1 x n or n x 1 structure with a field xy containing point positions and n = % frame numbers % (2) frames: frame indices % output: % normIODist: normalized inter-organ...
function output = quantization(input,s) l=10^(s); %output = zeros(size(input)); quan = round(abs(input),s); randomnoise = rand (size(input)) ; r = randomnoise < (abs(abs(input)-quan)*l) ; output = sign(abs(input)-quan) .* r/l +quan ; output = sign(input) .*output ; end
function [LOG_TX,LOG_dev_list,LOG_app_list] = Simulate(ENV_LIST_FILE,NTX,R,C,W,TOTAL_TIME,MAX_ERR,R_MAX,IFACTOR,DFACTOR,INIT_VEL,MAX_ACT_POWER,MAX_APP_POWER,DEVICE_LIST,STEP,... SHOW_PROGRESS,powerTX,powerRX,B_SWIPT,B_RF,A_RF,N_SWIPT,N_RF,miEnv) LOG_TX = []; LOG_dev_list = []; LOG_app_list = []; GlobalTime = ...
%%% cellROI v2 % PURPOSE: Graphical user interface for selecting regions of interest (ROIs) from motion-corrected calcium imaging data. % AUTHORS: MJ Siniscalchi 181105; based on original version by AC Kwan. % %***FUTURE EDITS: %-Use dispRelFluo function from selectROI() to implement neuropil masks... %-Allow dispRelFl...
function output = import_bic_logpx( data ) % Function take in standard .proc files, where models % check that everything is the same size... check_1 = []; check_2 = []; try for i=1:size(data,2); tcheck_1 = []; tcheck_2 = []; for j=1:size(data{i},1); tcheck_1 = [tcheck_1; data...
function varargout = changeParameters(varargin) % CHANGEPARAMETERS MATLAB code for changeParameters.fig % CHANGEPARAMETERS, by itself, creates a new CHANGEPARAMETERS or raises the existing % singleton*. % % H = CHANGEPARAMETERS returns the handle to a new CHANGEPARAMETERS or the handle to % the exis...
%function [Kp,Ki,ISTSE] = PSO(it,pop,C) % Função de Transferência do Processo clear; clc; close all; pfinal = [25 10]; % Fator de ponderação w1 = 0.12; w2 = 0.88; % Parâmetros do manipulador L1 = 10; L2 = 10; L3 = 10; it = 5000; pop = 500; best = 0; n = pop; ...
function res = JacobiMethod(A,b,x0,n) % A = M - N, x_n+1 = inv(M)Nx_n +inv(M)b iterate n times M = diag(diag(A)); N = M-A; for i = 1 : n res = M\N*x0 + M\b; x0 = res; end end
x=map(:,1); y=map(:,2); z=map(:,3); xlin = linspace(min(x),max(x),200); ylin = linspace(min(y),max(y),200); [X,Y]=meshgrid(xlin,ylin); Z = griddata(x,y,z,X,Y,'cubic'); mesh(X,Y,Z); contour(X,Y,Z,[230:5:340],'ShowText','on'); %plot3(x,y,z,'*');
function f = error_nominal_zeta(x) % Establish the table with Kalman Gain % x: [Kalman filter, system, weight]' A = [ x(1), x(2); ... 0, x(3)]; C = [ x(4), 0]; Q = [ 0.0001, 0; ... 0, 0.0001]; R = 0.0001; K = FeedbackGain(A, C, Q, R); f = cost_zeta(x(1:4), K, x(5:8), x(9)); end
%========================================================================== % Algoritmo transforma gill-size em que: % Entrada: Matriz[qtde_Instâncias,1] com valores "b" e "n" % % Retorno: Matriz[qtde_Instâncias,2] com valores 0's e 1's de modo que: % broad (b) = [1 0] % narrow (n) = [0 1] % ...
function [data2, p] = local_fitting_shepard(img_patch, seed_point) z = get_from_sub(seed_point, img_patch); sz = size(img_patch); % seed points cloud data(:,1) = seed_point(:,2); data(:,2) = seed_point(:,1); data(:,3) = z; % least square method p2 = 3; [~, p, error] = least_square(data, p2, 0); [ri, ci] = ind2sub(s...
% Daniel Couch % Jonathan Rice % solution_graph2.m % Graphs system for APC, CDK-1 % function varargout = solution_graph2(varargin) % SOLUTION_GRAPH2 MATLAB code for solution_graph2.fig % SOLUTION_GRAPH2, by itself, creates a new SOLUTION_GRAPH2 or raises the existing % singleton*. % % H = SOLUTION_GRAPH...
% %@(#) readmast.m 1.1 95/01/25 10:20:08 % %function vec=readmast(masfil,par_no,type) % %par_no is parameter number in CM master files %type can be I, F, C1 or C2 for Integer, Float resp Char values %C2 is used to pack values stored in A2 format function vec=readmast(masfil,par_no,type) if nargin ~=3,error('Usag...
%% Calculation of Eigenvalues of Grid/Inverter Impedance Ratio % ######################################################################## % calculation of eigenvalues of grid/inverter impedance ratio % Input: % - [obj] grid parameter % - [obj] inverter parameter % - [obj] control parameter % ...
function agglos = fromAgglo(agglos, segPos, method, varargin) % agglos = fromAgglo(agglos, segPos, method, varargin) % Converts regular agglomerates (i.e., segment equivalence classes) % into super-agglomerates. % % agglos % Cell array with segment equivalence classes. % % segPos ...
%@(#) sslekrap.m 0.0 11/02/10 00:00:00 % % %function ssrap(distfil,utfil,sorton,inv,qspec) % %Get CR data from distribution file, calculate, sort and print %CR depletion parameters. Distributions CRBORO, CRTBOR, CREXPO %and CRTEXP need be present in the distribution file to be read. %Output data matches that of...
% a improved edgelink version by Xg Wang (mailto: wxghust@gmail.com) function [list2] = imlink(bw, radius, mincurv) if nargin == 1 radius = 5; mincurv = 0.6; end elist = edgelink(bw); recorder = []; curv_map = zeros(size(bw) ); for n = 1:length(elist) pnts = elist{n}; recorder = [recorder; [n, 1]...
% Aggregate weights and plot beam patterns close all; clearvars; addpath ../kernel/ scan_table; % Found in kernel directory tic; % % AGBT16B_400_04 Grid %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% session = AGBT16B_400_04; % Sources: B1929, B1933, B1937 on_scans = [25, 27, 28]; on_tstamp = session.scans(on_scans);...
% ----------------------------------------------------------------- % % Matlab Programs included the Appendix B in the book: % % Xin-She Yang, Engineering Optimization: An Introduction % % with Metaheuristic Applications % % Published by John Wiley & Son...
function [MZOut, matchNames] = AAmatcher(deltaMZ, mz_list, combNames, combMasses) pos = 1; MZOut = zeros(length(combNames),2); matchNames = {}; for i=1:length(deltaMZ(1,:)) for j=1:length(deltaMZ(1,:)) if i~=j match = find(combMasses >= deltaMZ(i,j)-0.1 & combMasses < deltaMZ(i,j)+0.1); ...
function kno_pet_anova close all hidden clear all ourdata; function ourdata p = 'E:\Backup\Nifti\'; cd(p) [N,T] = xlsread('subjectdates.xlsx'); id = N(:,1); dates = T(2:end,10:14); ndates = size(dates,2); nsub = numel(id); files = struct([]); for ii = 1:nsub for jj = 1:ndates dat = date...
function [theta, J_history] = gradientDescentMulti(X, y, theta, alpha, num_iters) %GRADIENTDESCENTMULTI Performs gradient descent to learn theta % theta = GRADIENTDESCENTMULTI(x, y, theta, alpha, num_iters) updates theta by % taking num_iters gradient steps with learning rate alpha % Initialize some useful values ...
%=============================================== % Bruce Land -- Cornell University -- Oct 2010 %=============================================== % input format: % ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; % `define % symbol1 value1 (value in decimal) % symbol2 value2 % ... % ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; % `d...
clear all ; close all ; cd c:/shared/lastute ; subs=dir('*') ; subs(1:2) = [] ; for s=1:length(subs) cd(['c:/shared/lastute/',subs(s).name]) ; t1 = load_untouch_nii('t1_in_ute.nii.gz') ; EEG = pop_loadset('C:\shared\badger_eeg\alex\1hz_preproc_retino_allstims_01_Pulse Artifact Correction.se...
function seq=reverseseq(x) m=length(x); for i=1:m seq(m-i+1)=x(i); end
function [sharpened_output_image] = unsharp_masking(in) out = in; [row,col] = size(in); %original image display figure,imshow(in); title('Original Image'); %smoothing image smooth_image = imgaussfilt(in,2.5); figure,imshow(smooth_image); title('Smooth Image'); %original image - smoothed image to get unsharp mask uns...
function import_angles_cback(~,~,main_figure) layer=get_current_layer(); curr_disp=get_esp3_prop('curr_disp'); [trans_obj,idx_freq]=layer.get_trans(curr_disp); list_freq_str = cellfun(@(x,y) sprintf('%.0f kHz: %s',x,y),num2cell(layer.Frequencies/1e3), layer.ChannelID,'un',0); [select,val] = listdlg_perso(main_figu...
function [MLCframe]=CreateMLC_highLevelFunction(frame,borderMask,args,noise_array) Mask=CreateMasks(frame,borderMask); squishedFrame=SquishHistogram(frame); Edgeimage=MultiLayerCanny(squishedFrame,args); Edgeimage=Edgeimage.*Mask; %imshow(Mask) tiledNoise=Create_tile_for_Noise(noise_array,borderMask); tiledN...
% Função RBF % Parametro da função(Padrão de treinamento, Saída desejada,Núméro de centros) function [G,W] = RBF_N(entrada, saida,numcentros) tamanho = size(entrada,1); centros = entrada; % Faz o calculo da distancia entre os centros soma = 0; for i = 1 : numcentros distancias = zero...
classdef SimulatorUtilitiesTest < matlab.unittest.TestCase %SIMULATORUTILITIESTEST Summary of this class goes here % Detailed explanation goes here properties (Constant) simConstructorArgs = {'127.0.0.1:1234','debug',true} end methods (TestClassSetup) function a...
MatFiles=dir('*analysis_matlab.mat'); name=strcat(MatFiles(1).name); Calcium=load(name, 'DenoisedTraces'); Calcium=Calcium.DenoisedTraces; MatFiles(1).number=size(Calcium,1); Noise=load(name, 'Noise'); Noise=Noise.Noise; for i = 2:length(MatFiles) name=strcat(MatFiles(i).name); C=load(name, 'DenoisedTraces'); ...
function evaluated_video() task=5; %Select the task that you want to compute global_path='./'; groundtruth_path='groundtruth_1/'; groundtruth_path_old='groundtruth/'; groundtruth_name='gt'; input_path='input_1/'; input_path_old='input/'; input_name='in'; sequence_db=struct; ...
%% clc;clear;close all s = [1 1 1 2 2 3]; t = [2 3 4 3 4 4]; weights = [6 6.5 7 11.5 12 17]'; code = {'1-44__1-3' '1-49__1-34' '1-49__1-34' '1-49__1-34' '1-49__1-34' '1-49__1-34'}'; EdgeTable = table([s' t'], weights, code, 'VariableNames', {'EndNodes' 'Weight' 'Code'}) names = {'USA' 'GBR' 'DEU' 'FRA'}'; country_co...
function [qd, par_out] = ec_6dof_terr(q, ptv) % Patrucco, 2021 % 6-DOF model of a vehicle (plus 4 for wheel speeds and pos) % includes variable height terrain % in subsequent releases, both the terrain handle function and vehicle % parameters should be supplied through additional arguments. % q: 12 x 1 (6 free coordin...
% reset_data_analysis_environment close all REINIT_ALL_TOKAMAK_DATA=1; if REINIT_ALL_TOKAMAK_DATA==1 clear all initialize_folder_names; initialize_collapse_map_calculation_context rescaling_to_XZsmall_maps DT_INTERPOLATION_METHOD='quadratic' % by default CALCULATE_VD_DATA_FILE=0; end PHI_...
% CenterClipperTemplate.m %% load speech signal and play it [y,Fs]=audioread('speech_fem_4.wav'); z=[zeros(44100,1); 2*y(1:211733); zeros(44100,1); 2*y(211734:end) ; zeros(44100,1)]; N=length(z); player = audioplayer(z, Fs); playblocking(player); %% add white noise z=z+0.04*(rand(N,1)-0.5); %% play noisy signal...
% MCLPCLC.M % Called by mclcm / rf pulse calc % Script for generating new b1 % Calls mclpmb1 for actual b1 calc % turn off V / C ********** set(mcltxtvp, 'String', '') ; % Turn on rel v / pwr calc and replot ******** set(mcluivp, 'Visible','on') ; set(mcluirpl, 'Visible','on') ; % Reduce nofp if zeropadding called f...
%% % Frizziero % % angles: angle of arrival of the wawe (azimut, elevation). % lambda: wawelength. % ant_pos: array [M x 1] containing the (x,y,z) position of each antenna (that are M in total) % expressed in wawelengths. %% function [w] = compute_BF_vector2(angles, lambda, ant_pos) sigma_noise = 0.01; th...
function [parout,output,jacobian,residual] = fit_Model(X0,X1,time,guess) Q=X0(1,:); R=X0(2,:); D=X0(3,:); Npop=X1(1); E0=X1(2); I0=X1(3); p = inputParser(); p.CaseSensitive = false; p.addOptional('tolX',1e-12); % less tolerance for p.addOptional('tolFun',1e-12); % option for optimset tolX = p.Results.to...
function tex_to_text(~) %make sure your current folder is the same where your files are present FileList = dir('*.Tex'); N = size(FileList,1); for k = 1:N filename = FileList(k).name % tex_file = input('Enter your TEX file name having orientation of grains in apostrophe(''odf.tex''):-...
function Xn = ReSampleCurve(X,N) %% Resamples X to N points (arc-length parameterized) %% Inputs % X = two-dimensional curve % N = # of discretization points desired %% Outputs % Xn = resampled curve of X with N points %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [d,T] = size(X); ...
[config core] = kernel('amp_tran1.txt', 2, 1, 4, 6);
close all clear expNames = { 'Exp_100x100x30',... 'Exp_200x100x30',... 'Exp_300x100x30',... 'Exp_200x100x66',... 'Exp_300x100x66',... 'Exp_200x100x100',... 'Exp_300x100x100'}; colors = { [11 171 224],... [0 114 201],... [11 51 212],... [214 100 11],... [227 4...
function [H, Inp] = design_rbf(X, C, R) % [H, Inp] = design_rbf(X, C, R) % % Gets the design matrix from the input data, centre positions % and radii factors. % % Input % X Input training data (n-by-p) % C List of centres (n-by-m) % R Scale factors: scalar, n-vector, or n-by...
function GU_ExM_JaneliaCluster_ExtractDANassociatednc82_stitchedData(ex) % Gokul Upadhyayula, Nov 2017 se = strel('sphere', 7); ex = str2double(ex); fprintf('calculating file names...'); tic % get file names mx = 15055; my = 27964; % mz = 6647; matRT = '/groups/betzig/betziglab/4Stephan/171016_Flybrainsynapse/'; % n...
close all clc figure; ROWS = 10; COLS = 10; k =1; for n = 1:9 filename = strcat(strcat('/home/omkar/Documents/cvpr_cc_', num2str(n)), '_to_all') ; data = load(filename); for p = 0:9 digit = function_get_digit(data, n, p); subplot(ROWS, COLS, k); imshow(digit, []); k = k +1; end end
for j=0:1 x=(pi/10) + (0.01*i); for i=1:2 [e,y]=saufg(2*i,5000,x); figure(i+(2*j)) plot(y); end end
% clear all; clear; close all; clc; dbstop if error; current_tests=[ pwd '/current_tests' ]; fct = genpath([ pwd '/functions' ]); mains = [ pwd '/mains']; addpath(pwd) addpath(fct) % addpath(stk_folder) addpath current_tests mains stk-2.3.4; % stk_init; clear current_tests mains fct home; % try % pdeinit % end
function data = formatData(data1,hints) % Copyright 2012 The MathWorks, Inc. % Dimensions data.Q = data1.Q; data.QAligned = hints.QAligned; data.TS = data1.TS; emptyGPUArray = nndata2gpu([],hints.precision); % Simulation Data if isa(data1.X,'gpuArray') data.X = data1.X; data.Xi = data1.Xi; data.Ai = data1.Ai;...
classdef DataFieldType enumeration UnspecifiedField ScalarField StringField NumericVectorField StringArrayField DateField % stores a date/time, in string representation DateNumField % stores a date/time, in numeric datenum() representation end end...
function obj = solveApertureHeight(obj, f_number, full_field_angle) % SYNTAX % sys.solveApertureHeight(f_number, full_field_angle) % Parse input arguments parser = inputParser; parser.FunctionName = 'solveApertureHeight'; parser.addRequired('FNumber', @(x) isscalar(x)); parser.addRequired('Field', @(x) isscalar(x));...