text
stringlengths
8
6.12M
%=============Author:小范同学================% %=======福州大学物理与信息工程学院===========% %==============2020.06.06==================% %=============通信原理课程设计==============% function varargout = Login(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton...
% FACEDEMO Illustrates how to use the Kin2 object to get and draw the % face data % % Note: You must add to the windows path the bin directory containing the % Kinect20.Face.dll. % For example: C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\bin % % Juan R. Terven, jrterven@hotmail.com % Diana M. Cordova...
function outopt = param_select_stokes(tol,inopt)%,ErrorType %Control that at least L and xi are given, compute x and f if not %given, select N =10 if not given % tol = varargin{1}; % inopt = varargin{2}; % ErrorType = varargin{3}; % checkInopt(inopt); outopt.xi = inopt.xi; F = sum(norm(...
% Description: FSE 100 - Lab #3 - Post Lab - Diode IV % Author: Anthony Kosednar % Date: 09/11/2012 % I-V Curve Diode % Define Variables v = [-5.0 -4.47 -3.99 -3.50 -3 -2.45 -2.02 -1.51 -1.04 -0.70 -0.15 0.15 0.70 1.04 1.51 2.02 2.45 3 3.50 3.99 4.47 5.0] i = [0 0 0 0 0 0 0 0 0 0 0 0 0.13 0.46 0.86 1.31 1.7 2.19 2.64 ...
function demo_Supervoxel %Demo function for video segmentation using supervoxel %2013.11 - Liang Yuling addpath(genpath('algorithms')); % parameter settng sigma = 30; %gaussian parameter PATCH_SIZE = 25; % initial supervoxel size(seeds) 12-200sp alpha = 0.0003; % RW parameter pictureDir = './data'; pictureName = ...
function[m] = meannan(v,dim) %takes the mean along the columns of a vector or matrix %it ignores any nans that it comes across if nargin < 2 dim = 1; end ind = isnan(v); numnan = sum(ind,dim); v_nonan = v; v_nonan(ind) = 0; v_sum = sum(v_nonan,dim); N = size(v,dim)-numnan; ind = find(N==0); N(ind) = NaN; ...
function [x,isterm,dir] = eventfun_V2(t,Y,p) %% Evaluating size of derivatives t = 0; %the t variable isn't used but needs to be defined. rhss = dAdt_efficient_correct_V2(t,Y,p); x = norm(rhss) - 1e-7; isterm = 1; dir = 0; %or -1, doesn't matter end
function [orbit,fixedpoint] = findorbit4(RING,dP,varargin) %FINDORBIT4 finds closed orbit in the 4-d transverse phase % space by numerically solving for a fixed point of the one turn % map M calculated with LINEPASS % % (X, PX, Y, PY, dP2, CT2 ) = M (X, PX, Y, PY, dP1, CT1) % % under the CONSTANT MOM...
function main() %生成数据 TotalVNFs = 6; %VNF的种类 N_Reqs = 100; %生成数据 [nodes, G, n] = genNodes('pdh.txt'); % [nodes, G, n] = readNodesFile('nodes.txt'); requests = genRequests(TotalVNFs, N_Reqs, n); % requests = readReqFile('service_request.txt'); vnfs = genVNFs(TotalVNFs); % vnfs ...
% ADVISOR data file: WH_SMCAR_IDEAL.m % % Data source: % % Data confirmation: % % Notes: % Defines tire, wheel, and axle assembly parameters for use with ADVISOR 3.0, for % a hypothetical small car. Ideal system - no losses. % % Created on: 12/20/00 % By: Tony Markel, NREL, tony_markel@nrel.gov % % Revision history ...
function [ a ] = SpeedOfSound( gamma, t ) % Calculate the local speed of sound based on static values R = 287; a = sqrt(gamma * R * t); end
function [dy] = pendulumSIMULATE(t,y,weird,action,time) %x_bar = y - xy; %angle = y(1) - xy(1); %if angle < 0 % complement = 2*pi + angle; %else % complement = 2*pi - angle; %end %if angle < abs(complement) % x_bar(1) = angle; %else % x_bar(1) = complement; %end %u = -K*x_bar; %if u > 5 % u = 5; %end %if...
function process_all_ddbb % This function compute the ECG for the processed ddbbs % contained in path_ddbb. Results are stored in path_res % % by Felipe Alonso-Atienza (felipe.alonso@urjc.es) % www.tsc.urjc.es/~felipe.alonso clc, close all; path_ddbb = '../data/preprocessed ddbbs/'; path_res = '../data/computed par...
function gmt = predict_gm_thickness(brwt, bvol) % Function for computing grey matter thickness (cm) from brain volume % using regression log-baesd regression in Hofman (1989), eqn 9 (Fig 8 caption) % % Input: % brwt: brain weight (g) % bvol: [native units] brain volume (cm^3) % % Output: % gmt: grey matter thic...
% clusterLevelPermutationTest2x2() - Performs permutation test between 2x2 samples. For multiple comparison % correction, cluster-level correction is applied [1]. % % Reference: [1] Groppe, Urbach, Kutas, 2011. Mass univariate analysis of % ...
function scores = runKristianEval(frames,imagePaths,images,tfs) import affineDetectors.*; curDir = pwd; krisDir = helpers.getKristianDir(); if(~exist(krisDir,'dir')) error('Kristian''s benchmark not found, cannot run\n'); end scores = zeros(1,numel(frames));scores(1,1) = 1; addpath('./'); for i = 2:numel(frames) ...
function X = newton2(th1, th2, th3,x,y,z) %NEWTON 이 함수의 요약 설명 위치 % 자세한 설명 위치 tol = 0.01; X = [th1;th2;th3]; while(1) th1 = X(1,1); th2 = X(2,1); th3 = X(3,1); X_prev = X; F = [1000000*cos(th1)*cos(th2) - 1000000*cos(th1)*sin(th2)*sin(th3) + 1000000*cos(th1)*cos(th2)*cos(th3)-x...
%% xiaomeng added global bitValue; global ExpFileName BenchmarkNetFileName; global populationSize; % ExpFileName = 'data_ICMPeEPI_5genes_unique.txt'; % BenchmarkNetFileName = 'benchmark_ICMPeEPI_5genes.txt'; bitValue = zeros(1, 32); for i = 1:32 bitValue(i) = 2^(i-1); end %% global num_gene; global num_celltype;...
clear;clc; close all; addpath(genpath('Functions')); ProjectName = 'sheng'; %%%%% RhythmMode = {'evoked','ivectorlow','ivectorhigh'}; % % 'evoked' 'ivectorlow' 'ivectorhigh' 'isingle10' 'vectorlow' SensorMode = 'all'; % 'batch' 'all' 'scouts' Compare_Field = 'C'; file_location = [ '/dataslow/sheng/Project of Sheng/Re...
function paddedArray= padToSquare(inArray,padSize) % Pad inArray with by padSizex factor (calculated on largest dim) % dimension. Adjust padding in each dimension so that paddedArray has the % same size in all dimensions imsize= size(inArray); longestDim= max(imsize); padding= floor(padSize.*longestDim - lo...
function [HYST,BACKBONE,UNLOAD,RELOAD] = GENSTEPPEDHYSTERESIS_ADMS(nlresfun, contactfun, ... Xstat, msp, Alphamax, Np, ... MESH, M, L, opt, QuadMats, varargin) %GENSTEPPEDHYSTERESIS_ADMS Quasi-statically extracts the Hysteresis an...
function y = wcodemat(x,nb,opt,absol) %WCODEMAT Extended pseudocolor matrix scaling. % Y = WCODEMAT(X,NBCODES,OPT,ABSOL) returns a coded version % of input matrix X if ABSOL=0, or ABS(X) if ABSOL is % nonzero, using the first NBCODES integers. % Coding can be done row-wise (OPT='row' or 'r'), columnwise % (...
function rp = ringpara(THERING,varargin) %rp = ringpara, use global THERING %rp = ringpara(THERING) %rp = ringpara(THERING,U0), supply total radiation loss in MeV %calculate various ring parameters %(1) The calculation of emittance, mcf, momentum spread, bunch length, damping time, etc %is more accurate than ats...
% Slides for Joyce's image quality presentations. % 1. The photopic luminance curve load xyz plot(wavelength,XYZ(:,2),'-') grid on xlabel('Wavelength (nm)') ylabel('Responsivity') set(gca,'xlim',[350 750]); print -deps photopic.eps % 2. The XYZ functions plot(wavelength,XYZ(:,1),'r-', ... wavelength,XYZ(:,2),'...
function [crmfe] = crmfeADL(x,y) [CoFull FitInfFull] = lasso(x(:,2:end), x(:,1)); BasketFull_1 = find(CoFull(:,1)); NewvariablesX = x(:,BasketFull_1+1); NewvariablesY = y(:,BasketFull_1+1); beta = (NewvariablesX'*NewvariablesX)^(-1)*NewvariablesX'*x(:,1); actualReslt = y(:,1); testResult = beta' * [ones(length(actualRe...
clear clc MAXDIST=40; %camera settings -- Phantom 4 f=3.6; psize=0.00156192; sensorWidth=4000; sensorHeight=3000; cameraInteriors=struct; cameraInteriors.f=f; cameraInteriors.cw=sensorWidth*psize; cameraInteriors.ch=sensorHeight*psize; cameraInteriors.psize=psize; cameraInteriors.sensorWidth=senso...
function [dp1 dp2] = my_dpmafc(pcorrect, m) % function [dp1 dp2] = my_dpmafc(pcorrect, m) % Computes d-prime for mAFC tasks. % pcorrect: proportion of correct responses. % m: number of alternatives. % % dp1 is accurate for m < 12. % % Both estimates of d-prime according to: % Smith, JE: Simple algorithms for M-alterna...
%Number 4 in Review %read the image pollock, obtain a subimage that is the lower right quad %Step one is to read in the image img = imread('pollock.jpg'); imshow(img); [row, col, ~] = size(img); %Take into account a remainder before splitting image into 4 row_rem = mod(row,2); col_rem = mod(col,2); %We w...
% Definicion de las variables para la matriz de adyacencia N=4; C=1; S=2; R=3; W=4; grafo=zeros(N,N); grafo(C,[R S])=1; grafo(R,W)=1; grafo(S,W)=1; % Definicion de los parametros del grafo nodosDiscretos=1:N; % 2 porque solo pueden ser true o false tallaNodos=2*ones(1,N); % creacion de la red bayesia...
function [solution] = ... prototype(gradTol,stepTol,ObjFuncTol,maxOptItr,maxSubProbItr,basisTreshold) % Prototype for reduced model based topology optimization clc; % Problem interface directories addpath ./interface2/; addpath /scratch/maguilo/research/matlab/intrelab/tools/; addpath /scratch/maguilo/research/mat...
## użycie: calculate_DH(Z,A) ## ## Funckja implementuje algorytm Denavita-Hartenberga. Macierz 'Z' zawiera ## wektory definiujące kolejne osie 'z'. 'A' jest tablicą komórek, przechowującą ## macierze 4x4, za pomocą których można odwzorować układy współrzędnych ## kolejnych wektorów do bazowego układu współrzednych. W...
function CA_Code = CAcodegen(PRN,LEN) % GPS L1接收机本地伪码产生函数定义 % 输入输出定义: % 函数输入变量:PRN为卫星号(1~32),LEN为产生伪码长度,1023点为一个完整伪码周 % 期,可设为1023 % 函数输出变量:CACode为长度LEN的伪码序列,双极性(+1,-1) NUM=10;% 移位寄存器级数 g2s = [5; 6; 7; 8; 17; 18; 139;140; 141;251;252;254;255;256;257;258; 469;470;471;472;473;474;509;512; ...
function simplecorrelation (root, reference) % function simplecorrelation (root, reference) if isstr(root) all_data = read_img_series(root); fprintf('\n Done reading the data. crunching ...'); hnames = dir(sprintf('%s*.hdr',root)); h = read_hdr(hnames(1).name); else all_data=root; end rmap = zeros( 1, size(a...
function res = rats3(t, y) a = 0.005; omega = 2 * pi / 365; res = a * y * (1 + 2*sin(omega * t)); end
%******************************************************************** %Damage Evolution code for Intervertebral Discs %Created for CFDRC project %Author: Shruti Motiwale %******************************************************************** clear all; tic disc_num=2; %% Load input data for civilians n_days1=365*30; %...
function [tasa_aciertos,training_mlp,test_mlp] = som(n_iteraciones,filas_smo,columnas_smo,alfa_inicial) #ENTRENAMIENTO lines = dlmread('originalFiles/digitos.entrena.normalizados.txt',' '); longitud_fichero = length(lines(:,1)); tamanyo_entrada = length(lines(1,:)); tamanyo_salida = 10; #el fichero esta ...
function [NormHys, Amplitude, Offset, FitLine1, FitLine2] = branchnormalizehys(Field,HysVals,FitRange) % Centers and normalizes hysteresis loop % No slope correction % FitRange = [+minimum field, +maximum field] MinField = min(Field); MaxField = max(Field); BranchMask = true(length(Field),1).'; BranchMask(floor(lengt...
function Q10b(bx,by,gx,gy) % Original header: maxDist(bx,by,gx,gy) % Determine and print the maximum center-to-center distance from all % possible pairs of disks that consist of one blue and one green disks. % bx and by are vectors of the same length; % bx(k) and by(k) are the x- and y-coordinates of % the center of th...
%set up constants %sample time for fixed step size solver Tsample = .001; simTime = 5; %simulation time in seconds %Motor torque constant Kt = 1; %motor electrical constant Ke = 1; %armature resistance R = 1; %moment of inertia of reaction wheel (and rotor) IWheels = [1 1 1]; ISat = [1 1 1]; %moment of inertia o...
classdef EventHandler < handle properties miss_events = 0; swap_events = 0; mach_events = 0; end methods function matched_marker(obj,src,evtdata) obj.mach_events = obj.mach_events+1; disp(['Frame ' num2str(evtdata.iter_i...
%define clusters load('ws_Canaa_1990_1997.mat', 'diffMapa') h9097 = length(unique(diffMapa))%3 clusters load('ws_Canaa_1997_2000.mat', 'diffMapa') h9700 = length(unique(diffMapa))%3 clusters load('ws_Canaa_2000_2011.mat', 'diffMapa') h0011 = length(unique(diffMapa))%4 clusters clear diffMapa %% ExpectationMaximizati...
function [info] = jlaSampleMatch %jlaSampleMatch - DESI file matching for reprocessing James's DESI samples % Main h5 folder h5Main = ['/Volumes/Data/Lab Data/Colorectal/JLA Samples/'... 'Fresh frozen/TO BE ORGANISED/Exactive/'... 'DESI -ve mode update 17.7.17/H5 files/']; h5M = fileFinderAll(h5Main,'h5',true)...
%Testing Random Waypoint mobility model. s_input = struct('V_POSITION_X_INTERVAL',[0 5],...%(m) 'V_POSITION_Y_INTERVAL',[0 5],...%(m) 'V_SPEED_INTERVAL',[1 2],...%(m/s) 'V_PAUSE_INTERVAL',[10 30],...%pause time (s) 'V_WALK_INTERVAL',[2.00 6.00...
function [Radar] = reading_HYDRA_C_data(pname, stDate, enDate, fname) %%% Reading C-band radar data %%% [Radar] = reading_HYDRA_C_data(pname, stDate, enDate, fname) %%% pname - path to the data files %%% stDate and enDate are starting and end dates of the event in the %%% Matlab datenum format %%% fname - something li...
function RHS = matEvaluateConservativeNonhydrostaticRHS(obj, fphys, PhysClass) RHS = 2 * fphys{1}(:,:,5) + fphys{1}(:,:,1) .* obj.hux - fphys{1}(:,:,2) .* obj.HBx; end
function out= fourier(inp) % 1912.12302.B7 global lambda; global beta; lb=lambda; m=gpuArray(0:2*lb-1); out=zeros(1,4*lambda,'gpuArray'); for k=-2*lb:2*lb-1 idx=k+2*lb+1; aa=sum(exp((pi.*1i.*m.*(k + 0.5))./lb).*inp(2*lb+1:4*lb)); out(idx)=aa; end out=out.*beta./(2*lambda); end
function imgBlend = reconFBP2dMultiResolutionOld( sino, geom, window, nrsl, scale ) % Fan-beam CT filtered backpeoject reconstruction % multi-resoltion piecewise linear frequency response FBP % inout: % sino - log sinogram % geom - geometry parameters % window - window function % nrsl ...
function [ F ] = center( F ) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here n = sum(F,2)/2; d = size(F,2); F = F - repmat(n,1,d); end
function prueba_22_03_21(muestras) delete(instrfind({'Port'},{'COM4'})); %%Modificar puerto a=serial('com4'); set(a,'BaudRate',115200); fopen(a);%%Inicializa puerto A=fscanf(a,'%f'); s=0; for i=1:(muestras) A=fscanf(a,'%f'); Temp1(i)=A(1,1); Humi1(i)=A(2,1); %Temp2(i)=A(3,1); %BME280 %Humi2(i)=A(...
%gradient descent script while (~converged ) [prior,prior_penalty] = prior_calculator(Current_Iterative_Image,prior_type,gamma); likelihood = Current_Iterative_Image - imageNoisy; Checker_Current = Current_Iterative_Image - 2*s*((1-alpha)*likelihood+(alpha)*prior); %note: Xi-yi is the likelihood ...
clc; close all; clear; %% Extracting data % ----Human forces filename_dumpForces = 'humanForces/data.log'; forces = parseHumanForces(filename_dumpForces, 2); % since this dataset consider only the 2 forces exchanged with the % forceplates. % ----Human state filename_dumpState = 'humanState/data.log'; state = pars...
function [deltaDatetime] = datestrDiff(dateStr1, dateStr2, inputFormat) %DATESTRDIFF Compare the input date strings and output the difference %(dateStr2 - dateStr1) as a datetime object. % % By default, inputFormat = 'yyyy/MM/dd HH:mm:ss', corresponding to the % output format datetimeFormat = 'yyyy/mm/dd HH:MM:ss' for ...
function [outcome,deck,count,pcards,dcards] = softhand(pcards,dcards,deck,count) dd = 1; % Will change to 2 if player decides to double down while 1 % Check if Dealer has 21 if (dcards(1) == 1 && dcards(2) == 10) || ... (dcards(1) == 10 && dcards(2) == 1) dcards(find(dcards==1,1)) = 11; % ...
clear all clc N = 100; epsi = linspace(-6,6,N); a = linspace(-2,3,N); kappa = 0.5; sol = zeros(2); dot = zeros(N*N,2); T = 2*pi; t = 0:T/2:T; num_sol = 1; h = waitbar(0,'Initializing waitbar...'); for i=1:N for ii=1:N A =@(t,x) [x(2);... -kappa*x(2)-(a(i)-epsi(ii)*cos(t))*x(1)]; [~,theta] = ode113(A, ...
function orbitODE_solver(a,e,i,O,w,t0,tf) % Constants G = 6.67430e-20; % Gravitational Constant (in km) ME = 5.9725e24; % Mass of Earth mu = G*ME; % Gravitational Parameter for Earth % Rotation Matrices C1_i = [1, 0, 0; 0, cos(i), sin(i); 0, -sin(i), cos(i)]; C3_...
%% Different waveforms clear, close all fs = 44100; t = (0:44100-1)/fs; f = 1; deltaPhase = 2 * pi * f / fs; phase = 0; phaseVector = zeros(1,length(t)); for i=1:length(t) phase = phase + deltaPhase; phaseVector(i) = phase; end sineWave = sin(phaseVector); squareWave = (phaseVector < ...
close all;clear all clf % Classical Interband Drude-Sommerfeld Model of Gold c = 3e8; w = 2*pi*linspace(1e14,1.5e15 ,1e4); % w = 2*pi*linspace(5e14,6.0e14 ,1e4); f = w/(2*pi); l = 3e8./f; % wp = 45e14; % gamma = 8.35e-16; % ll = 450e-9; % w0 = 2*pi*c/ll; % e_d = 4; % e_g = 1 + wp^2./((w0^2 - w.^2) - 1i*gamma*w); ...
function datetime_vals = generate_datetimes(time_in_hours, start_time) % DATETIME_VALS = GENERATE_DATETIMES(TIME_IN_HOURS, START_TIME) % % Turn numeric data collection time points (in hours) into MATLAB datetimes % DATETIME_VALS used by the circa diem toolbox. % % If no START_TIME is provided, DATETIME_VALS are gener...
function lk = grec(X,EM) mu = EM{2}; sigma = EM{3}; phi = EM{1}; d = size(X,2); k = size(EM{1},2); m = size(X,1); lk = zeros(m,k); for i = 1:k % lk(:,i) = mvnpdf(X,mu(i,:),sigma{i}); sigma_p = sigma{i}; meanDiff = bsxfun(@minus, X, mu...
function write_nls_file(fname, data, typ) % WRITE_NLS_FILE - function that saves a Non-Local STAPLE compatible, file % usually referred to as a mff file % % write_nls_file(fname, data, typ) % % Input: fname - the filename of the output file % data - the data to write % typ - the data type...
%startCollectingRSSI %This file sets matlab up to use the tool for collecting RSSI from chipcons. %Make sure you type "make" twice from the %tinyos/tools/java/net/tinyos/chipconRSSI directory to generate the %appropriate java classes. Also make sure you setup matlab properly by %reading the tinyos/doc/tutorials/matl...
taskNames{1}='gr01'; taskNames{2}='gr02'; taskNames{3}='gr03'; taskNames{4}='gr04'; taskNames{5}='tv01'; taskNames{6}='tv02'; taskNames{7}='tv03'; taskNames{8}='tv04'; lambda=3; NumOfMatroids=21; runRouge=1; runExp=1; if runExp==1 for vsin=5:8 videoSet=taskNames{vsin}; NumOfSubset=12; load([...
%{ Copyright (c) 2017 Raghvendra V. Cowlagi. All rights reserved. Copyright notice: ================= No part of this work may be reproduced without the written permission of the copyright holder, except for non-profit and educational purposes under the provisions of Title 17, USC Section 107 of the United States Cop...
order = 2; mics = 1; omega = pi/8; %angular frequency lambda = pol2cart(omega, 1) * [1; 1i]; lambdas = diag([lambda, conj(lambda)]); %evals %x = %input %S = %evecs %U = inv(S)* x; %state vector F = 0; U = pol2cart(omega, 1) * [1; 1i]; U = diag([U, conj(U)]); A = rand(length(lambdas)*2); %structure coefficients u = [di...
function[XX,YY,ZZ,KAKOM,NFRE,TEISUU,KOTEI] = DATAIN3 NELT=16;NODT=16; XX=100*[0 4 4 0 0 4 4 0 0 4 4 0 2 4 2 0] YY=100*[0 0 4 4 0 0 4 4 0 0 4 4 0 2 4 2] ZZ=100*[0 0 0 0 2 2 2 2 4 4 4 4 4 4 4 4] KAKOM=[1 5;5 9;2 6;6 10;3 7;7 11;4 8;8 12;9 13 13 10;10 14;14 11;11 15;15 12;12 16;16 9] NFREE=0; KOTEI=[1 1 1 1 1 1 1 2...
function fval = minMatchWageEmplDisp(z,emp_targets,rw_targets,disp_target,mean_l,mean_m,mean_s,corr_lm,corr_ms,corr_ls,AL0,AM0,AS0,param) [~,~,~,fval,~] = matchWageEmplDisp(z,emp_targets,rw_targets,disp_target,mean_l,mean_m,mean_s,... corr_lm,corr_ms,corr_ls,AL0,AM0,AS0,param); end
%% Initialization section delete(instrfind({'Port'},{'COM15'})) clear all; close all;clc; ser = serial('COM15','BaudRate',115200,'InputBufferSize',100); ser.ReadAsyncMode = 'continuous'; fopen(ser);k=[]; %% close all, clc q = [1,0,0,0]; qfE = [1,0,0,0]; G = [0,0,-1]; qI = [0,1,0,0]; qJ = [0,0,1,0]; qK = [0,0,0,1]; t...
% ========================================================================= % % This software was developed by employees of the National Institute of % Standards and Technology (NIST), an agency of the Federal Government. % Pursuant to title 17 United States Code Section 105, works of NIST % employees are not subject t...
%% Simulate response rMax = {1 1}; c50 = {.2 .2 }; order = {2 2}; base = {0 0}; %input{1} = repmat([ones(10,1); -ones(10,1)],10,1); %input{2} = repmat([-ones(10,1); ones(10,1)],10,1); for iI = 0:.05:1, w1 = 4*.33; w2 = 5*.33; ph2 = 0; t = linspace(0,6*pi,200); t2 = linspace(0,6*pi,200)+2*pi/1; distalS...
function loops_seed = pick_Seeds_surface() % USPEX Version 9.3 % Change: block varcomp support added % Change: the seeds structure would be added into the end of the POPULATION % Change: VASP-5.2 format global POP_STRUC global ORG_STRUC warning off %------------------------------------- cd Seeds disp(' '); disp('Re...
load wiki.mat path=wiki.full_path(); gender=wiki.gender()+1; [age,~]=datevec(datenum(wiki.photo_taken,7,1)-wiki.dob); N=length(path); faceDetector = vision.CascadeObjectDetector('FrontalFaceLBP'); DataSetX=zeros(N,64*64*3); DataSetGender=zeros(N,1); DataSetAge=zeros(N,1); disp('Début de la lecture des i...
function fftwindowsize f=1125; fs=16000; t=1/fs:1/fs:.1; in=sin(2*pi*f*t'); modcycle=6; fmod = 1000/modcycle; in = in .* (1+sin(2*pi*fmod*t'-pi/2))/2; rampdur=0.02; % in=ramp(in,fs,rampdur); p.pre_emphasis=0; p.ScaleByOutLevel=1; p.reference_SPL_dB = 50; p.Q=100; p.analysis_rate=500; p.num_selected = 8...
% Datos fc = 200; % frecuencia de corte inferior en [Hz] FC = 250; % frecuencia de corte superior en [Hz] Fs = 1000; % frec. de muestreo en [Hz] N = 10001; % longitud de la respuesta impulso f1 = 0; % frec. mínima para el cálculo de la respuesta de frec. f2 = 500; % frec. máxima para el cálculo de la respuesta de...
feedback = PobRectangle(); feedback.Add(1, 'rel_x_pos', 0.5, ... 'rel_y_pos', 0.5, ... 'rel_x_scale', 0.3, ... 'rel_y_scale', nan, ... 'fill_color', [255 255 255], ... 'fill_alpha', 0, ... 'frame_color', [255 255 255]); feedback.Register(wi...
clear; clc; cd('./DataSets'); load SJAFFE;%10^-4,10^-2,10^-3 load SBU_3DFE;%10^-4,10^-2,10^-3 cd('../'); features = double(real(features)); % parameters setting lambda1=10^-4;%L1 lambda2=10^-2;%L21 lambda3=10^-3;%correlation rho = 10^-3; times = 10; fold = 5; [num_sample, ~] = size(features)...
clear; close all; rng(6); % 2D example d = 2; nx = 1000; % Xf = [-1,-1;-1,1;1,-1;1,1]; Xf = rand(nx,d)*2-1; % Xf = [cos(0:(pi/20):(2*pi));sin(0:(pi/20):(2*pi))]'+2; nq = nx*(nx-1)/2; % number of queries dX = zeros(nq,d); % attribute difference data dXID = zeros(nx,nx); % pair to query id mapping count = 1;...
function [res] = thdwfft_sim_cell(sim) % Part of non-coherent, windowed FFT, THD meter. % % Wrapper for known THD simulator. % This is called for each simulated set of parameters. % % add alg. folder paths: cellfun(@addpath, sim.paths.paths, 'UniformOutput', false); % fetch correction data d...
% add Corke's toolbox cd('D:\aslab_gitlab\kalmanfilter\ik_framework\toolboxes\Robotics_Corke') startup_rvc; % Model definition with Peter Corke's toolbox % clear;close all; % m1 = 1; % m2 = 1; % r1 = [0.005 -.5 0.005]; % r2 = [0.005 -.5 0.005]; % i1 = [1/12*(1*1+0.01*0.01) 0 0;... % 0 1/12*(0.01*0.01 + 0.01*0.01...
function process_featquery2() % proccess featquery results from pvem experiment % mark.bolding@gmail.com RAWDATA = 2; PARTIALFIT = 3; MODELFIT = 4; REDUCED = 5; datacoltype = REDUCED; stattype = 'maxzstat'; %% directory and file name lists subjectdirs = {}; rundirs = {}; roidirs = {}; importfilelist('subjectdirs.txt'...
function [beginIndex, endIndex] = searchAccInterval(data,windowSize) %% find the begining and the end of acc in data so that only meaningful data will be displayed if nargin == 1 % windowSize = 100; % windowSize = 210; % windowSize = 105; windowSize = 300; end % num = numel(data); % beginIndex = 1; % endIndex...
% find how to split the test images and detect the circles containing the % letters close all clear all clc % reference correct split values to compute performances verSplitRef = 160; horSplitRef = 120; showImage = 0; % variables to store the errors horErr = 0; % horizontal split error verErr = 0; % ...
function [X,vr] = popolnoPrirejanjeCeloSt(utezi,Graf) %funkcija vrne popolno prirejanje grafa Graf z utezmi na povezavah %Vhod: % utezi 1xn matrika utezi povezav % Graf je podan z incidencno matriko mxn ,kjer je n stevilo povezav, m % stevilo vozlisc. Graf(i,j) = 1, ce je krajisce povezave j vozlisce % i in...
function [s30]=sleepRalph2(p,o,n,doprint) %p=name of 1min data file %o=name of 30min data file %n= sleep definition (usually 5 or 30 (minutes)) % RALF(O) does Ralf-style multi-actogram plot on DAM data in O %%(C)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright (C)Jeffrey Hall Lab, Brandeis ...
lags = 3.161; %lags = 3.1; history = 50; tspan = [0,3000]; sol = dde23(@ddefun2, lags, history, tspan); lags2 = 3.20; sol2 = dde23(@ddefun2, lags2, history, tspan); figure('position', [0,0,800,500]) plot(sol.x, sol.y) %xlim([2.00850*10^6 2.01000*10^6]) xlabel('t(minutes)') ylabel('y(t)') set(gca,'FontSize',20) %title...
function [ compensatedRGBimg, compensatedHSVimg ] = imgCompensation( RGBimg, b, mode ) % Performs brightness or contrast mods BRIGHTNESS = 1; % V' = v + b CONTRAST = 2; % V' = V * b HSVimg = rgb2hsv(double(RGBimg)./255); % Extract V channel Vchan = HSVimg(:,:,3); if(mode == BRIGHTNESS) Vchan = Vchan + b; else if(...
function output_cell = sortCoordinateCellArray(ref,test,varargin) % sortCoodinateCellArray = function takes in two cell arrays of coordinates % and ouputs a cell array of the size of ref containing coordinates of test % ordered by minimum distance % INPUTS % ref = cell array of point coordinates (reference) % ...
# Assume a 1000-string data set with a binary output feature. # Assume a classification tree on the set with 4 terminal nodes. # Consider the following contingency table between the partition and the output feature. # # Yes | No | Total # S1 80 20 | 100 # S2 50 450 | 500 # S3 100 200 | 300 #...
x1 = linspace(0,2.5,50); x2 = linspace(0,2.5,50); [X1, X2] = meshgrid(x1,x2); %% Funnel Options alpha = 3; lambda = 0.1; psi = lambda+alpha; %% Control u = @(x1,x2) min(-x1./(psi-x1).^2 -x2./(psi-x2),1); %f_norm = @(x1,x2) sqrt(x1.^2 + u(x1,x2)^2); %Z = surf(X1,X2,f_norm(X1,X2)); %% f1 = @(x1,x2,t) x2; Z = sur...
function y = tentmap(x,p) % TENTMAP(x,p) tent map of x at parameter p. % p = 1.99999 is the chaotic one if x > .5 x = 1-x; end y = p*x;
function [t, r] = fda(tmax, level, r0, v0, m) % Solves nonlinear equation of motion using second order finite % difference % input % tmax: final solution time % level:(integer scalar) Discretization level. % r0: initial positions 3x3 matrix % v0: initial velocities 3x3 matrix % initial masses 2x2 matrix %output % ...
function b = fn_sizecompare(s1,s2) % function b = fn_sizecompare(s1,s2) %--- % compare size vectors by first making them the same length by padding with % 1s; for example: % fn_sizecompare(3,[3 1]) returns true % fn_sizecompare(3,[1 3]) returns false % Thomas Deneux % Copyright 2005-2012 l1 = length(s1); l2 = length(...
clc clear close all; % %add pre MatConvNet setup vl_setupnn; % seting parameters... opts.dataDir = fullfile('F:\Documents\MATLAB\Data\MNIST','mnist') ; opts.train.batchSize = 100; opts.train.numEpochs = 3 ; opts.train.learningRate = 0.001 ; %prepare data imdb = getMnistImdb(opts); f=1/100 ; net.layers = {} ; net.lay...
clear; path= 'Y:\CheetahData\WT24\2017-11-03_11-37-42'; files=dir(path); cd(path); extt = 1; % z=0; % for j=3:length(files) % filename=files(j).name; % if filename(end-5:end)=='er.mat' % z=z+1 % TTn=filename(1:find(filename=='c')-1); % TT=load(filename); % unt(z)=le...
function [feat num dim]=loadfeatures_v2(file, detector, param) % Load local features outname = [ 'tmp_' detector '_features.out' ]; %% temporary output file buffer name fpath = fileparts(which(mfilename)); %% current directory path inname = file; switch detector case 'mser' fprintf('-- De...
function qqplot_FAVARResid(FAVAR, FAVARopt,name) N = size(FAVARopt.vnames, 1); figure; for i = 1:N subplot(2, 3, i) Y = qqplot_Mod(FAVAR.residuals(:,i)); title(FAVARopt.vnames{i},'interpreter','latex','FontSize',30); yAX = get(gca,'YAxis');yAX.FontSize = 30;yAX.TickLabelInterpreter = "latex"; xAX =...
function f = evaluate_objective(x, M, V, fbamodel, geni, reaction_expression) %% function f = evaluate_objective(x, M, V) % Function to evaluate the objective functions for the given input vector % x. x is an array of decision variables and f(1), f(2), etc are the % objective functions. The algorithm always minim...
close all clear all % c_out(index,:) = mean(c(count : count+navg-1 , :), 1); % t_out(index,:) = mean(t(count : count+navg-1 , :), 1); % ms = mean(s,1); % mc = mean(c,1); % mt = mean(t,1); newline = sprintf('\n'); mask = lightbox('mask'); figure;mean_sub = lightbox('mean_sub'); %write_img('mean_sub.img',abs(ms),h);...
%12-bit images: =========================================================== image_name=cell(1,32); ext='.pgm'; ext8='_8bit.pgm'; bitdepth=ones(1,32)*12; image_name{1}='\image\pgm\Nikon_5300D1'; image_name{2}='\image\pgm\Nikon_5300D2'; image_name{3}='\image\pgm\Nikon_5300D3'; image_name{4}='\image\pgm\Nikon_5300D4...
function v_group = group_vel_calcite(lambda, p) % Kalcit kristalyban az ordinarius es extraordinarius csoportsebessegek a % h.hossz fuggvenyeben % http://www.redoptronics.com/Calcite-crystal.html % [lambda] = mikrometer % lambda: oszlopvektor! % fenysebesseg vakuumban [mikron/fs]: c = 0.299792; % k_max = ...
%% Unit testing for getStimulusLabels classdef StimulusLabelsTest < matlab.unittest.TestCase properties labelTbl % table of label examples IDdict % Name:ID table sampleTbl % sample table % testTbl % stores result from call to getStimulusLabels end properties(Me...