text
stringlengths
8
6.12M
test_image = rgb2gray(im2single(imread('../data/Notre Dame/4191453057_c86028ce1f_o.jpg'))); hold on; figure(1); colormap(gray) axis equal; axis off imagesc(test_image); [x, y, confidence] = get_interest_points(test_image, 16); plot(x,y,'*'); title('Interest points detected using connected components'); set(gca,'YDir',...
function [error1,error2,error3] = findErrorOverPaths(plotFig,fignum,plotName,ad1,ad2,ad3,ad4,bd1,bd2,bd3,bd4,cd1,cd2,cd3,cd4,dd1,dd2,dd3,dd4,ed1,ed2,ed3,ed4,fd1,fd2,fd3,fd4) % error = findDistanceErrors(plotBar,ad1,ad2,ad3,ad4,bd1,bd2,bd3,bd4,cd1,cd2,cd3,cd4,dd1,dd2,dd3,dd4,ed1,ed2,ed3,ed4,fd1,fd2,fd3,fd4) % % dt...
%********************************************************************* % Theory of the Hilbert Spectrum: Code Examples for Reproducible Research %********************************************************************* % % Description: This Demo file shows various visualizations for the % Simple AM Component...
function [ results ] = ... execute_show( show, config, ... track_config, novelty_config ) if( nargin < 2 ) config = config_getdefault; end if( nargin < 3 ) track_config = []; end if( nargin < 4 ) novelty_config = []; end tic; show ...
% % initialize_SpFreqWindows.m % % This function is called once when intializing the spFreq_windows array at % the beginning of the main function. % % Explanation of variables: % windows - the structure that contains all the information % surrounding windows. % amp_window...
global gam bet... % preference parameters rk rh eta... % production parameters dk dh... % depreciation rates k % curvature of alpha functions
function phaseout = parameterizedDynamics(input, weights, iocObject) w = weights'; w = w/sum(w); x = input.phase.state; u = input.phase.control; t = input.phase.time; % Compute current time increase and update value in iocInstance dt = t(2) - t(1); iocObject.dt = dt; dof...
clc, close all, clear all Po=[1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0]; P=[0 1 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]; b=-0.5; alpha=0.1; w=[1, 0]; l=length(Po); hold on for i=1:l a=hardlim((w(1)*Po(i))+(w(2)*P(i))+b); w(2)=w(2)+(alpha*a*P(i)); scatter(i,w(2)...
function [J, grad] = costFunctionReg(theta, X, y, lambda) %COSTFUNCTIONREG Compute cost and gradient for logistic regression with regularization % J = COSTFUNCTIONREG(theta, X, y, lambda) computes the cost of using % theta as the parameter for regularized logistic regression and the % gradient of the cost w.r.t. ...
function color = rew_color() color = [159, 54, 41]/255; end
%% Prueba mapas clc clear all close all % figure % set(gcf,'numbertitle','off','name','Imagen entrada') img = imread('img/dog.jpg'); r = double(img(177:1200,897:1920,1)); g = double(img(177:1200,897:1920,2)); b = double(img(177:1200,897:1920,3)); % img = imread('img/portada.jpg'); % r = double(img(177:1200,:,1)); ...
clc;clear all;close all %DCT Image Compression [x,y] = uigetfile('*.jpg*','select the grayscale image'); % here ...x=filename;y=pathname filewithpath=strcat(y,x); imgtemp =imread(filewithpath); originalimage=imgtemp; img=originalimage; %checking for colored image imgr = rgb2gray(originalimage); figure imshow(...
function [FE, eigE, AM, groupSizes, eigVec] = spectralMethod(trajData) % change this parameter according to model d = 4; % spectral method runs on same number of grid points as trajectory D = trajData.D; N = trajData.N; T = trajData.T; Dmat = zeros(d*N); Mmat = zeros(d*N); for i = 1:N ...
%% QUICKTE - quick transfer entropy calculation % Calculates the transfer entropy between two variables. The data can be % continuous or discrete. If the data is single trial, the transfer % entropy is calculated through time. If the data is trial based, the % transfer entropy is calculated at each time point in th...
function[fX,CX] = Arianne1(me) % Constantes k = [0.1101;0.1532;0.2154]; ve = [2647.2;2922.4;4344.3]; mv = 1700; V = 11527; % Critère fX = sum((1+k).*me) + mv; % Contraintes Mf = [mv + (k(3)+1)*me(3) + (k(2)+1)*me(2) + k(1)*me(1); mv + (k(3)+1)*me(3) + k(2)*me(2); mv + k(3)*me(3)]; CX = sum(ve.*log(1+me./M...
% inIntense.m % finds intensity in inner ROI % Inputs: % img = image for intensity measurement % BWinner = binary inner ROI % r = row outline locations % c = column outline locations % kSize = ROI size % % Outputs: % innerIntensity = vector of intensity values % % Written by Carolyn Pehlke % Laboratory for Optical and...
function[y2]=awgnbinary(y,s) %y=awgnbinary(y,snr) y2=awgn(y,s); [r,c]=size(y2); % th=sum(sum(y))/numel(y); th=.5; for i=1:r for j=1:c if y2(i,j)>th y2(i,j)=1; end if y2(i,j)<=th y2(i,j)=0; end end end end
function [Jforce,Mforce,Jdispl,Mdispl] = ... truss3(n,m,joint,assembly,forceJ,stretch,index) % % THIS COMES FROM THE SILVERBERG MATLAB TOOLBOX, I DID NOT WRITE IT % It is included to be used with my simulated bridge file % % truss3 solves space truss problems. % truss3 calculates: % % ...
clear all; close all; Maire = 4; nbSymb = 8; Fd = 2000; % le débit symbole Fe = 16000; % Fréquance d'échantillonage nbEchan = Fe/Fd; % Nombre d'échantillons par symbole Td = 1/Fd; % Temps symbole Te = 1/Fe; % Temps échantillon T = 1; %seconde Fp = 1/T; % nombres des pulses per seconde seqEng = ran...
function res = normal( X, sigma, mu ) % Computes the likelihood that the data X have been generated from the given % parameters (mu, sigma) of the one-dimensional normal distribution. % TODO fill out this function res = exp( -sum((X-mu).^2./(sigma^2))/2 )/sqrt((2*pi*(sigma^2))^size(X,1));
% SB9, SB8, SB7, AND SB6. % Juan Carlos Martinez % February 8th, 2015 % Last Update: February 11th, 2015 sb9='SB9.csv'; sb8='SB8.csv'; sb7='SB7.csv'; sb6='SB6.csv'; sb9table=readtable(sb9); sb8table=readtable(sb8); sb7table=readtable(sb7); sb6table=readtable(sb6); speedsb9=table2array(sb9table(:,2)); speedsb8=table2...
syms y(x); eqn = diff(y, x) == 3*x + y/2; functionalValue = @(x, y) 3*x + y/2; xAxisValues(1)=input('Enter the initial x: '); yAxisValue(1)=input('Enter the initial y: '); cond = y(xAxisValues(1)) == yAxisValue(1); calculatingValue=input('Enter the calculating value: '); h=input('Enter step size h : '); numberO...
% script to load and plot data from Bullock/Day study. clear close all rootfolder = fileparts( mfilename('fullpath')); datafolder = fullfile(rootfolder,'noblesville_data'); matlabdatafile.G = fullfile(datafolder,'G'); matlabdatafile.veharrivals_agg = fullfile(datafolder,'veharrivals_agg'); matlabdatafile.veharrivals_...
function W = morlet_wavelet(t,fc,sigma_tc) % MORLET_WAVELET: Returns the complex Morlet wavelet for a specified central frequency and % % USAGE: W = morlet_wavelet(t,fc,sigma_tc) % % INPUTS: % - t : timepoints where the wavelet will be calculated % - fc : central frequency % - sigma_tc: sta...
function [ Zsurf ] = phase2surf( p,z_light,z_sensor,x1,x2,y1,y2,h,A1,A2,B1,B2 ) %========================================================================== %function used data collected when parallel light rays shoot down onto a %to reconstruct an unknown flat surface %-----------------------------Inputs-----------...
function newBoxes = expandBoundingBox(Boxes, scaleFactor, Isize) size(Boxes); numBoxes = length(Boxes); for bLoop = 1:numBoxes CurrentBox = Boxes(bLoop).BoundingBox; % X-coordinate of bounding box's upper left corner - (width of region*scaleFactor) newLeft = CurrentBox(1) - round(CurrentBox(3) * s...
function saverseqdata6(projname) input_dir = '/public/home/ciac_liwb/metabolism/rnaseq2/'; file_name = [input_dir projname '.txt']; load('gly_tcaop_ge2.mat','gly','tcaop'); [rdata1,genes1,sample1] = extractrseqdata2(file_name,gly); [rdata2,genes2,sample2] = extractrseqdata2(file_name,tcaop); data_sign1 = ones(1,leng...
function result = sig_ilddistfun_nlinfit(beta,dist_ild); %Order of beta: %beta(1) : width or sigma of gaussian %beta(2) : height of the sigmoidal part of the function %beta(3) : beta for sigmoid2 %beta(4) : shift for sigmoid2 %beta(5) : maximal activity equation = normpdf(dist_ild,0,beta(1)) + sigmoid2(dist_il...
%%% Model first developped by of Scranton & Vasseur 2016 (Theor Ecol.) %%% Script by Picoche & Barraquand 2018 %%% This script draws Fig.1 of the article (temperature and biomass time %%% series) clear all; close all; clc; ylast=2*365; %Will look at the last two years thresh_min=10^(-6); %below the threshold, species...
function recordOutput(whichHalf, pressurePoint, data, savefilename) global pressureSum global count global calInfo global calInfoFile array = reshape(data, 32, 32); pressureSum = pressureSum + array; if count == 100 pressureMean = pressureSum./100; if strcmp(wh...
%LA3 %________________FUNCTION 1_____________ subplot(2,1,1); %To see the graphs I shared, make the step value 0.01 and final value 2 step = input('For the FIRST equation: \nPlease enter a step value:\n'); final_x = input('For the FIRST equation: \nPlease enter a final x value:\n'); x= [0:step:final_x]; %initialize...
clear close all %% variables that you could change ap.num = 36; % the number of access points (must be square of interger) grid.num = 900; % the number of fingerprinting grids (must be square of interger) ue.density = ap.num; % the density of user equipments ap.tx_power = 0.2*ones(1,ap.num); % the tx power of a...
function n_opt = AMIGO_lcurve_curvature(X,R,alpha,plot_flag) %AMIGO_lcurve_curvature(X,R,alpha) computes the optimal regularization parameter % based on the L-curve maximal curvature detection method. % % Inputs: % R residuals matrix, each column corresponding to the regularization parameter. % X solution mat...
function qimage=dctquantise2(X,qstep) Qtable=qstep*(1/10)*[16 11 10 16 24 40 51 61; 12 12 14 19 26 58 60 55; 14 13 16 24 40 57 69 56; 14 17 22 29 51 87 80 62; 18 22 37 56 68 109 103 77; 24 35 55 64 81 104 113 92;49 64 78 87 103 121 120 101;72 92 95 98 112 100 103 99]; [m,n]=size(X); qimage=zeros(m,n...
% Testing of the system model - ASK DARWIN % % Author : Jonathan EDEN % Created : 2016 % Description : classdef SystemModelTest < matlab.unittest.TestCase % Create the model objects for testing properties (ClassSetupParameter) model_config_type = struct('SCDM', 'test_SCDM', ... ...
function A = Aq(q,u) A = [0 1; 10 0]+[0;-10]*[1 0]; end
function [x f Eprime] = staCMR (data, E) % data is cell array of data or structured output from staSTATS % E is partial order % returns: % x = best fitting CMR values to y-means % f = fit statistic tol=10e-5; if nargin == 1 E = {}; end if isempty(E) E = {}; end if ~iscell(data) y = outSTATS ...
function arrSlice = cadProcessing(workingDir, first, last) tic imagesDir = 'images'; imageNames = dir(fullfile(workingDir, imagesDir, '*.dcm')); imageNames = {imageNames.name}; f1 = 'images'; f2 = 'detected'; f3 = 'metrics'; f4 = 'textureFeatures'; f5 = 'depth'; f6 = 'rank'; ...
clear clc tic %-------------------------------------------------------------------------- % initial values % Number of iterations and samples n = 20000; % Number of Experiments T = 1000; % SNR_db : [5 10 15 25] SNR_dB = 5; % L is length of Filter L = 16; % Mu is step size parameter for LMS algorithms ...
%-------------------------------------------------------- %pad the image to make height and width multiples of N %-------------------------------------------------------- function y = pad_image(x,N) [ht,wt] = size(x); padcol = N-mod(wt,N); if(padcol ~= N) %need padding padleft = floor(padco...
function B=bilinear_basis_functions(x, y, x0, y0) x=double(x); y=double(y); [xg, x0g]=ndgrid(x(:), x0); [yg, y0g]=ndgrid(y(:), y0); if length(x0) > 1 Bx=sparse([], [], [], size(xg, 1), size(xg,2), min([length(x0) 4])*length(x)); delta_norm=(xg(:, 1:end-1)-x0g(:, 1:end-1))./(x0g(:, 2:end)-x0g(:, 1:end-1)); ...
%Usage: %[M]= fnPerformanceMeasure(bestNet, actualNet) %Inputs: %bestNet: the inferred network %actualNet: the actual netwrok or the benchmark network used to compare the inferred network %Output: %M: vector of performance metrics function M= fnPerformanceMeasure(bestNet, actualNet) %DOING PERFORMANCE MEASURES [n m...
classdef ORB < vicos.keypoint_detector.OpenCvKeypointDetector % ORB - OpenCV ORB keypoint detector % % (C) 2015-2016, Rok Mandeljc <rok.mandeljc@fri.uni-lj.si> properties implementation upright end methods function self = ORB (varargin) % self = ORB...
%% Stelling 11 % % De onderstaande code maakt een bestand genaamd 'output.asc' % met door een mens leesbare tekst. % % ======= Code ======= % tijdvector = 0:0.01:3 ...
%%question 1 %%this function reduces all the intensities in the image below t to 0, %%otherwise sets them equal to 255 function out = intthreshold(image, t) out = (image > t )*255; end
%Question 2 clc;clear; fun = @(R) (sqrt(2*R/(1+R))-1) + sqrt(1/R)*(1-sqrt(2/(1+R))) - (sqrt(2)-1)*(1+sqrt(1/R)); R0 = 1; Ra = fsolve(fun,R0); S = [2;5;10;11;12;15]; for i = 1:length(S) funb = @(R) (sqrt(2*R/(1+R))-1) + sqrt(1/R)*(1-sqrt(2/(1+R))) - ((sqrt(2*R*S(i)/(1+R*S(i)))-1) + sqrt(1/(R*S(i)))*(s...
function f = continuousObjective(x) %Decision variables % nrot L b, C, theta0, thetaMin, Airfoil %Fixed variables R = 0.5; omega = 600; %RPM = 4774 g = 9.8; %Decision variables nrot = x(1); L = x(2); b = x(3); C = x(4); theta0 = x(5); thetaMin = x(6); airfoil = x(7); if airfoil == 0 datum = load('NACA0012...
function stZ = sola(varargin); % stZ = OVERLAPADD(stX, stY) % stZ = overlapadd(stX, stY, maxoffset) % % stX : structure form % stX.vec = signal % stX.i1 = beginning index % stX.i2 = ending index % % Example) % stX.i1 = 101; stX.i2 = 180; stX.vec = sin( (stX.i1:stX.i2)/5 ); % stY.i1 = 130...
% % Dados do arquivo %Wp=400; %Hp=300; % Dados da camera alpha=75*pi/180; % Dados da geometria S0=0.20; save('data.dat','alpha','S0')
classdef class4 %wszystkie obliczenia wykonywane sa w konstruktorze properties f0 B3 R Q0 Q w0 L C A0 A end methods function o = class4(p1,p2,p3,p4) o.f0 = p1; o.B3 = p2; o.R = p3...
clear all close all clc %% Ejercicio 4 % Aplicar el método del punto fijo a la función f = x^7 +11x -1 % Declaramos la funcion f = @(x) x.^7 + 11.*x -1; %% Vamos a buscar primero un candidato a cero x = -1:0.001:1; y = f(x); figure; plot(x,y) % El "cero" ronda c = 0 (0.0909... según Wolfram) %% Hacemos una prueba %...
A=[3 -0.1 -0.2; 0.1 7 -0.3; 0.3 -0.2 10]; b=[7.85; -19.3; 71.4]; n=size(A,1); x = EliminacaodeGauss(A, b, n); fprintf("O resultado encontrado:"); display(x); function x = EliminacaodeGauss(A, b, n) for k=1:n-1 for i=k+1:n M = A(i,k)/A(k,k); A(i,k) = 0; for j=k+1:n ...
clear; clc; close all; global t; global y; load('matlab.mat') y1 = y(:,1); Ts = 0.001; T = 0.001; cost_max = 0.6; confidence = 1.0; reward = 0; penalty = 0; subplot(2,1,1) plot(t, y1); hold on; % initial point cost = period_to_cost_map(T, t, y1); scatter(T, cost) title('Input-Cost Mapping') % first trial T = T...
%% MathPendel_Bearbeitungsfile.m % - Systemmatrix erstellen % - Anfangsbedingungen einsetzen % - Loesung der Gleichung mit verschiedenen numerischen Verfahren % berechnen % - Lakale und Globale Fehler berechnen % - Zeitschritte optimieren und vergleichen % -----------------------------------------------...
function [newimg] = focusOnCenterWeighted(img,p_threshold_density,window,slide) width = size(img,2); height = size(img,1); colordepth = size(img,3); windowsize = window*window; centerwidth = width/2; centerheight = height/2; maxdistance = ((width/2)^2+(height/2)^2)^.5; newimg = img; window_r = 0; window_g = 0; window...
figure; Compo = 10; for k = 1:Compo x = Y(:,k); x = x/max(x); x = reshape(x,[192,168]); subplot(1,Compo,k);imshow(x); end % clc;close all;clear all; % load data.mat; x = Y(:,2); % z = min(x); % x = x-z; % x = x./max(x); % x = reshape(x,[192,168]); % figure; imshow(x);
function model = xacmes_buildModel_SVR(cur_state,coeff) global algo; N = cur_state.N; aSZ = algo.aSZ; if (0) ARX = algo.ARX; ARF = algo.ARF; end; if (1) ARneval = algo.ARneval(1,1:aSZ); [ARneval, arindex] = sort(ARneval,2,'ascend'); ARX = algo.ARX(:,arindex); ARF = algo.ARF(1,arindex); end; in...
%{ Copyright (c) 1995-2010 Peter Kovesi Centre for Exploration Targeting School of Earth and Environment The University of Western Australia Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without ...
clear all; close all hidden; clc; %#ok<CLALL> try % Setting random generator seed and state load('s.mat'); rng(s); fig_num=99; USB_ch=1; IAC = -1; FS_tag = 3; Fs = 48828.125; [f1RZ,RZ,FS]=load_play_circuit(FS_tag,fig_num,USB_ch,0,IAC); ...
nested_dissection_block_structure_base; text( (part1+0)/2, (part1+0)/2, 'V_1', 'HorizontalAlignment','center', 'VerticalAlignment', 'middle') text( (part2+part1)/2, (part2+part1)/2, 'V_2', 'HorizontalAlignment','center', 'VerticalAlignment', 'middle') text( (N + partS)/2, (N + partS)/2, 'S_0', 'HorizontalAlignment','c...
function [y,x,noise,sigma,outliers] = spectMixGen(M,samp_size,varargin) %% % Usage: % [y,x,noise,outliers] = spectMixGen(M,samp_size,varargin) % % This function generates a simulated spectral data set % % y = M*x+noise % % where M is the mixing matrix containing the endmembers, x is the % the fractions (sources) of...
%------------------------------------------------------------------- % This program: load the excel file % read the task time table grouped by desks % write the task arrive interval into excel files % % Please put the .xlsx file in the same folder with this program %------------------...
function [ Ncell, EToV ] = InitLineConnect1d(N) %InitQuadConnect2d - Description % % Syntax: [ Ncell, EToV ] = InitQuadConnect2d(input) % % Long description Ncell = N; EToV = zeros(2, Ncell); for sk = 1:Ncell EToV(:, sk) = [ sk, sk+1 ]'; end end
function draw_shifthistogram xr = -60:60; function m = plot_shift(r,plt) x = r.agr.shifts; h = histc(x,xr); h = conv(h,hamming(5),'same'); plot(xr,h,plt) m = max( h ); end mx = 0; r = load('results/agres_all-mean_21-Sep-2014.mat','agr'); mx = max( mx, plot_shift(r,'k'...
function calcToa = signalToa(sig1, sig2, ch1, ch2, Fs, pf, db) % % frequency values are read in at in hz % % number of values read in L = length(sig1); if L/2 ~= round(L/2) L = L-1; sig1 = sig1(1:L); sig2 = sig2(1:L); end %% plotting the output wave if db figure() t = 1:length(sig1); plot(t, ...
% Test Cases: [str1] = luge('Albert Demchenko-208.00-Felix Loch-207.53-Armin Zoeggeler-208.80'); [str1_soln] = luge_soln('Albert Demchenko-208.00-Felix Loch-207.53-Armin Zoeggeler-208.80'); % str1 => Felix Loch is the winner of the 2018 Olympics for luge, with a time of 207.53 seconds! % [str2] = luge('Addison-453.2...
function Y = iqfft2(X, A, L) % IQFFT2 Inverse Discrete quaternion Fourier transform. % % This function calculates the inverse fast quaternion 2D Fourier transform % of X. The second parameter, A, specifies the transform axis (that is the % direction in 3-space of the vector part of the hypercomplex exponential). % It m...
function [freq,y]=WZM_SP(par,varnames,... params_const, varnames_const,... sp_fname,par_fname,params_const_fname,bat_fname,raw_fname) % y=LPF7_SP(p,sp_fname,par_fname,bat_fname,raw_fname) % Funkcja obliczająca przy pomocy NgSpice wartości % |Av(f)| dla wartości f zapisanych w pliku analizy układu % Wartoś...
function [F] = empcdf(X, t) %UNTITLED4 Summary of this function goes here % Detailed explanation goes here N = length(X); F = zeros(N,1); for i = 1:length(t) F(i) = (1/N)*sum(X<=t(i)); end end
function [TS]=MOCplottersata(start,stop,Plot,resolution,option) close all if nargin ~= 5 ; disp('input error'); fprintf('input 5 variables: \n Start year, Stop year,\n Plot=1 or no Plot=0,\n Resolution 5 or 6km,\n Options:\n 1= Nautilus_fulltopo_nodiff, \n 2 = Iridis fulltopo full diff,\n Iridis Slope7 ') end gl...
% Foundation Class: SYObject. % Written by Satoshi Yamashita. % The most fundamental superclass of all SY-classes, declaring principal % methods. classdef SYObject < handle properties end methods function obj = init(obj) % Initialization method. % obj = init(obj) % Implemented by subclasses. end function delete...
% 05-2012 % Victor Barres % USC Brain Project % Script to create the source wave for the dipoles function data_sourceWave(varargin) if isempty(varargin) simName = getSimName(); else simName = varargin{1}; end simPath = sprintf('simulations\\%s',simName); load(sprintf('%s\\dBoxcar',simPath)); load(sprintf('...
function [ outSeq ] = expDecay( inSeq, days ) %EXPDACAY 指数衰减n天作为权重,影响后面的日子,加权平均 % 理论上,n->inf时, mv.expDecay(s, n) -> mv.expSmooth(s, 1 - 1/e) % 程刚,20140913 %% 前处理 if ~exist('days','var'), days = 0; end days = round(days); if days<0, days =0; end %% 挑出非nan的干净的inSeq, 并留下index inSeq2 = inSeq(~isnan(inSeq))...
close all; clear variables; % read in image image=imread('koch.jpg'); % normalize the image into a normalized matrix [0, 1] image=double(image)/255; P=input('compression amount\n'); % ask for compression amount [l,w,h] = size(image); U = zeros(l,l,3); S = zeros(l,l,3); V = zeros(w,l,3); img = zeros(size(image)); ...
% File: Connect.m @ FastObj % Mail: johannesrebling@gmail.com % Description: convenience function to have unified syntax function Connect(Obj) Obj.Open_Connection(); Obj.Reset(); % channels = Obj.channels(); % % channels(1).inputrange = 10000; % [mV] % channels(1).term = 1; % 1: 50 ohm termination, 0: 1MO...
classdef Parallelization % A bunch of methods related to IO operations on matreces. methods(Static=true) function machines = getTargetMachines() machines = {}; targetMachinesUvanimor = 0:9; targetMachinesLhug = [0:7 9:11]; for(i=targetMachinesUvanimor) machines{end+1} = ['uvanimor-' ...
function y = expgauss(beta0, x); %beta0(1): peak %beta0(2): exp tau %beta0(5): center %beta0(6): gaussian width % 1/2*erfc[(s^2-tau*x)/{sqrt(2)*s*tau}] * exp[s^2/2/tau^2 - x/tau] global gui; global spc; pulseI=spc.datainfo.pulseInt / spc.datainfo.psPerUnit*1000; y1 = beta0(1)*exp(beta0(6)^2/2/beta0(2)^2 - (x-beta0(5)...
% change_precision.m % N_BLOKS % BLOCK_SIZE % N_SAMPLES N_BLOCKS=1e3; BLOCK_SIZE=1e1; N_SAMPLES=N_BLOCKS*BLOCK_SIZE; prec_spec=[N_BLOCKS,BLOCK_SIZE,N_SAMPLES]; %save precision.mat N_BLOCKS BLOCK_SIZE N_SAMPLES; save precision.mat prec_spec;
% loadData: Load data for an experiment, in a format % compatible with test[method_name].m scripts. % % REQUIRES: % The script uses the EXPERIMENT structure containing % experiment parameters (see RUN_TESTS.m). % % RETURNS: % Given a dataset name, the script should load the % following matrices into memory : % % D - s...
% Section 5 % close all; clear all; [x, y] = meshgrid(0:0.005:1); z = 1 - y - x; RGB_709 = [0.64 0.3 0.15;0.33 0.6 0.06;0.03 0.1 0.79]; M_709 = RGB_709 * eye(3); [m, n] = size(x); XYZ = zeros(m,n,3); XYZ(:,:,1) = x; XYZ(:,:,2) = y; XYZ(:,:,3) = z; rgb = zeros(m,n,3); for p = 1:m for q = 1:n rgb(p,q,:) = M_709...
%{ Universidade Federal de Uberlândia Faculdade de Engenharia Elétrica Graduação em Engenharia Biomédica Instrumentação Biomédica II Decrição: Deve-se utilizar o gráfico do arquivo "Onda PAi-fl1.pdf" e gerar um gráfico similar no MatLab e levantar as harmonicas dessa onda. Docente: Eduardo Borges Gouveia Di...
function Y = ReLU(V) Y = max(0,V); end
% fabberttest.m % does a t test between two fabber datasets % MT Cherukara clear; % specify this stuff dname = '/gm_DBV.nii.gz'; fab1 = '114'; fab2 = '117'; % load the data resdir = '/Users/mattcher/Documents/DPhil/Data/Fabber_Results/'; fdn1 = dir([resdir,'fabber_',fab1,'_*']); fdn2 = dir([resdir,'fabber_',fab2,'_*...
function varargout = image3gui(varargin) % IMAGE3GUI M-file for image3gui.fig % IMAGE3GUI, by itself, creates a new IMAGE3GUI or raises the existing % singleton*. % % H = IMAGE3GUI returns the handle to a new IMAGE3GUI or the handle to % the existing singleton*. % % IMAGE3GUI('CALLBACK',hObject...
function [bin,xxx]=en_sub3d_sub2_sub(r,lB,nr,cr,cri,cfk,nck,thd) %xxx=0; binz=en_zone_new(r,lB,nr); %[length(r) sum(r) length(binz)] if round(thd/3)~=thd/3, typ=1; else, typ=2; end if thd==2 [z1,cf11,cf12]=separate(cfk,thdh); cf11=cf11-thdh; [cr1,k,r1,lB1,pr,nr1]=k_criterion(z1); binz1=en_zone_new(r1,lB1,...
function Data=drawLotto_LSRAmed(Data,trial,Win,Img) % Data struct specifies the % Trial specifies prob, val, ambig % Probability for each color if strcmp(Data.colorKey{Data.colors(trial)},'blue') redProb=1-Data.probs(trial); blueProb=Data.probs(trial); elseif strcmp(Data.colorKey{Data.colors(trial)},'red') ...
function [Img, time] = deblur_main( fileName, blurLevel, isResize ) %% The program interface for user % INPUT % fileName (string) the filename of blurry image % blurLevel (scalar) the blurry level 1:small, 2:medium(default), 3:large % isResize (scalar) whether to do resize. 1:...
%confusionmatStats.m Example a=randi(2,1,100); b=randi(2,1,100); stats=confusionmatStats(a,b);
k=0.6; xref=30; x=0:0.5:100; y=1./(1+exp(-k*(x-xref))); plot(x,y); grid on
function r = hessianinit(v,see) %HESSIANINIT Initialization of hessian variable % % x = hessianinit(v) % %The independent variable(s) x are identified and initialized with value(s) v. % v may be scalar for one independent variable, or vector (or matrix) % for several independent variables. % %The call % % hessiani...
function dGrf_heel_c2_dfx = dGrf_heel_c2_dfx(in1,in2,Fx,H,k,cmax,dmax,us,sampT) %DGRF_HEEL_C2_DFX % DGRF_HEEL_C2_DFX = DGRF_HEEL_C2_DFX(IN1,IN2,FX,H,K,CMAX,DMAX,US,SAMPT) % This function was generated by the Symbolic Math Toolbox version 8.5. % 30-Oct-2020 16:52:14 dGrf_heel_c2_dfx = Fx.*2.0;
function h = PlotRepeat(X,Y,pattern,varargin) %PlotRepeat - Plot repeated (tiled) copies of the data. % % USAGE % % h = PlotRepeat(X,Y,pattern,<options>,<options2>) % % X abscissae % Y ordinates % pattern 'xxy','xyy' or 'xxyy' depending on repeated axes % <options> ...
function [matr] = ftn(arr, n) % Summary: Generates matrix from row vector arr in which the nth column is % the n-delayed version of arr % Input: Row vector to shift, Number of maximal shifts % Output: The generated [n x(length(arr)+n*Tc)] matrix % Tc: Chip duration taken from global_constants.m % Attention: NOT WORKING...
function VMT_ExportFIG(path,fignum,BkgdColor,AxColor,FigColor,FntSize,Res,Format) %This script exports the given figure and formats it according to the %specified properties: %BkgdColor: Background Color (outside of figure space) %AxColor: Axes Color %FigColor: Figure window color (inside figure Space) %F...
function MyDetectedImage = ImageDetections(MyImageName,MaskSize,ConvMasks,OutputName) %IMAGEDETECTIONS uses the function parameters from My2dFilters to call the %pixel window size and type of convolution masks. Uses the parameters from RGB and %Greyscale to call outputName for the save file function. Finally uses %MyIm...
% ZISKAT_GS3 % % Volane zo - ZISKAT_GS % pre tlmene kmitavy model % Copyright is with the following author(s): % % (c) 2012 Juraj Oravec, Slovak University of Technology in Bratislava, % juraj.oravec@stuba.sk % (c) 2012 Monika Bakosova, Slovak University of Technology in Bratislava, % monika.bakosova@stuba.sk % --...
function [ orig ] = watersRecal(raw,replace) %watersRecal - for a given centroid mode file, replace the cal line %function either with the 000 line, or with the original text in order to %restore the file as it was % From the 'raw' file path, determine the name of the header file head = [raw filesep '_HEADER.TXT']; %...
function [cores] = parallel_start( pools ) %PARALLEL_START spins up POOLS matlabpools or 1 per avaialble core if POOLS % is not specified. % % Written By: Michael Hutchins switch nargin case 0 cores = feature('numcores'); case 1 cores = pools; end % Check fo...
function y = myFxEx(N, X, DeltaX, lambda, myFx) X = X + lambda * DeltaX; y = feval(myFx, X); end
function D = dice(img1, img2) % % Computer DICE coeficient % inter = (img1 & img2); common=sum(inter(:)); cm=sum(img1(:)); % the number of voxels in m co=sum(img2(:)); % the number of voxels in o D = (2*common)/(cm+co);