text
stringlengths
8
6.12M
function hdr = make_hdr(slices) % Creates Analyze header structure from slices structure array % $Id: make_hdr.m 1279 2014-03-24 20:06:25Z klitinas $ % $HeadURL: svn+ssh://klitinas@anger.engin.umich.edu/svn/matlab/img/trunk/make_hdr.m $ pad1(1:28) = char(0); pad2(1:2) = char(0); pad4(1:20) = char(0); pad5(1:...
function im = convert_image_to_rgc_response_old(im) % set up simulated RGC receptive fields % NOTE: Should add step to convert SIGMA in to arcminutes, using study % viewing distance, screen etc SIGMA = 2; % stddev of central 2D Gaussian in pixels SUR_SCALE = 2; % scale factor for surround 2D Gau...
% POLYMODEL Polygonal model of lesion contour. % [X_TAF,FEATS_TAF,X_STAF,FEATS_STAF,X_PM,FEATS_PM] = POLYMODEL(BW) computes % three methods to analyze the shape of a breast lesion BW: filtered % turning angle function (TAF), smoothed turning angle function (STAF), and % polygonal model (PM). X is the numeric ...
%% LAG - linear regression synthetic data clear all close all %% data allocation for linear regression [Xdata_28] = load('data28/data.txt'); % UCLA Housing dataset [ydata_28] = load('data28/y.txt'); [Xdata_29] = load('data29/data.txt'); % Body Fat dataset [ydata_29] = load('data29/y.txt'); [Xdata_30] = load('data3...
function [rval,A]=check_eighistogram(smatfilename,nbins) A = readSMAT(smatfilename); if ~exist('nbins','var') || isempty(nbins), nbins=201; end; [~,bins] = hist([0,2],nbins); if mod(nbins,2)==0, warning('should call eighistogram with an odd number of bins'); end v = graph_eigs(A,'normalized'); truebins = hist(v,bi...
% Regulator PID function [error] = pidErr(argK, argTd, argTi, draw) % Ustawienia symulacji N = 1000; Yzad = ones(N,1); Yzad(1:200) = 2.6; Yzad(201:400) = 2.8; Yzad(401:700) = 3.1; Yzad(701:1000) = 3.4; error = 0; % Nastawy regulatora K = argK; %1.85 oscylacje niegasnace Ti =argTi; Td = argTd; T = 0.5; % Charakterysty...
function outp = randprice(n, startprice, seed) %RANDPRICE 用于生成一系列股价,后一日股价与前一日股价相差[-10%,10%] % n:生成股票价格的数量 % startprice: 起始价格 % seed: 随机数生成器种子 % 如果没有设置种子,则将种子设为0 if nargin <3 seed = 0; end % 设置随机数生成器 rng(seed); % 初始化 outp = zeros(n,1); % 赋值 outp(1) = startprice; for i=2:n outp(i) = outp(i-1) *( 0.2*rand(1)+...
function a=aaa(t,nu,alpha,beta,tauone,tautwo,T,kone,ktwo,lone,ltwo); a=fone(t,nu,kone,ktwo,lone,ltwo,T,tauone,tautwo).*(ftwo(beta,lone,T)-ftwo(alpha,lone,T))... +fone(t,nu,kone,ktwo,ltwo,lone,T,tauone,tautwo).*(ftwo(beta,ltwo,T)-ftwo(alpha,ltwo,T))-... fthree(t,nu,kone,ktwo,lone,ltwo,T,tauone,tautwo,alpha)+... fthree(...
% simfile_name function [simName] = simfile_name_downlink(par) % get current time time = datetime('now', 'Format', 'yyyyMMdd-HH_mm_ss'); % join all the algorithm names joint_precoders = par.precoder{1}; for ind = 2:length(par.precoder) joint_precoders = [joint_precoders, '-', par.precoder{...
function opt = solver( ) % solver Default options for solvers. % % Backend IRIS function. % No help provided. % -IRIS Macroeconomic Modeling Toolbox. % -Copyright (c) 2007-2017 IRIS Solutions Team. FN_VALID = irisopt.validfn; %-------------------------------------------------------------------------- opt = struct(...
function Robust() % Simulate a robust Kalman filter. K_optimal = [0.02; 0.002]; % optimal Kalman gain for this problem duration = 100; % simulation length dt = 0.1; % step size a = [1 dt;0 1]; % system matrix b = [dt^2;dt]; % input matrix B_w = eye(2); % noise input matrix c = [1 0]; % measurement matrix r...
clear all close all clc % Definition des variables cl1 = 1; cl2 = 0; p10 = 0.5; p20 = 1 - p10; A(1, 1) = 0.9; A(1, 2) = 1 - A(1, 1); A(2, 2) = 0.3; A(2, 1) = 1 - A(2, 2); n = 20; m1 = 127; m2 = 128; sig1 = 2; sig2 = 3; % Taux d'erreur T = 100000; somme = 0; for i=1:T X = genere_Chaine2(n, cl1, cl2, A, p10, p20); ...
I = imread('./imgre/ojo8.jpg'); imtool(I); %se asume que se ha exportado la sección de ojo rojo con el nombre redEye. redEyeRasterized = [reshape(redEye(:,:,1),1,[]), reshape(redEye(:,:,2),1,[]), reshape(redEye(:,:,3),1,[])]; redEyeRasterized = redEyeRasterized'; %los componen...
function result = flowWarp( flow, img ) % Warps input image using given flow field % --> Flows should only be 1-channel % construct displacement field from flow D = cat(3, flow.x(:,:), flow.y(:,:)); result = zeros(size(img)); for c = 1:size(img,3) % do warping on each channel ...
function [ K ] = shuffle_K_common_neighbour( K, I, J, cn_scale_weight ) %UNTITLED Summary of this function goes here % Detailed explanation goes here show_wait_bar = 0; fprintf('shuffle_K_common_neighbour....') if cn_scale_weight > 1 %%%%% find number of common pre-synaptic neighbours A = sparse(I,...
%calculate the interfacial tension of methane + n-butane at310.95K and %108 Bar %reference comp. : highest boiling point clear all initNeqSim system1 = neqsim.thermo.system.SystemPrEos(310.95,108); % system1.addComponent('methane', 0.8); %mole frac like feed system1.addComponent('n-butane',0.2); system1.createDataba...
%% string_to_integer converts a string of 8 binary digits to an integer. % % B VALUE % -------- ----- % 00000000 0 % 00000001 1 % 00000010 2 % ... % 11111111 255 % % Parameters: Input, integer B8(8), the binary string of 0's and 1's. % Output, integer VALUE, the value of...
function result = SLBP(img,lbpPoints,lbpRadius,mappingriu2,mappingu2,mode,style) [imgH,imgW] = size(img); imgNewH = imgH - 2*lbpRadius(end); imgNewW = imgW - 2*lbpRadius(end); imgN=zeros(imgNewH*imgNewW,lbpPoints,length(lbpRadius)); for k=1:length(lbpRadius) blocks = cirInterpSingleRadius_SLBP(img,lbpPoints,lbpRad...
function [output] = white_balance(rgbImage) %WHITE_BALANCE Summary of this function goes here % Detailed explanation goes here grayImage = rgb2gray(rgbImage); % Convert to gray so we can get the mean luminance. % Extract the individual red, green, and blue color channels. redChannel = rgbImage(:, :, 1); greenChannel ...
function [xn,n,n2] = Schalcher_i10a_S7_Aufg3(A,b,x0,tol) %--------------------------------------------------------- % Berechnet per Gauss-Seidel eine Näherung an x % Parameter: % A: reguläre m x m Matrix % b: m x 1 Spaltenvektor % x0: m x 1 Startvektor für Iteration % tol: reeler Toleranzwert % % Output: % xn...
function [model, spred] = get1Dmap(zua, variable, scaling, nGrid, bins, CVO, iter, sampFreq, win, FoptiSmooth,Fcircular) % function to fit and test a 1D model, find the optimal smoothing % function too if nargin < 10 FoptiSmooth = true; end if nargin < 11 Fcircular = true; end X_train = variable(CVO.train{iter}...
%find the minimum of univariate function using GOLDEN-SECTION METHOD function [y]=optim_alphaHW4(f,xo,S,Xmin,Xmax); %function [y,fun_countalpha]=optim_alpha(f,xo,S,Xmin,Xmax); xo; S; if sign(S(1))==1, x1u=(Xmax(1)-xo(1))/S(1); %S(1)>0 else x1u=(Xmin(1)-xo(1))/S(1) ; %S(1)<0 end if sign(S(2))=...
% PSO black box optimiser % % Author : Darwin LAU % Created : 2016 % Description : % Just a basic implementation, need to add many more features (like some % in the PSO toolbox, such as different bounding box handling methods or % equality constraints etc). % - Support parallel computing (06-2018...
% This Matlab file demomstrates the method for simultaneous segmentation and bias field correction % in Chunming Li et al's paper: % "Multiplicative intrinsic component optimization (MICO) for MRI bias field estimation and tissue segmentation", % Magnetic Resonance Imaging, vol. 32 (7), pp. 913-923, 2014 % Auth...
function [yc, cl, cu] = checkConstraints(obj, x, tol, output_file) % Check the violation of the constraints if nargin < 3 tol = 1e-3; end if ~iscolumn(x) x = x.'; end phase = obj.Phase; % phase_var_indices = obj.PhaseVarIndices; n_phase = length(phase); ...
function IQ = MATLAB_directSCPI_Specan_IQ_Display_example(IP,Freq,RefLev,SampleRate,NofSamples) % Make sure you have installed NI VISA 15.0 or newer with its .NET support component % % This example configures the spectrum analyzer to capture IQ data. % The IQ data is transferred to the PC and displayed. % % type "help...
pkg load symbolic; clc; clear all; syms x; eqn = x^4 - 7 * x^3 + 3 * x^2 - 5 * x + 9 == 0; S = solve(eqn); ans = double(S); ans
function [stimuli] = repref_getstimuli(subjectNumber, subjectName, cbfaces, cbscenes) %-------------------------------------------------------------------------% % [stimuli] = repref_getstimuli(...) % % * all arguments are strings % % SUBJNUM : unique # based on date string (e.g., '101220') % SUBJNAME...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 本函数用于读取Path路径下策略样例。 % 样例格式如下: % MA 2010-1-1 1 2010-4-2 1 000001.SZ 1 [5,10] 0 100000 0 % cppi 2012-2-3 1 2012-3-3 1 1000000 0 900000 0 3 0 510050.SH 1 010107.SH 1 5 0 % 第一列为策略名字,后面是策略需要输入的参数以及参数类型(1为字符型,0为数值型) % 策略...
function label = get_label_action(filename) label = str2double(filename(19:20)); end
function f_value = negloglik_multi_matern(beta_all, r, samples) %NEGLOGLIK A wrapper of ECMNOBJ to evaluate negative log-likelihood function. % % F_VALUE = NEGLOGLIK(BETA_ALL, R, SAMPLES); % % Inputs: % BETA_ALL - the current parameter vector % R - one of the outputs of the function INIT_COMP, which are comput...
function [p_x, p_y, patches] = samplePatches( im , border ) % SAMPLEPATCHES Sample 5 � 5 patches from the input image. %You are allowed to use 2D loops here. % Arguments: % im − a grayscale image of size m × n % border − An integer that determines how much border we want to leave in % the image. For example: if...
function [A,B,C]=Extract_ABC(S,nod) %Extract A B C %Input: time-series:S; % node to reconstruct:i %Output: A the state matrix of other nodes when node i is zero at time t % B the state of node i at time t+1 % C the state matrix of any other two nodes when node i is zero % ...
function[vol] = net2vol(vol,X,E) %NET2VOL - converts a network into a volume, with ones along the fiber %edges if isnumeric(E) for i=1:size(E,1); x1 = X(E(i,1),:); x2 = X(E(i,2),:); vol = line3d(vol,x1,x2); end elseif isstruct(E) F = E; for fi=1:length(F) fv = F(fi)....
% costume gaussian dist function y = g1(x) % every call calls gmdistribution, problemetic dis = gmdistribution([2; 4.6; 7.8], cat(3, .5, .5, .5), [.3, .4, .4]); y = pdf(dis, x); end
%Example 3.30 % echo off clf; figure(gcf) setfsize(600,250); deg2rad = pi/180; rand('seed',24792483); echo on clc % INITFF - 初始化前向网络 % TRAINCON - 训练神经网络控制器 % SIMUFF - 对神经网络进行仿真 pause % 键入任意键继续 clc load appcs2d pause % clc %(vel = 0, demand = angle). %angle = [-10:40:190]*deg2rad; %vel = [-90:36:90]*deg...
%{ # Motion and raster correction of movies -> pni.Scan ----- align_time=CURRENT_TIMESTAMP: timestamp # automatic %} classdef CorrectedScan < dj.Computed methods(Access=protected) function makeTuples(self, key) %!!! compute missing fields for key here self.insert(key) end end end
function waterMaker(ax,transparency) % transparency: 0, opaque, 1, complitly transparent if nargin < 2 transparency = 0.6; end axPos = get(ax,'Position'); r = axPos(4)/axPos(3); XLim = get(ax,'XLim'); YLim = get(ax,'YLim'); marker = qes.ui.icons.ustcLogo_blue_large(); ms...
function [respuesta] = cholesky(matriz,b) %OJO: Resultado diferente al jorge -> REV. %Matriz siempre cuadrada, agregar verificacion. [ancho,~] = size(matriz); L = zeros(ancho); U = zeros(ancho); %Se itera en busca de los valores de L y U por medio de la formula de for i = 1:ancho U(i,i:ancho) = matriz(i,i:ancho...
function ComputeSaveFData(all_ftypes,f_sfn) global W H fmat = sparse(VecAllFeatures(all_ftypes,W,H)); save(f_sfn,'fmat','all_ftypes','W','H'); end
function gauss_pivote_paso(A,b, pwd) fid=fopen(strcat(pwd,'/paso.txt'), 'w'); fprintf(fid,''); fclose(fid); %disp('Metodo de Eliminacion Gaussiana con Pivoteo Parcial'); %A=input('Ingrese la matriz A en []: '); %b=input('Ingrese el vector b en []: '); Ab = [A b]; %Matriz aumentada [m]=size(Ab); m=m(:,1);...
function [vp_grid] = brocherizegrid(density_grid) % function to take in a density grid and covert it to a Vp (compressional % wave speed) grid based on the empirical relationship defined by a % 5th order polynomial by Brocher (2005) % This relationship is valid for densities between 2 and 3.5 g/cm^3 density_grid = den...
% Work shop number 2 % Hosted by Binh Nguyen % Goals for today: % - Do some physics questions % - Plot some graphs % - Solve some linear lines %% Part 1 % Use two comments to create section % We're going to have time = 8 s and speed = 150 km/h % First thing we need to do is to turn 150 km/h to m/s velocity = 150;...
% read file file = 'C:\Users\bastien\Documents\internship\Miw\exosqueleton\visual_interface\BCIcourse\protocol_configuration_MI.ini'; readSett = inifile(file,'read',{'experiment','','nTrial',''}); % write file keys = {'experiment','','nTrial',50}; inifile(file,'write',keys)
function plot1handle = y(Daten) alpha = Daten(1,:); eta = Daten(2,:); %x=polyfit(eta,alpha,1); %y=x(1,2)+x(1,1)*eta; y=[-15,5]; t=[24.788,-3.297]; figure1handle = figure(1); figure1handle.Color = [1,1,1]; axes1handle = axes; plot1handle = plot(eta,alpha,'+'); hold on; plot2handle = plot(y,t); grid on; ylabel(axes1...
% Retrain Neural network variable Retrain = true; %% Load collated data %{ Data Includes: Date, Hour, Dry Bulb Temperature, Dew Point Temperature, Wet Bulb Temperature, Humidity, Electricity Price and System Load}% load('ausdata.mat') %Import Holiday List [num,text] = xlsread('Holidays.xls'); holidays = text(2:end,1)...
clear all clc tic choice = input("select case: "); if choice == 1 A = [2, 7, -2; 1, -2, 2; 3, -2, 1], b = [7; 19; -5] elseif choice == 2 A = [1, 2, 3, 4; 2, 5, 1, 10; 3, 1, 35, 5; 4, 10, 5, 45], b = [9; 35; -45; 189] elseif choice == 3 A = [1, 1, 1; 1, 2, -3; 4, 2, 3; 7, 7, -2], b = [3; 0; 9; 12] elseif choice ...
function t = benchXcorrVec(u,v, numruns) %Used to benchmark xcorr with vector inputs on the CPU and GPU. % Copyright 2012 The MathWorks, Inc. timevec = zeros(1,numruns); gdev = gpuDevice; for ii=1:numruns ts = tic; o = xcorr(u,v); %#ok<NASGU> wait(gdev) timevec(ii) = ...
function StockList = getStockList( StartDate,EndDate ) sql1 = ['select distinct a.SecuCode from SecuMain a join QT_DailyQuote b on a.InnerCode = b.InnerCode ',... 'where a.SecuCategory = 1 and a.ListedDate<=''',StartDate,''' and a.ListedState = 1 and a.SecuMarket in (90) '... 'and b.TradingDay >= ''',StartDate...
function [angles] = ikin(position) px = position(1); py = position(2); pz = position(3); l1 = 135; l2 = 175; l3 = 169.28; l4 = sqrt((px^2)+(py^2)+((pz-l1)^2)); alpha = atan2((pz-l1),(sqrt((px^2)+(py^2)))); beta = acos(((l2^2)+(l4^2)-(l3^2))/(2*l2*l4)); theta1 = -atan2(py,px); ...
Lb=[2:0.001:66]; n1=ceil((1-0.000005).^(-8*(Lb*1000+8+(Lb*1000+20)/(1500-20)*28))); n2=ceil((1-0.000005).^(-8*(Lb*1000+8+(Lb*1000+20)/(1500-20)*28)))+3; time1 = (n1*20-10)*60; time2 = (n2*20-10)*60; Goodput1 = Lb*1000./time1; Goodput2 = Lb*1000./time2; h1=plot(Lb,Goodput1,'-b'); hold on; h2=plot(Lb,Goodput2,'-k...
function R = calRotationMatrix(thetaY, thetaZ, boxSize) vectorizedSize = boxSize(1)*boxSize(2)*boxSize(3); R = sparse(vectorizedSize,vectorizedSize); [x_grid, y_grid, z_grid] = meshgrid(1:boxSize(2), 1:boxSize(1),1:boxSize(3)); origin = backward(thetaY, thetaZ, y_grid(:)', x_grid(:)', z_grid...
function [ Comp ] = RadialEq( CompIn ) % Set output equal to input, add information throughout Comp = CompIn; % Extract number of stages NoStages = Comp.NoStages; % Create array with name of each stage in for n = 1:NoStages Stages{n} = ['Stage',num2str(n)]; end %% Perform tip calculations % Loop...
mainwindow = Screen('OpenWindow', 0); % open the main window % define colors white = [255 255 255]; black = [0 0 0]; red = [255 0 0]; Screen('TextFont', mainwindow, 'Arial'); Screen('TextSize', mainwindow, 32); Screen('TextStyle', mainwindow, 0); % bold is default on PCs; this will remove it % screen 1 message = 'Th...
function elt = lin2d_elt() % function elt = lin2d_elt() % % Returns the linear 2-D (3-point) element data structure. nvars = [1;1;1]; flist = [1 0 0; 2 0 0; 3 0 0]; % the three vertices vnodes = [0 0; 1 0; 0 1]; elt = struct('Aphihat',@lin2d_Aphihat, ... 'nvars',nvars,'flist',f...
function csp=santoff(xsat,offset,xsun) % % Function santoff % ================ % % Correction for Satellite ANTenna OFFset % % Sintaxe % ======= % % csp=santoff(sp,offset,t) % % Input % ===== % % xsat -> Satellite CM geocentric position (3x1 vector) % offset -> 1x3 vector wit...
function stringOut = latexnl(symExprs) % latex new line (latexnl) % takes the symmbolic expression symExps and returns the LaTex % representation. Unix linefeeds '\n' are automatically inserted after % '\\'. % \\ is a linefeed in LaTex syntax, but to display them in the Matlab % Command Window, we must put in \n lay ...
function [science,cost,lists] = SEL_evaluate_architecture_with_lists(r,params,arch) %% SEL_evaluate_architecture.m % This function asserts missions corresponding to the selection % architecture given in the input, and then evaluates them % arch = [1 1 0 0 0 1 0 1 0 0] where 1 means that instrument i flies % all instrum...
[y, Fs] = audioread('touchtone.wav'); b1 = fir1(1024, [684.5/(Fs/2),709.5/(Fs/2)]); x1 = filter(b1, 1, y); b2 = fir1(1024, [1332/(Fs/2),1360/(Fs/2)]); x2 = filter(b2, 1, y); %freqz(b,1) figure; plot(x2) hold on plot(x1) hold off %spectrogram(y, 1024);
%{ mice.Primers (manual) # info about each primer set primer_set : varchar(20) # primer set --- f_primer : varchar(100) # forward primer r_primer : varchar(100) # reverse primer band : int # band size allele ...
% created: Tilke Judd, March 2011 % updated: Zoya Bylinskii, Aug 2014 function res = histMatchMaps(saliencyMap1, saliencyMap2) % match saliencyMap2 to saliencyMap1 [COUNTS,X] = imhist(saliencyMap1); res = histoMatch(saliencyMap2, COUNTS, X); % display maps and histograms if no output arguments if nargout == 0 su...
function[XX,YY,ZZ,KAKOM,NFREE,TEISUU,KOTEI]=DATAIN4 % FREE-FREE Frame Structure L=1;NBAY=5; NODT=(NBAY*2+1)*4; XX=zeros(NODT,1);YY=XX;ZZ=XX; XX(1:4)=[0 0 0 0];YY(1:4)=[0 L L 0];ZZ(1:4)=[0 0 L L]; for I=1:(NBAY*2) NN=I*4+(1:4); XX(NN)=[0 0 0 0]+(I*L);YY(NN)=YY(1:4);ZZ(NN)=ZZ(1:4); end KAKOM=zeros((13*NBAY*2+5)...
% Kristina Johansson %Ref. 25 degrees Celsius function f=ent_Wl(T) %T=T-273.15; Tref=25; h_Wl= -285.84*1000+75.4*(T-Tref); clear f f=h_Wl;
clear a=load('data_error.txt'); b=a(:,2); L=length(b); T=1; s=[]; for n=1:4 %for computing (D1,D2,D3,D4) Mn=zeros(1,L); for h=1:L x=b(h); j=0; for i=1:L-T if b(i)==x; %tarife moment sharti(agar x(i) barabar ba meghda...
function this = disable(this, type, varargin) % disable Disable dynamic links or steady-state revision equations. % % Syntax % ======= % % M = disable(M, '!links') % M = disable(M, '!links', Name1, Name2, ...); % M = disable(M, '!revisions'); % M = disable(M, '!revisions', Name1, Name2, ...); % % % Inp...
%% Solves qs 5.1 for assignment 3 % this function computes the convergence of the given functions function convergence() f = {'(x^2+2)/3', 'sqrt(3*x-2)', '3-2/x', '(x^2-2)/(2*x-3)'}; tol = eps; maxIteration = 10; xRoot = 2; % repeat the computations below for all 4 given equations for i = 1 : length(f) grad = ...
function pp = partial_pressure(p,ngas,nair,varargin) % pp = partial_pressure(p,ngas,nair,unit) % % INPUT: % p = pressure [hPa] % ngas = number density of gas % nair = number density of air % unit can be 'atm' or 'pascal' or empty when it's hPa p = p(:); ngas = ngas(:); nair = nair(:); pp = ngas./nair.*p; if (nargin=...
p =0; for i = 1:100 voro; coop; p = p + CoopProbability; end p = p/100;
function pass = uq_default_model_test_possibleCases( level ) % UQ_DEFAULT_MODEL_TEST_POSSIBLECASES tests representative of possible % supported cases of mfiles % % See also: UQ_TESTFNC_MFILEDEF_MULTIOUTPUT, UQ_TESTFNC_MFILEDEF_PARAMPOLY % parameters Nval = 1e3; eps = 1e-14; if nargin < 1 level = 'normal'; end f...
function modeInfo = modePick(modeRef,eigE,eigVec,n,d,N,T,urms,maxFreq,grpIdx) % last modified: 17/06/19 % % test solution quantities: % eigE, eigeVec, N, d, T, urms % % maxFreq: maximum abs(frequency) up to which test and reference PEhat are % compared % % determine PE correspondi...
function [xx,tt]=note(frekans,vurus) Fs=8192; tt=0:1/Fs:((0.25-(1/Fs))/2); zz=0; xx=sin(2*pi*frekans*tt); if length(xx)==length(zz) zz=[linspace(0,1.5,Fs*vurus*(2/8)),linspace(1.5,1,Fs*vurus*(1/8)),linspace(1,1,Fs*vurus*(4/8)),linspace(1,0,Fs*vurus*(1/8))]; end end %sinüs sinyalinin çizdirildiği fonks...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% DDCDesignMain.m %%%% filter design, generate filer coee and test signal in file %%%% that can be called by quartus. %%%% MRI Digital Receiver DDC simulate; %%%% re...
function [ features ] = extractFeaturesFromData( data , featureType ) %EXCTRACTFEATURESFROMDATA Summary of this function goes here % Detailed explanation goes here switch featureType case 'grayscale' features = reshape(data,size(data,1),128*128); case 'shape' features = res...
function dec = decrypt_dwt(mat,pix,per) pix = ceil(abs(pix)); no = 1; no2 =512*512; [LL1 ,LH1, HL1, HH1] = dwt2(mat,'haar'); LH1= LH1.*no2; HL1= HL1.*no2; HH1= HH1.*no2; % LL1 = LL1+1; val = mod(per*pix,1); [xsin,xlog] = chaotic_map(val,LL1); xsin = 1+floor(mod(xsin(3:end)*10^6,127)); xlog = 1+floor(mod(xlog(3:end)...
function SwipeResults(filename) z2 = CDataset.read(filename); [m n] = size(z2); means = []; for i=1:m K = strsplit(cell2mat(z2.Values(i)),';'); sum = 0; [m1 n1] = size(K); vals = []; for k=1:n1-1 vals = [vals ; str2double(K{k})]; end means = [means ;(mean(vals))]; end [~, meanSort] = sort(means); z2 = z2(me...
classdef Util < handle properties(Constant) GROUNDTRUTH_ELAN_TIER_NAME = 'Event' end methods(Static) function PrepreocessSequences(fname_mask,suffix,labelmap_mat_filename) % PrepreocessSequences % % This function will rea...
choice=7; n=3; A=[1 5 3 18; 2 4 7 10; 4 6 2 50]; B_real=A(:,n+1); % storing real constants B L=zeros(n); % set L to be a zero matrix of n*n L(1,1)=sqrt( A(1,1) ); for i=1:n L(i,1)=A(i,1)/L(1,1); % filling first column of L end for j=2:n % calculating remaining elements of L s...
function out = Precision(PosClass,estimatedLabels,TrueLabels) MinprityCLabel = PosClass; index = find(TrueLabels == MinprityCLabel); trueMinerLabel = TrueLabels(index); estimatedMinerLabel = estimatedLabels(index); index = find(estimatedLabels == MinprityCLabel); % those who estima...
%Script to compare MVGC analysis to mine binsize = 0.002; nK_lfp = 20; nK_stim = 0; stimelec = 0; tstat = 'F'; tstat_chi2 = 'chi2'; %All files files = dir('../data/*_traces.mat'); %Just use the first one for this idx = 2; runname = 'stim'; %GLM params const = 'off'; distr = 'normal'; alph = 0.05; matfile = files(idx)...
function [ fig ] = statsDraw %statsDraw - draw the window and axes / panels % Define default view layout = 'axes'; datatype = 'ms'; % ms or lcms % Main figure fig.fig = figure('Name','Stats Toolbox',... 'Units','normalized',... 'Position',[0.2 0.2 0.6 0.6],... 'Tag','stats',... 'Color','white'); % De...
function E = calculeazaEnergie(img) %calculeaza energia la fiecare pixel pe baza gradientului %input: img - imaginea initiala %output: E - energia %urmati urmatorii pasi: %transformati imaginea in grayscale %folositi un filtru sobel pentru a calcula gradientul in directia x si y %calculati magnitudiena gradientului %E...
function Compile(nlp, export_path, compile_cstr, exclude) if nargin < 3 compile_cstr = []; end if nargin < 4 exclude = []; end if isa(nlp,'TrajectoryOptimization') compileConstraint(nlp,compile_cstr,export_path,exclude); compileObjective(nlp,[],export_path); ...
function indexCH = indexDB( data, Dmatrix, nCatFeature, clu, varargin) %%%Input: %data: row wise, normalized data for clustering, nCatFeature first %Dmatrix: a precomputed pairwise distance, just to save computation %nCatFeature: number of Categoric feature in the dataset %clu: clustering , partition in the order ...
function v = enthalpies_RT(p) % ENTHALPIES_RT - Pure species non-dimensional enthalpies. % % h_rt = enthalpies_RT(phase) % % sets array h_rt to the array of standard-state species enthalpies % for phase 'phase' divided by RT, where R is the universal gas % constant and T is the temperature. For gase...
% function init_cpsearn % -------------------------------------------- dirS = directories_cpsearn(1); project_start('cps'); cd(dirS.progDir);
classdef Loperator %< handle properties %(SetAccess = protected) dim = 0; % space dimension d = 0; % label = []; % subdomains label A = []; b = []; c = []; a0 =[]; order = 0; sym = false; m=1; end methods function self=Loperator(dim,d,A,b,c,a0) if nargin==0, r...
% 三个点的顺序关系(x1, y1); (x2, y2); (x3, y3)。 function theta = calculate_theta_1(x1, x2, x3, y1, y2, y3) a = (x2 - x1).^2 + (y2 - y1).^2; b = (x3 - x2).^2 + (y3 - y2).^2; ab = (x2 - x1).* (x3 - x2) + (y2 - y1).* (y3 - y2); if a == 0 theta_t = zeros(size(b)); else for i = 1:length(b) if b(i) == 0 t...
function [loglikelihood] = anafun(parameters,data,edge_effect,toprint) g_data = data(1,1:20); t_data = data(1,21:140); vp_parameters = brocherizegrid(parameters); [g_ll,g_e] = gravfun(parameters,g_data,edge_effect); [t_ll,t_e] = tomfun(vp_parameters,t_data); g_ll = g_ll*10^(-1.5); if toprint dlmwrite('an...
function [ xCoord,yCoord,width,height,image] = eyesDetectionArea(imageFullPath) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here I = imread(imageFullPath);%Read input image. eyesDetect = vision.CascadeObjectDetector('EyePairBig'); bboxes=step(eyesDetect,I); %hold on %rectangle('Positio...
% Updated to Matlab2015 % MC feb15 clear close all %OPTIONS AND DESIGN PARAMETERS: i_scatter=1; % SIGNAL TO NOISE RATIO (dB) SNR=input('SNR(dB)='); % Inter-Symbol Distance dist=1; n_classes=4; %QPSK n_samples=[1000;1000;1000;1000]; ro= 0.5*ones(1,n_classes); %Correlation between...
function y = smoothEdgePenalty(x,xBnd,xDel,yMax) % y = smoothEdgePenalty(x,xBnd,xDel,yMax) % % This function computes a penalty curve, that is near yMax at each point % in xBnd, and near zero at mean(xBnd). The paramter xDel adjusts how % rapidly the function changes from ~0 -> ~1. It is based on the hyperbolic % tange...
function varargout = stats(varargin) %STATS Return defaults struct for functions in tbl.stats package % % params = cfg.stats(); % * This format returns full struct of parameters. % e.g. % >> params.var1 == 'something'; params.var2 == 'somethingelse'; ... % % [var1,var2,...] = cfg.stats('var1Name','var2Na...
% Grow a network exponentially % Probability of node s having k links at time t: p(k,s,t)=1/t*p(k-1,s,t-1)+(1-1/t)*p(k,s,t-1) % INPUTS: number of time-steps, t % OUTPUTs: edgelist, mx3 % GB, Last Updated: May 7, 2007 function el=exponential_growth_model(t) el=[1 2 1; 2 1 1]; % initialize with two connected nodes % f...
function [pspm_filename] = biopac_import(INFILENAME, OUTFILENAME) global verbose %% biopac_2_matlab % import the biopac text files into a MATLAB table if verbose tic fprintf('\nStep 1: Biopac Text file --> MATLAB...\n') end if ~exist(OUTFILENAME, 'file') datatable = biopactxt_2_matlab(INFILENAME); end if...
function plotDSDbytime(time,D,N_d) % plotDSDbytime(time,D,N_d) % This function plots DSD by time (diameter vs time vs concentration) % % JValdivia - 07, 2018 if ~isnumeric(time) time=datenum(time); end [t2, D2] = meshgrid(time, D); if ndims(N_d)>2, N_d=squeeze(N_d); end % if max(N_d(:))>1.5e1, N_d=lo...
function [segment,tc] = pcaseg(data,num_segments,q,flag) % [segment,tc] = pcaseg(data,num_segments,q,flag) % pcaseg.m - Bottom-up segmentation of multivariate time series using PCA based cost functions % Created by Zoltán Bankó, 2006 % Inputs: % data: multivariate time series (columns: variables) % ...
function [] = scores clear; [s, id] = get_scores_from_file; [rows, columns] = size(s); genScores = []; impScores = []; % % Ηistograms % % Place scores into genuine and impostor arrays for i = 1:rows for j = i + 1:columns if id(i) == id(j) % genuine...
function dist = findDistRoundPolygon(xIndex,yIndex,polygon) x = polygon(xIndex,:); y = polygon(yIndex,:); % is it faster to go left or right around the polygon? halfway = size(polygon,1)/2; % 1 2 3456 7 89 % -xIndex----yIndex-- 9 total halfway = 4.5. % yIndex - xIndex = 5 > halfway % faster to go from yIndex ...
% One step of clustering using Vector Quantization algorithm % Needs initilisation: vqinit + initrbf % variables needing init are: % delta : learning rate % m : unit positions (by initrbf) % % The algoritm works by moving the closest unit. This is here done batchwise, % dstcum=sigma2*0; dfcum=m*0; i=rows(data); whi...
%Import my original picture file I = imread('peppers.png'); %Convert image to grayscale (intensity) values for simplicity (for now) I = rgb2gray(I); %Determine the dimensions of the source image %Note that we will have three values - width, height, and the number %of color vectors, 3 [j k] = size(I) %Spec...