text
stringlengths
8
6.12M
function [coefs, centr_coefs] = mel_cepstrum(spectrum, ncepstrum) %MEL_CEPSTRUM calculates the mel cepstrum coefficients given the spectrum of %the signal log_spectrum = log(spectrum); [K, N] = size(spectrum); n = (1:ncepstrum)'; k = (1:K); W = cos(n.*(k-.5)*pi/K); coefs = W*log_spectrum; centr_coefs = (coe...
% Interactive Image Shortest Path on an Image % Author: Salaheddin Hosseinzadeh % Created on: 19/ Feb / 2016 % Last Rev: % Notes: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ShortestPath_V1() gets a binary image and determines the shortest path between two % points on the image usi...
clear all % Q = csvread('luminance.csv'); Q = [16 11 10 16 24 40 51 61; %luminance 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]; % Fungsi...
function S = hammersley(D,N) % HAMMERSLEY - Hammersley quasi-random sequence % % S = HAMMERSLEY(D,N) Generates N numbers from a D-dimensional % Hammersley quasirandom sequence using successive primes % as bases except for the last dimension which has the form % [1:N]'/N-1/2/N (where the last term modifie...
function autosize(display_flag, grade_input, accel_input, dv_bounds) %function autosize(display_flag, grade_goals, accel_goals, grade_tols, accel_tols, dv_bounds) %function autosize(grade_mph,grade_grade,accel_0_18,accel_0_30,accel_0_60,accel_40_60,accel_0_85,grade_mph_tol,grade_grade_tol,accel_0_18_tol,accel_0_30...
function [vioData, vioLabels] = violinData2(paraData, specSize) vecSize = 0; for g = 1:specSize currSize = size(paraData(:,g),1); vecSize = vecSize + currSize; end % violins will be ordered alphabetically regNames = 'b1'; % violins will be vecStart = 1; vioData = zeros(vecSize,1); vioLabels = c...
% Dynamic/static Self-Organizing Map function result = som_ds_h(input) %% Checking input dimension if size(input, 1) ~= 1 error('Wrong input row size'); elseif size(input, 2) ~= 30 error('Wrong input column size'); end %% Input computation global som_net_1 som_1_clusters; ...
function [] = proc_eps_chi_proc(basedir, rfid, Eps, S, save_name) %% [] proc_eps_chi_proc(basedir, rfid, Eps, S, [save_name]) % This function drives the epsilon processing of the Pitot-tube % for a single raw-files % % INPUT % basedir : unit directory % rfid : raw-file name ...
close all clear all %% 11.23(b) %% load('hw4data.mat'); %W = W5; % small case W = W10; % medium case %W = W50; % large case [n,n] = size(W); cvx_begin sdp variable X(n,n) symmetric minimize ( trace(W*X) ) subject to diag(X) == 1; X >= 0; cvx_end % SDP lower bound d_prime opt_value ...
function COR=ftr_r2(datafiles,predt,postdt,chs,cmode,tgtmrk) %r2=ftr_r2(datafiles,predt,postdt,chs,cmode,tgtmrk) % Calculate the correlation measure between a BCI target and fft-features. % 'datafiles' is a cell array of file names pointing to the eeg data to % be processed. The eeg data in all data-files should be u...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Copyright (C) 2020 TU Graz, ETH Zurich. % % Licensed under the Apache License, Version 2.0 (the "License"); % you may not use this file except in ...
function linelaser_calibration_rgb() %linelaser_calibration ラインレーザのCalibration % %.matファイルから変数群の呼び出し load fishparams.mat fisheyeParams load setup_rgb.mat linelaser_folder laser_step squareSize laser_time_margin ... margin bright_r_thr ref_circle_radi ref_r_thr ref_arcwidth linelaser_file_num ...
% This program forms the complex bus impedance matrix by the method % of building algorithm. Bus zero is taken as reference. % Copyright (c) 1998 by H. Saadat function [Zbus] = zbuild(linedata) nl = linedata(:,1); nr = linedata(:,2); R = linedata(:,3); X = linedata(:,4); nbr=length(linedata(:,1)); nbus = max...
%The first section of this code is here for the purposes of exploring %different values of AR+WN paramaters in order to match the power spectra %that we found in real data. Below that section is the section of code %that emplots ASLnoise_eff_112905, which computes efficiency, power, etc %for the different models. ...
% newstring = strrepNum(oldstring, startpoint, endpoint, newtext) % % Replaces a section from string OLDSTRING with string NEWTEXT. The % section is defined with numerical positions STARTPOINT and ENDPOINT. % % Unlike strrep, this works based on NUMERICAL POSITION within the string, % not based on a character substrin...
function [dilation] = dilation_matlab_kernel_Hill_lowbaseline2(c, t, NO_Mult, stim_duration, NO_sens, basalGC, Hz, radius) HOME = pwd; cd('C:\Users\wdh130\Documents\MATLAB\NOFeedbackData') delay = 6; %kernel size % delay = 15; %kernel size if t <= 0 try delete NO_history_temp2.csv catch ...
% Mission Planner Log Attitude Analysis % Rev 2.0 close all; clc; clear; format compact % pathname = uigetfile('C:\Users\Jordan Kirby\Dropbox\Vehicle Logs\', 'MATLAB Log File'); [filename, pathname, filterindex] = uigetfile( ... { '*.mat','MAT-files (*.mat)'}, ... 'Pick File(s)', ... 'MultiSelec...
function [score] = mlr2_csm_score(beta,FeaturesBundle,targetBundle) %CSM_SCORE : Cumilitative Success Model Score end
%{ # subject.LineAllele -> subject.Line -> subject.Allele %} classdef LineAllele < dj.Lookup properties contents = { 'VGAT-ChR2-EYFP', 'VGAT-ChR2-EYFP' 'Ai93-Emx1', 'Ai93' 'Ai93-Emx1', 'Emx1-Cre' 'Thy1-GP5.3', 'Thy1-GP5.3' 'Thy1-YFP', 'Thy1-YFP' ...
function s=POP(im, bParams, qParams, cartImage) % Apply polar onion peeling method for analyzing VMI images. The code % implements the method shown at G.M. Roberts et-al Rev. Sci. Instr. 80, 053104 (2009) % The code is limited to images no larger than 1024x1024 pixels, and uses % arbitrary (even) beta parameters. % % I...
function [T] = rot(u, theta) % This function generates a DCM corresponding to rotation % theta radians about a vector u. ux = u(1); uy = u(2); uz = u(3); T = [ux^2*(1-cos(theta))+cos(theta), ux*uy*(1-cos(theta))-uz*sin(theta), ux*uz*(1-cos(theta))+uy*sin(theta); ux*uy*(1-cos(theta))+uz*sin(theta), uy^2*(...
function [inputMovie, ResultsOutOriginal] = turboregMovie(inputMovie, varargin) % Motion corrects (using turboreg) a movie. % - Both turboreg (to get 2D translation coordinates) and registering images (transfturboreg, imwarp, imtransform) have been parallelized. % - Can also turboreg to one set of images and app...
%% Calculate 2DEG condunctivity %% \sigma = N e \mu % Sigma = Electrical Conductivity % e = Electron Charge % mu = Electron Mobility % From [1] % [1] Computational model of 2DEG mobility in AlGaN/GaN heterostructures % Karine Abgaryan*, Ilya Mutigullin, and Dmitry Reviznikov % Phys. Status Solidi C 12, No. 4–5, 460...
clc; close all; clear; x=imread('cameraman.tif'); subplot(3,3,1); imshow(x); for i=1:8 a=bitget(x,i); a=a*255; subplot(3,3,i+1); imshow(a); end
%% Stelling 3 % % In de onderstaande code worden twee vectoren (vec1 % en vec2) element-by-element met elkaar vermenigvuldigd: % % ------------code-------------- % vec1 = 0:10; % vec2 = 1:11;...
function TE_mode_field = TE_field(beta,index_mesh,x,k_zero) % Determines TE optical field for all layers % % x - grid created in mesh_x.m TotalMesh = length(x); % total number of mesh points % zz=beta*k_zero; % % Creation of constants at each mesh point kappa = 0; for n = 1:(TotalMesh) kappa(n)=sqrt((k_zero*index_m...
function step3_generate_surface_domain(gridfile,ensemblefile,nparam) % input, 1. 'global_sparse_grid.txt': sites information % input, 2. ALM_param.txt: parameter ensembles % input, 3, nvar: number of variable want to tune % output, surface and domain files, ready to be used by ELM-ECA-CNP ngrids = numel(textread(grid...
function crystal_id = getCrystalIDbyLUTmap(points2d,LUT_struct) %GETCRYSTALIDBYLUTMAP Summary of this function goes here % Detailed explanation goes here xx = LUT_struct.xx; yy = LUT_struct.yy; LUT = LUT_struct.LUT; % xx_id = nan(size(points2d,2),1); % yy_id = xx_id; % for ii_x = 1:size(xx,2) % idx = abs(point...
% initial clear; votes;mpparty;mpsex;mpdistrict; w = rand(100, 31); epochs = 100; eta = 0.2; % create output grids [x, y] = meshgrid(1 : 10, 1 : 10); xpos = reshape(x, 1, 100); ypos = reshape(y, 1, 100); mand = pdist2([xpos' ypos'], [xpos' ypos'], 'cityblock'); for i = 1 : epochs % updata neighbor neighbor = ...
x = load('sat.trn');
function [fsoft, fbone, fmetal, pho] = materialSegmentationMetalSharp( u, muSoft, muBone, muMetal ) % Material segmentation with sharp transitision between softtissue and % bone % Input: % img - image to segment % muSoft - attenuation of soft tissue % muBone - attenuation of bone...
function plotCartesianConfigSpace(kC,jointLimits,panHeight,legNum,color) vecLength = 20; %Generate vectors for alpha, beta and gamma. alpha = linspace(jointLimits(1,1),jointLimits(2,1),vecLength); gamma = linspace(jointLimits(1,3),jointLimits(2,3),vecLength); beta = asin((-panHeight+kC....
% gaussian proposal function test clear; close all % dis = gmdistribution([2; 4.6; 7.8], cat(3, 1, .5, .5), [.3, .3, .3]); % t = 0 : .05 : 12; % plot(t, pdf(dis, t')); % figure; % hist(random(dis, 1000), 50); % function 2 func2 = @(x) sin(x.^2); mu = linspace(-2*pi, 2*pi, 10)'; ww = ones(1, 10); dist2 = gmdistributio...
function [E] = cost_function(Y, Yd, type) %COST_FUNCTION compute the error between Yd and Y % inputs: % o Y (PxM) Output of the last layer of the network, should match % Y % o Yd (PxM) Ground truth % o type (string) type of the cost evaluation function % outputs: % o E (scalar) The err...
% cr1-nmf algorithm % See Z. Liu and V. Y. F. Tan, "Relative Error Bounds for Nonnegative Matrix % Factorization under a Geometric Assumption" % % [W,H] = cr1nmf( V,K ) % % Input. % V : (F x N) matrix to factorize % K : latent dimensionality % % Output. % (W,H) : final nonnega...
%KMeansRGB.m is a function that partitions the points, in an image, into k %clusters. Computation is done using the the k-means algorithm. %Inputs: image = 3D array with m rows, n columns and 3 layers, containing % an RGB image. % inimean = 3D array containing k rows, 1 column and 3 layers which % ...
% Solving coupled wave equations for SFG and DFG % Source: W. R. Boyd Nonlinear Optics (2nd ed. 2003) z_max = 10; z_min = 0; N = 400; z_stp = (z_max-z_min)/(N-1); z = (z_min:z_stp:z_max)'; vec_0 = [1;0;0]; [Z, SFG_ode45] = ode45(@func_SFG, z, vec_0); [Z, DFG_ode45] = ode45(@func_DFG, z, vec_0); figure('...
function plot_momentum_vs_delta_and_growth_rate(pa,boa,cs,gr,index_p, index_bo, CASE_ID) ss=get(0,'ScreenSize'); % [left, bottom, width, height] figure('Position',[ss(3)*0.2,ss(4)*0.3,ss(3)*0.6, ss(4)*0.45]) % index_bo=find(round(boa,2)==b0val,1); subplot(1,2,1) Deltas=squeeze(cs(:,index_bo)); %fprintf(1,'length o...
% E1 a = 0:0.1:2; b = ones(length(a),1); a*b b*a a.*b b.*a % a) Ce lungime trebuie s? aib? b astfel ca s? aib? sens înmul?irea (în sens matricial) a*b? %Ini?ializa?i în MATLAB cei doi vectori ?i realiza?i înmul?irea.Ce opera?ie se efectueaz?? %Raspus : b trebuie sa aiba un numar de linii egal cu numarul d...
function toggleGridDisplay(frame) %TOGGLEGRIDDISPLAY One-line description here, please. % % Inputs: % - frame: instance of PolygonsManagerMainFrame % Outputs : none % % Example % toggleGridDisplay % % See also % % ------ % Author: David Legland % e-mail: david.legland@inra.fr % Created: 2018-03-20, ...
function [a_sez,b_sez,polQ] = ONbaza(n,ro,am,bm) %funkcija vrne ortonormirano bazo polinomov do stopnje n glede na nek prej %določen skalarni produkt (ro je utež skalarnega produkta, ki ga računamo %integral po intervalu [am,bm]) %vhod: %n ... najvišja stopnja polinomov, ki sestavljajo bazo %ro ... utež skalarnega prod...
function d = point_to_segment(x,y,x2,y2,x3,y3) % % d est la distance euclidienne de P(x,y) au segment [P2(x2,y2),P3(x3,y3)] % A = zeros(2,2); dif = [x3-x2 , y3-y2 , 0]; % P3 - P2 A(1,1) = dot([x3 y3 0],dif); % (P3 | P3 - P2] A(1,2) = dot([x2 y2 0],dif); % (P2 | P3 - P2] A(2,:) = [1 1]; % b = [dot([x y 0],dif);1]; sol =...
root = 'C:\Matlab_files\NTIP\SCIn';
function [init_membership,final,bias,res_image,membership,objlist,means] = Q1(img_mri_masked,mask,init_means,ne_mask,q) obj = 10000; prev_obj = 0; trip_img = permute(cat(3,img_mri_masked,img_mri_masked,img_mri_masked),[3,1,2]); init_dist = (trip_img - init_means).^2; init_dist(init_dist<=0) = 10000; dist_mask = perm...
classdef IOCInstance < handle properties delta = 5e-4; % delta for numerical gradients winSize = 3; % window length to consider to calculate the basis features dynamicModel; features; % cost function features basisFeatureFlags; % a list of the basis features to calc...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Toolbox for Synthetic Neurobiology Group's ExM crew (Beta) %% Written by YGYOON on 02/11/2016. %% Updated by XX on XX/XX/2016. %% Updated by XX on XX/XX/2016. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ...
function testaudio() sampleRate = 44100; duration = 0.5; freqs = [100 200 300 400 500 600 700 800 900 1000 1100 1200]; [signal t] = generateTone(freqs, sampleRate, duration); sound(signal, sampleRate); %generates a tone (pure or complex) function [y t] = generateTone(freqs, sampleRate, duration) timeSamples = d...
function dat = handle_missing_in_qualitative(raw) dat = []; for i = 1:length(raw) val = raw(i); if iscell(val) val = cell2mat(val); end if isnan(val) dat{i} = 'other'; else dat{i} = val; end end
clc clear close all load 'IR_DATASET' %sim('test_16a.slx'); New_IR_Change(1)=IR(1); Time_Change(1)=TI(1); aa=2; for ii=1:length(IR)-1 if ((IR(ii+1)-IR(ii))~=0) New_IR_Change(aa)=IR(ii+1); Time_Change(aa)=TI(ii+1); aa=aa+1; end end for ii=1:length(New_IR_Change) set_param('test_16a/Co...
xmax = 24; taumax = 50; G = zeros(2*xmax-1, taumax); % creates a holding vector, % We need 2*xmax-1 because we want to go from -xmax, to xmax for dx = 0:(xmax-1); for tau = 0:(taumax-1); posxInd=xmax+dx; % We break the loop up into the negative negxInd=xmax-dx; % and positive x ...
function B = CalculateBoxSum(ii_im, x, y, w, h) if x == 1 && y == 1 B = ii_im(y+h-1, x+w-1); elseif x == 1 B = ii_im(y+h-1, x+w-1) - ii_im(y-1, x+w-1); elseif y == 1 B = ii_im(y+h-1, x+w-1) - ii_im(y+h-1, x-1); else B = ii_im(y+h-1, x+w-1) - ii_im(y+h-1, x-1) - ii_im(y-1, x+w-1) + ii_im(y-1, x-1); end...
function [errors, errorTags] = checkRequireChildTags(Maps, original, ... canonical) errors = ''; errorTags = {}; requireChildTags = Maps.requireChild; checkTags(original, canonical, false); function checkTags(originalTags, formattedTags, isGroup) % Checks the tags that require children numTags ...
%% Opdracht 3 % Gegeven is onderstaande code. Bereken het gemiddelde van de % vector 'getallen' zonder gebruik te maken van de standaard % Matlab functie mean(). % % Deze functie moet jezelf aanroepen m.b.v. een extra script. % Dat script mag je in dezelfde folder zetten als dit bestand. % Dat script wordt niet nagekek...
function sampleSPISeries %% % In a SPI (Standardized Precipitation Index) series peaks are distant at least 5 month one % from the other. Therefore the concept of "5 peaks over threshold per year" is meaningless. % It is possible to set the algorithm to examine just one percentile for % the POT, and doing just the GPD...
clear, clc % MATLAB Code % Generated by MATLAB(R) 9.0 and the DSP System Toolbox 9.2. % Generated on: 25-Jul-2016 13:10:30 % MATLAB Code generates an FIR-Filter. % The User can choose between Lowpass-, Highpass-, Bandpass- or % Bandstop-Filter. After the user definition ar given, the tool designs an % optimal FIR fil...
function wrapped = wrapmodel(model) % INTERFACE MODEL: For a model that accepts params and images % Pixels * (C * F) and returns predictions 1 * (C * F), return a wrapper model % that accepts params and an image set (C*F) * Pixels and returns % predictions (C*F) * 1 wrapped = @(params, PI)(permute(model(...
function [ objVal, objGrad ] = slaveLblDmRcErObj( wVec ) %SLAVELBLDMRCOBJ Slave evaluation of rc objective % assumes docThetas and bow data in global state %% setup params global state; modelParams = state.modelParams; dictSize = modelParams.DictSize; rvDim = modelParams.RepVecDim; numDocs = size(state.docBow,1); rcIn...
classdef RigidJoint < CoordinateFrame % A coordinate frame that is rigidly attached to the origin a rigid % joint and the child link of the joint. In addition, this class stores % the type, rotation axis, child link, and limit of the rigid joints. % % Copyright (c) 2016-2017, AMBER Lab % All rig...
function ocrResults = performOCR(roi) % Program Description %Performs optical character recognition on an image, given a certain region %of interest % % Function Call %performOCR(roi) % % Input Arguments %roi is the region of interest. Specify roi as a four-element vector of %the form [x y w h] in data units. The x a...
% % SCRIPT feb13 % % MODIFIED: APR2013 AAR %now doing oneback clear all play_var=0; %if play_var=1 use stupid line which is to skip problem with number of extra contrast need to delete %curr_task=input('enter 1 for learn task, and 2 for categ task: ') spm fMRI curr_task=1; %1= oneback s...
clc clear all close all set(0,'language','en') % set(0,'language','ja') set(0,'defaultAxesFontSize',13,'defaultTextFontSize',13) set(0,'defaultAxesFontName','Helvetica', 'defaultTextFontName','Helvetica') set(0, 'DefaultAxesLineWidth', 1, 'DefaultLineLineWidth', 2) %% set parameters % -- simulation time-- t_end...
function printVertSeams(img, vertSeam) img1 = img; [dimY, ~, dimD] = size(img); n = size(vertSeam, 2); for y = 1:dimY for x = 1:n img1(y,vertSeam(y,x),1) = 1; img1(y,vertSeam(y,x),2) = 0; img1(y,vertSeam(y,x),3) = 0; end; end; fi...
%% Carga de parámetros clc,clear; run('.\param.m'); %% Parametros de simulación % Simulación de cinemática inversa q0 = homeConfiguration(robot); ik = inverseKinematics('RigidBodyTree', robot); weights = [0, 0, 0, 1, 1, 1]; endEffector = 'tool'; qInitial = q0; % Use home configuration as the initial guess %% Planificad...
function params = gendata_params() % simulation parameters params.f = 1e-4; % coriolis parameter params.deltaT = 500; % timestep params.n_periods = 12; params.dx = 2.5e3; params.dy = 2.5e3; % wavenumber and forcing frequency params.k = []; params.om = []; % pressure forcing parameters params.p0 = 5; % Pressure forci...
%% tackles all steps of correlation display % however assumes that data is coming over from within bo_runmain cues = 1:4; clear rho* rhotimeStart = 0; % start analysis window rhotimeStop = 10; % stop analysis window clr = [0 0 0;170 170 170;0,101,245;204,20,0]/255; figure; clr = [0.3 0.77 0.99;... 0.88 ...
function obj = updateConstraintBounds(obj, bounds, varargin) % This function updates the boundary conditions of the optimization % variable by updating corresponding NLP variables % % % Parameters: % bounds: a structed data stores the boundary information of the % NLP variables @type struc...
function [A_new, b_new, type_new, origem_new] = remove_redundant_constraints(A, b, type_new, origem_new, Nu, Nstate, options) %[A_new, b_new] = remove_redundant_constraints(A, b, type_new, origem_new, Nu, Nstate, options) % %Remove the redundant constraints of a polyehdral defined by Ax<=b. %Inputs: % A, b -...
function I = NORMALIZE_image(I,k) %CODE FOR THE PAPER %"Exploratory Dijkstra forest based automatic vessel segmentation: applications in video indirect ophthalmoscopy (VIO)", %R. Estrada, C. Tomasi, M. T. Cabrera, D.K. Wallace, S.F. Freedman, S. Farsiu %Biomedical Optics Express, 3(2), pp. 327-339. Feb. 2012. %COPYRIG...
function [hfid,etags] = he2hf(heid,mesh,etags) fid=heid2fid(heid); leid=heid2leid(heid); origin_vertex=mesh.faces(fid,leid); next=[2,3,1]; terminal_vertex=mesh.faces(fid,next(leid)); [hfid,etags] = obtain_1ring_elems_tet_he( origin_vertex, terminal_vertex, mesh, etags);
% Jan Heimann | 14th July 2017 path_frei = {'./csv_data/freifeld_#1.csv','./csv_data/freifeld_#2.csv','./csv_data/freifeld_#3.csv','./csv_data/freifeld_#4.csv','./csv_data/freifeld_#5.csv','./csv_data/freifeld_#6.csv','./csv_data/freifeld_#7.csv','./csv_data/freifeld_#8.csv','./csv_data/freifeld_#9.csv','./csv_data/fr...
% Example 3.13_1 % 应用动量BP算法训练BP网络 % %clf reset; %figure(gcf) %setfsize(500,200); echo on %NEWFF — 建立一个BP网络 %TRAIN — 对网络进行训练 %SIM — 对网络进行仿真 pause clc P = [0 1 0 1; 0 0 1 1]; % T为目标矢量 T = [0,1,1,0] plotpv(P,T); %plot(P,T,'+'); title('Training Vectors'); xlabel('Input Vector P'); ylabel('Target Vector T'); pause n...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % SIMULATION OF HOLOGRAM OF AN OBJECT RECORDED WITH PLANE WAVES % Author: Tatiana Latychevskaia %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Citation for this code/algorithm or any of its parts: % Tatiana Latych...
clc; rng('shuffle') found_solutions = 0; errors = 0; failures = 0; i=0; while true result.nt = randi(3)+1; result.nr = randi(3)+1; result.timeLine_size = randi(10); result.nSegments = 5+randi(15); result.sample_size = 2+randi(10); result.max_iterations = 200; %arguments for the FFDummie result.hashSize = 1...
%% select_legend_eco % graphical user interface for setting legend using eco-codes for a given taxon %% function legend = select_legend_eco(legend, taxon) % created 2018/05/30 by Bas Kooijman %% Syntax % legend = <../select_legend_eco.m *select_legend_eco*> (legend, taxon) %% Description % Select or edit a legend us...
function imout = RegionFill_Nearest(im, mask) % Given input image and mask. For each selected pixel in mask, replace corresponding % pixel in image with nearest unmarked pixel value. % % A simple, but poor image infilling tool % % im = imread('peppers.png'); % mask = zeros([size(im,1),size(im,2)]); % im(200:250, 250:3...
% PARAM_VL3 % Zadanie parametrov Strejcovho prenosu % Volane z - PARAM_VL2, aj sa tam vrati % 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....
clc clear digits(36); nPointsOnEdge = 3; ngpts = vpa(nPointsOnEdge); [pG,wG] = Gaussian_Quadrature(ngpts); pG = pG / 2; quad_pos_1d = pG; nPoints = 4 * nPointsOnEdge + nPointsOnEdge^2; x = zeros(nPoints,1); y = zeros(nPoints,1); % ! Left x(nPointsOnEdge*0+1:nPointsOnEdge*1) = -0.5; y(nPointsOnEdge*0+1:nPointsOnE...
mean_max_conductance_activation(21) ste_max_conductance_activation(21) mean_vhalf_activation ste_vhalf_activation mean_sigslope_normalized_activation_all ste_sigslope_normalized_activation_all mean_vhalf_inactivation ste_vhalf_inactivation mean_sigslope_normalized_inactivation_all ste_sigslope_normalized_inactivation_a...
%% Solves qs 2.9 for assignment 1 % The following function solves the given linear system via Gaussian % elimination without and with pivoting function GaussianElimination() % initialize A, B and X A = ones(2,2); B = ones(2,1); X = ones(2,1); % x_ans is a [1 1] vector, the solution as given in question x_ans = ones...
function [S,M] = process_data(cam_frames,cam_pos, motor_times, motor_vol, i) if(size(cam_frames,1)==1) cam_frames = cam_frames'; end if(size(cam_pos,1)==1) cam_pos = cam_pos'; end if(size(motor_times,1)==1) motor_times = motor_times'; end if(size(motor_vol,1)==1) motor_vol = motor_vol'; end A = 1.7^2*...
% Este programa retorna a resposta do exercício 19 da lista 1. disp('19)Qual a relação do número de dentes necessária para que engrenagens motora e movida girem respectivamente a 100 e 300 rpm?') Nmotora=100 %rotação em rpm. Nmovida=300 %rotação em rpm. disp('19)A resposta do exercício 19 da lista 1 é : a relaçã...
function [x, stats] = spg(FG, P, x, opts) % SPG Spectral projected gradient. % Parse options. if nargin == 3 || ~isstruct(opts) opts = []; end if isempty(P) P = @(X)X; end if ~isfield(opts,'pgtol') || isempty(opts.pgtol) opts.pgtol = 1e-6; end if ~isfield(opts,'maxit') || ise...
function [debtrank, equityLoss, num_default, num_iter] ... = nonlinear_debtrank(interbankLiabilitiesMatrix, ... equityBeforeShock, shock, max_iter, alpha) % debtrank(:,1) is the final value of debtrank (initial shock subtracted) % debtrank(:,2) is the final v...
function [ g ] = spatialThresholds( f, xBins, yBins ) [h, w] = size(f); g = zeros(size(f)); for i=1:xBins for j=1:yBins xLow = floor(w * (i - 1) / xBins ); xHigh = floor(w * i/ xBins); yLow = floor(h * (j - 1)/yBins); yHigh = floor(h * j/yBin...
function [h,x,y] = plot_fuzzy_vars(fzx,fzy) n = length(fzx); x = zeros(n,1); y = zeros(n,1); errxU = zeros(n,1); erryU = zeros(n,1); errxD = zeros(n,1); erryD = zeros(n,1); for i = 1:n x(i) = fzx{i}.getNum_val; % errxD(i) = fzx{i}.getNum_val - fzx{i}.getInterv.getMin; % errx...
%Name: Matlab/CUDA: Signals and Systems Lab 2nd %Auther: Changgang Zheng %Student Number UESTC:2016200302027 %Student Number UoG:2289258z %Institution: Glasgow College UESCT function problem_1st x=sym('sin(2*pi*t/T)'); % creat the sybolic expression of the signal x5=subs(x,'T','5'); ...
%Developed by Atharva Kulkarni(16070123129) %Date:11/1/2019 %Version: 1.0 %This code will plot a sine wave and a cosine wave in a single graph clc; %clears the command window clear all; %removes items from matlab work...
function [v, e, angle, iscut] = convertDatatoVE(data) % function [V,E,angle,iscut] = convertDatatoVE(data) if (isempty(data)) v = zeros(0,2); e = zeros(0,2); angle = zeros(0,1); iscut = false(0,1); warning('This structure is empty.'); return; end v = [[data.x];[data.y]]'; e = cell2mat(arrayfu...
function [out, t] = count_predicted_flags(flags) % Conta le occorrenze di ogni orientamento. o = categorical(cellstr(flags), {'**', '*0', '*1', '00', '01', '10', '11'}, 'Protected', true); c = countcats(o); % Pesa le occorrenze in modo che la loro somma sia 1: % - assegna peso nullo alle ...
% Driver software for determining the mie optical parameters for biological % cells to feed into BioSNICAR. Calls mie.m, which should be available in % workspace. Written by Joseph Cook (University of Sheffield, UK), Feb 2017. %User defined inputs = CELL DIAMETER (line 12) AND ABSORPTION COEFFICIENT %(PROVIDE BY ...
function [bb,l,h]=xyz2blh(x,y,z,ell) % XYZ2BLH Transformation to ellipsoidal coordinates using Cartesian coordinates. % XYZ2BLH(X,Y,Z) transforms the given coordinates % X, Y, Z [m] into ellipsoidal latitude B, % longitude L [deg.dec] and the height above % the ellipsoid H [m]. No negative heights! ...
function XN = cordNoi(cord, nN) % Generate 3-D noise point. % % Input % cord - cordinates, 3 x kJ x nF % nN - #noise points % % Output % XN - 3-d noise, 3 x nN x nF % % History % create - Feng Zhou (zhfe99@gmail.com), 12-29-2008 % modify - Feng Zhou (zhfe99@gmail.com), 02-27-2013 % functi...
function traceQualManual = plotEftManTracesROIs(C_df, S_df, dFOF, A2, mask_eft, CC, CC_rois, eftMatchIdx_mask, im, C, inds2plot, manualTraceQual, plothists, im2, cs_frtrs) % use the following to evaluate A and C of Efty's algorithm without % comparing with the manual method: % inds2plot = 1:size(C,1); % plotEftManT...
clc clear close all Fs = 1000; % samples per second dt = 1/Fs; % seconds per sample StopTime = 1; % seconds Time = (0:dt:StopTime)'; Sig = chirp(Time, 50, StopTime, 450, 'quadratic'); N = 15; WinLen = 100; Chirplet = GLCT(Sig, N, Fs, WinLen); ChirpletPowerSpect = abs(Chirplet).^2; figure(1); subplot(2, 2, 1)...
function [verbose,verboseI,debug,optTol,progTol,maxFunEvals,maxIter,Damped,... corrections,useMex,HvFunc,LS_init,LS_interp,LS_multi,c1,c2] = processInputOptions(o) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here verbose = 1; verboseI = 1; debug = 0; o = toUpper(o); LS_init = 0; ...
function gui_check_sleep_scoring(channels,label1,labelconditions,labelconditions2,rats,fs) %SELECT RAT(S). opts.Resize = 'on'; opts.WindowStyle = 'modal'; opts.Interpreter = 'tex'; prompt=strcat('\bf Select a rat#. Options:','{ }',num2str(rats)); answer = inputdlg(prompt,'Input',[2 30],{''},opts); Rat=str2double(answ...
% Script to evaluate the times and errors for a 2.5 lambda radius piston % (as in the FNM circle paper published in JASA in 2003) with the apodized % FNM expression. datestr(now) f0 = 2.5e6; % excitation frequency % atten = 0; % no attenuation soundspeed = 1500; % m/s lambda = soundspeed / f0; % wavelengt...
json_path = 'index.json'; json_data = json.read(json_path); output_json = {}; figure for i = 1:length(json_data) [~, image_name, ext] = fileparts(json_data(i).output_path); im = imread([image_name, ext]); imshow(im) [~, ~, button] = ginput(1); if button == 'f' output_json(end + 1) = {json...
function [ data ] = recognition(data, recog_test, p,s, window) %RECOGNITION %Summary goes here global deviceIndex KbQueueRelease(deviceIndex); KbName('UnifyKeyNames') %% ---------------------------------------------------------------------- % Starting Recognition Trials % --------------------------------------------...
%% Test the general performance of the PCA implementation N = 100; F = 15000; X = rand([F, N]); tic; [Y, W] = new_pca(X); toc %% Check whether the result is normalised when applied whitening assert(sum(sum((abs(Y * Y' - eye(N-1))))) < 1e-6, ... 'Output Y must be normalised');