text
stringlengths
8
6.12M
function mat=reverse_diag(n) a=zeros(n); a(1:n+1:n^2)=1; mat = flip(a,2); %D(n:max([1,n-1]):max([n,n^2-1])) = 1;
function juice_two_derivative2 close all; clear all; fs = 500;%采样率 %gold_standard = load('D:\zhaorui_2014\code\New_gold_standard.mat');%金标准 %raw_data = dir('D:\zhaorui_2014\data_change'); %raw_path = 'D:\zhaorui_2014\data_change\'; raw_data = dir('D:\spindle\two_order_derivative\data\'); raw_path = 'D:\spindle\two_orde...
function z=zad1_redlich_kwong_clean(p,t,pc,tc) %t=temperatura [K], p=ciśnienie [Pa] r=8.3144;u=1;w=2; a=0.42748*r^2*tc^2.5/pc/t^0.5; b=0.0866*r*tc/pc; A=a*p/r^2/t^2; B=b*p/r/t; z=roots([1,-1-B+u*B,A+w*B^2-u*B-u*B^2,-A*B-w*B^2-w*B^3]);
%% ------------------------------------------------------------------------% % EE 569 Homework #3 % Date: Nov. 1, 2015 % Name: Faiyadh Shahid % ID: 4054-4699-70 % Email: fshahid@usc.edu %------------------------------------------------------------------------% close all; clear all; clc; %% Reading the file row= 275; co...
function I = polydefint(p,a,b) %% POLYDEFINT Definite integral of a polynomial % POLYDEFINT(p,a,b)returns the value I of the definite integral of poly- % nomial p (in MATLABŪ polynomial form) over the real interval [a,b]. % % See also polyint, polyder % % Detailed help, with examples, availa...
%% GRID SEARCH FOR SVM. ORIGINAL IMBALANCED DATA %% Dataset, exploratory data analysis and Method %There are 6497 entries (before removal of missing values), 12 physiochemical wine quality predictors and % 1 target value – the quality of the wine. Continues values would need %to be normalized since there are som...
clc; clear; % Зчитування зображень X = imread('x2.bmp'); Y = imread('y2.bmp'); % Приведення елементів вхідних матриць до десяткових дробів X = double(X); Y = double(Y); % Доповнення матриці Х рядком одиниць X = [X; ones(1, size(X, 2))]; % Алгоритм за формулою Гревіля (початок) % Перший крок a = X(1, :).'; A(1, :) =...
function [ r, idx ] = movingMin( ticks,len,type ) %MOVINMIN 移动求最小值 % @ luhuaibao % 2014.6.3 % inputs: % ticks, Ticks类 % len, 计算长度 % type, 供选择,包括'last','bid','ask' if ~exist('type','var') type = 'last'; end ; switch type case 'last' [ r, idx ] = movMin0( ticks.last, len ) ; ...
function DetectionResult=IntrusionDetectionCallback(context,action,CSIdata) global PS; Amplitude=GetAmplitude(1,1,15,CSIdata); PreprocessData=ButterworthFilter(Amplitude,20,5,4,'low'); % 1. Get the silent environment threshold if action == context.CALLBACK_INIT PS.thres=GetVar(Preprocess); % 2. Detect intrus...
function psnr = PSNR_calculation(img1, img2) [row, col] = size(img1); psnr = sum(sum(((double(img2)-double(img1)).*(double(img2)-double(img1))))); psnr = psnr/(row*col); end
function fAverageRMS = CalculateRMS_Music_7ch(InputFolder) sInputFileCh0 = [InputFolder,'\ch0.wav']; sInputFileCh1 = [InputFolder,'\ch1.wav']; sInputFileCh2 = [InputFolder,'\ch2.wav']; sInputFileCh3 = [InputFolder,'\ch3.wav']; sInputFileCh4 = [InputFolder,'\ch4.wav']; sInputFileCh5 = [InputFolder,'\ch5.wav']; sInputFi...
function eeg = button_preprocessing_training(eeg,nSecInterest,strOrder,unpressValue,verbose) iChannel = eeg.map_ch('TRIG'); dataButton = eeg.data(iChannel,:); % dataButton(dataButton < 0.5) = 2.99; dataButton(dataButton < 0.5) = 1; % dataButton(dataButton < 0.5) = ceil(unpressValue/2); trigButton = find(dataBu...
function perfect=createPopulation(dataLength,stim, populationSize) t=1/256:1/256:(dataLength/256); base(1,:)=(sin(2*pi*stim*t)+1)/2; base(2,:)=(cos(2*pi*stim*t)+1)/2; base(3,:)=(sin(4*pi*stim*t)+1)/2; base(4,:)=(cos(4*pi*stim*t)+1)/2; base=base'; for i=1:1:populationSize perfect(:,i,:)=base; end
%% % For a Given Photocell, % Given a Fixed Lux of illumination, Find the relation of Voltoge and % Ampere. %% clear clc close all dirpath='./figures'; if ~exist(dirpath,'dir') mkdir(dirpath); end for i = [503 1003 1495 2000 2500 3000] AnalyzeData(i) end function AnalyzeData(Lux) sampling_resistor=100...
function [out_values, cluster_nr] = contract_to_cluster_mean(in_values, tolerance, tolerance_mode); % [out_values, cluster_nr] = contract_to_cluster_mean(in_values, tolerance, tolerance_mode); % % /!\ WARNING /!\ - THIS IS A DUMB ALGORITHM CREATED FOR A VERY SPECIFIC PURPOSE. % % TAKES A RANGE OF VALUES THAT SHOULD...
%Hi Ta, would you mind mannually choose to execute some part of the code. %I hope my explanation is clear. Thank you very much! %problem a,b %[h m Q] = EMG(0,'stadium.bmp',4); %[h m Q] = EMG(0,'stadium.bmp',8); %[h m Q] = EMG(0,'stadium.bmp',12); %problem c %[h m Q] = EMG(0,'goldy.bmp',7); %below part invoke the bu...
function [ROIImageInfoNew, ROIBWInfoNew, CDataSetInfoNew]=Resample_Wrapper(ROIImageInfo, ProgramPath, ROIImageInfoNew, CDataSetInfo, ROIBWInfo, ResampleImageFlag, ResampleROIFlag, BoxKernelFlag) %Interpolate kernel if nargin > 7 BoxKernelFlag=BoxKernelFlag; else BoxKernelFlag=0; end %--Resample Image...
function [ J ] = basic_tutorial3_costFunctionJ( X, y, theta ) %UNTITLED 此处显示有关此函数的摘要 % 此处显示详细说明 m = size(X,1); prediction = X*theta; sqrErrors = (prediction-y).^2; J = 1/(2*m) * sum(sqrErrors); end
function images = enhanceContrastALS(images, num_row, num_col) %linear stretching without user input %automatically generate parameter m,c %Iin: input image %noise: number of noise pixels to be ignored %define the first and last 10 pixels as noise noise=10; %retrieve each image ...
n = 12; xmax = 100; ymax = 200; xmin = -xmax; ymin=-ymax; %xs = xmin + (xmax-xmin).*rand(n,1); %ys = ymin + (ymax-ymin).*rand(n,1); mu = [0 0]; %[1 2]; Sigma = 25*[1 .5; .5 2]; R = chol(Sigma); R = [30 0; 0 60]; z = repmat(mu,n,1) + randn(n,2)*R; ch = z(convhull(z),:); figure(1); hold off plot(z(:,1),z(:,2),'o','...
function run_null_rf() dsp2.cluster.init(); conf = dsp2.config.load(); epoch = 'targacq'; is_per_freq = true; n_trees = 50; if ( ~is_per_freq ) assert( numel(freq_rois) == numel(band_names) ); end meas_type = 'coherence'; analysis_type = 'svm'; io = dsp2.io.get_dsp_h5(); base_p = dsp2.io.get_path( 'Measures', ...
classdef MHyProSupportFunction < MHyProGeometricObject methods (Access = public) % Create a HyPro support function function obj = MHyProSupportFunction(varargin) obj.Type = 3; if nargin == 0 % Call default constructor ob...
clear load simdata cameraSensor=zeros(nDetectors,1); % cameraSensor=detectorCounts.detid [a,~,c] = unique(detectorCounts.detid); out = [a, accumarray(c,detectorCounts.ppath)]; out(:,1)=out(:,1)-1; cameraSensor(out(:,1))=double(out(:,2)); cameraImage=reshape(cameraSensor,[ySize/detSize,xSize/detSize]); figure, image...
% this script tests PL_GetWFEvs (get waveforms and events) function % before using any of the PL_XXX functions % you need to call PL_InitClient ONCE % and use the value returned by PL_InitClient % in all PL_XXX calls s = PL_InitClient(0); if s == 0 return end % call PL_GetWFEvs 10 times and plot the wav...
function demo_function(StartTime,EndTime,GPU_Mode, Parallel_Mode,Number_of_Cores,Action_Strategy_List,varargin) % Add all necessary libraries addpath(genpath('/home/hoa/Dropbox/Apps/Matlab/Utilities')); try addpath(genpath('/fast/users/a1708618/Dropbox/Apps/Matlab/Utilities')); catch disp...
clear all close all % make X number of uncorrelated channels nr_antennas = 2:2:8; % dont use more than 8, error on plotting due to color function. nr_realizations = 1000; SNR=316.23; for o = 1:length(nr_antennas); H=zeros(nr_antennas(o),nr_antennas(o),nr_realizations); for r=1:nr_realizations ...
%CREATE TEMPLATES %Letter Alif=imread('bitmap_huruf\alif.bmp');Ba=imread('bitmap_huruf\ba.bmp'); Ta=imread('bitmap_huruf\ta.bmp');Tsa=imread('bitmap_huruf\tsa.bmp'); Jim=imread('bitmap_huruf\jim.bmp');Ha=imread('bitmap_huruf\ha.bmp'); Kha=imread('bitmap_huruf\kha.bmp');Dal=imread('bitmap_huruf\dal.bmp'); Dzal=imread('b...
% ====================================== % Cycle-slip detection in measurement domain % % zhen.dai@dlr.de % % last modified: 2011.Oct % ====================================== % display the standard deviation of differenced carrier phase data % with/without the current carrier phase measuremen function GUI_Results_Disp...
function varargout = gui2(varargin) % GUI2 MATLAB code for gui2.fig % GUI2, by itself, creates a new GUI2 or raises the existing % singleton*. % % H = GUI2 returns the handle to a new GUI2 or the handle to % the existing singleton*. % % GUI2('CALLBACK',hObject,eventData,handles,...) calls the l...
clear all close all clc format long format compact % parameters Physicsparams = setPhysicsParams(); % physics parameters MPIparams = setMPIParams(Physicsparams, [0 0 3]); % MPI machine parameters fileID = fopen('last_data_no_correction.txt'); C = textscan(fileID,'%f %f %f %f %f %f %*[^\n]', 'Delimiter', ...
classdef filterCpsearn < handle % Determines how individuals are filtered out %{ %} properties % Drop people in group quarters? dropGq dropZeroEarn dropNonWageWorkers % cS.male, cS.female sex % cS.raceWhite, ... race % Age in PREVIOUS year (where earnings observed) ageMin ageMax ...
%% an example to demonstrate PAW phase reconstruction %% load physical system parameters systemParameters = struct(... 'wavelength',0.56e-6, ... % wavelength in meter 'totalMagnification',10, ... % Total Magnification 'NAi', 0.3, ... % illumination NA 'NAd', 1.0, ... ...
function [oe, r, v, jd] = planet_oe_and_sv ... (planet_id, year, month, day, hour, minute, second) % This function computes the orbital elements, the state vector, the velocity % and the julien day for a planet. % Based on Algorithm 8.1 from Orbital mechanics for engineering students, % 2010, by H.D. Curtis %...
function a = setState_SP(a,sp) % SETSTATE_SP Set the specific entropy [J/kg/K] and pressure [Pa]. % % setState_SP(a, sp) sets the specific entropy and pressure % of object a, holding its composition fixed. Argument 'sp' must % be a vector of length 2 containing the desired values for the specific % ent...
function [Valigned,TMatrix,Vsource,Hsource,Rsource,Vtarget,Htarget,Rtarget] = alignDatasets(Vsource,Hsource,Vtarget,Htarget,interpmethod, OutputView) if nargin<5 interpmethod = 'nearest'; end [TMatrix,Vsource,Hsource,Rsource,Vtarget,Htarget,Rtarget] = ... MakeTransMatrix(Vsource,Hsource...
function [t,g] = Gaussian_pulse(M,K,a) t = linspace(-M/2, M/2, M*K+1); t = t(1:end-1); t = t'; % Equality must hold: a = (1/(B*Ts))*sqrt(ln(2)/2) g = (sqrt(pi)/a)*exp(-(pi^2)*(t.^2)/(a^2)); g = g / sqrt(sum(g.*g));
function z = linear_conv(x, y) %debug % x = [5 1 -2 4]; % y = [1 2 3]; %end debug N = length(x)+length(y)-1; xpad = [x zeros(1,N-length(x))]; ypad = [y zeros(1,N-length(y))]; z = zeros(1, N); for k=0:(N-1) for n = 0:k z(k+1) = z(k+1) + xpad(n+1) * ypad(k-n+1); ...
speech_vector = audioread('speech.au'); X = double(speech_vector); subplot(4,1,1) Y2 = Uquant(X,2^7); E = Y2 - X; [c,lags] = xcorr(E,Y2,200,'unbiased'); plot(lags,c) title('cross-correlation E = Y - X, Y = Uquant(sv,2^7)') xlabel('lags') ylabel('c') subplot(4,1,2) Y2 = Uquant(X,2^4); E = Y2 - X; [c,lags] = xcorr(E,Y2,...
h = 900; min_y = 120; max_y = 480; min_x = 70; max_x = 330; % Threshold values min_thresh = 30; max_thresh = 500; % Get image from depth sensor %depth = getsnapshot(depthVid); %color = getsnapshot(colorVid); color = imread('doos_leeg_overlap_RGB.png'); load('depth_lege_doos.mat'); raw_matrix = depth; %Run the sob...
clear; load X_train.mat; load X_test.mat; tic; n= nnz(X_test); Tnum = n; RMSE=0.0; [x,y,v]=find(X_test); for i=1:1:Tnum weight=0.0; score=0.0; Tsim = sim(:,x(i)); Ttrain = train(:,y(i)); for j = 1:1:10000 % if temp_train(j) > 0.5 score = score + Tsim(j)*Ttrain(j); ...
% Calculate baseline LFP power for single data file % compare first 5min and last min spectra % First 5min dmat = detrend(First5m.(chan_names{ch}))'; [C_First5ms,ph,s12,S_First5ms,S_First5ms,t,f]=cohgramc(dmat,dmat,movingwin,params); % NOTE I just use cohgram here because it has a moving window option. This %...
%% 8-15-2016 - script to compare response times once they've been calculated % make sure you have vectors buttonLocsVecCort, buttonTactDiff, % tactorLocsVecTact % set bounds on data, assume rxn time has to be greater than 200 ms and % less than 1 s current_direc = pwd; %save(fullfile(current_direc, [sid '_compare...
% function RESULTS = assessment(Labels,PreLabels,par) % function [ConfusionMatrix,Kappa,OA,varKappa,Z, CI] = assessment(Labels,PreLabels,par) function RESULTS = assessment( Labels, PreLabels ) % % function RESULTS = assessment(Labels,PreLabels,par) % % INPUTS: % % Labels : A vector containing the true (a...
% SPTK commands X2X = '/Users/sivanandachanta/tts_tools/SPTK_3.6/bin/x2x'; MGCEP = '/Users/sivanandachanta/tts_tools/SPTK_3.6/bin/mcep'; LPC2LSP = '/Users/sivanandachanta/tts_tools/SPTK_3.6/bin/lpc2lsp'; AVERAGE = '/Users/sivanandachanta/tts_tools/SPTK_3.6/bin/average'; NAN = '/Users/sivanandachanta/tts_tools...
function [out, X, distances] = get45Marginal(in, steps) if nargin<2 steps = 50; end [lenA, lenB] = size(in); B = repmat( (1:lenA)',[1 lenB]); A = repmat( (1:lenB) ,[lenA 1]); distances = sqrt(A.^2+B.^2).*sin( atan(B./A) - pi/4); minD = min(distances(:)); maxD = max(distances(:)); stepSize = (maxD-minD)./(steps-...
function binary=en_coef2D_new(coef,H0,W0,delta,binary) %N=int16(size(coef)); H0=bitshift(N(1),-3); W0=bitshift(N(2),-3); %binary=SFcode(H0,1536); binary=[binary SFcode(W0,1536)]; Nsub=bitshift(int32(numel(coef)),-2); if Nsub<=bitshift(int32(2),18) binary=en_coef2D_new_sub1(coef,delta,H0,W0,binary); elseif Nsub<=...
function y = calcMSE(im1, im2) [height width cdim] = size(im1); y = sum((im1(:)-im2(:)).^2)/(height*width*cdim); end
function H = simplex_continuity(tri, spline_poly_order, spline_cont_order,... c_OLS_coeff) % SIMPLEX_CONTINUITY Creates the continuity matrix H % % Inputs: % - tri: MATLAB triangulation object % - spline_poly_order: order of the polynomial spline % - spline_cont_order: order to which the splines have to be cont...
function [out1, out2] = gp_sod(logtheta, covfunc, likfunc, x, varargin) % gpr_sod - Gaussian Process regression, using the Subset of Data % approximation. % % usage: [loghyper sod] = gpr_sod(logtheta, covfunc, likfunc, x, y, N, method,splitLen, 'split') % or: [mu S2] = gpr_sod(logtheta, covfunc, likfunc, x, y, N...
function [na1,na2]=coocur_repeat(a1,a2) if length(unique(a1))~=length(a2) %Means a1 contains repeated values [na1,f2]=unique(a1); na2=[]; for j=1:length(na1) [~,f2]=min(abs(a2-na1(j))); na2=[na2 a2(f2)]; end end if length(unique(a2))~=length(a1)%Means a2 contains repeated values [n...
% %% INIT % % clear all; % close all; % clc % imaqreset % % % Data Aquisition % colorDevice = imaq.VideoDevice('kinect',1); % depthDevice = imaq.VideoDevice('kinect',2); % % colorImage = step(colorDevice); % depthImage = step(depthDevice); % ptCloud = pcfromkinect(depthDevice,depthImage,colorImage); % ...
%% MASCRET Quentin - Copyright 2017 %% % This function is based on an analysis. First of all, I saw that during % stray time, attack of Wang & Al. 2011 algorithm parameter will be short % less than 4 windows over my adaptive threshold. Moreover, peak are % numerous and by the way have a short attack. My idea is to crea...
load('../data/k_fold_partitions_noisy_data.mat'); % Best choosen parameters for 'traingda' BEST_NEURON_L1 = 15; BEST_NEURON_L2 = 0; BEST_LR_INC = 1.1; BEST_LR_DEC = 0.5; BEST_LEARNING_FUNCTION = 'traingda'; BEST_MC = -1; BEST_LR = -1; %VARIABLE number of epoch MAX_EPOCH = 1000; % set of integer versions of our label...
function [T10_Data, T10_Info, T10_desc] = compute_T10_map_from_PDW_data(PDW_Struct, DCE_Struct, ROIs_by_slice, T10_estimation_type, T10_correction_struct, init_T10_Data) T10_Info = []; T10_desc = []; MR_volume_size = size(PDW_Struct.Data{1}); [flip_angles, TRs, TEs] = extract_MR_params_for_VFA_estimation(PDW_Struct...
%% Load Fundamental Spectrum (own measurement) % filename_sp='U:\Measurement_Data\OAC_IFROG\2019_05_02_ACER\venteon_spectrum_CEP_stabil.txt'; filename_sp='Z:\People\S.Peter\projects\IFROG\Venteon_with_APE_wavescan_noheader.txt'; comma2dot(filename_sp); venteon_spectrum=load([filename_sp(1:end-4) '_dot.txt']); wl0=...
G=JPsv; members=properties(G); classes1={{12};{20}}; classes2={{12};{21}}; classes3={{12};{22}}; for i=1:numel(members) % G.(members{i}).default.train_classifier('name','c1220','classes',classes1,'blocks_in',1:10,'channels',1:64,'time',1:64); % G.(members{i}).default.train_classifier('name','c1221','classes'...
function [type_map,quality_map,maxquality_map] = generate_maps(Prop) % Generates a map from a png file. % creates a 1000x1000 map with 0:4 values, 4:1 for rbgk and 0 for % anything else. % When drawing in GIMP, choose for H value: % 330-360 and 0-30: Nothing MEAN: 0 % 30-90: Flower 1 MEAN: 60 %...
function [signalMovie] = createSignalBasedMovie(inputSignals,inputImages,varargin) % uses images and signals for sources from an original movie to create a cleaner, more binary movie % biafra ahanonu % started: 2014.07.20 [14:09:34] % inputs % inputSignals - [n t], n = number of signals, t = time % inputImages ...
% fprintf('cell=%d\n', cell); 这个打印时间开销巨大 xcell = ceil(cell / Order); ycell = mod(cell - 1, Order) + 1; goto_nextcell = 0; cell_record(cell_record_ptr) = cell; cell_record_ptr = cell_record_ptr + 1; while((goto_nextcell == 0) && (ptrs(cell) <= Order)) if cur_mark(xcell, ycell, ptrs(cell)) == 0 ptrs(ce...
function value = statistic(varargin) value = feval(varargin{:}); function result = epoch_offset() result = 'extract(epoch from time)'; function result = byte_offset(field) sp = StatPacket; size = eval(['sp.size_' field]); if (size == 1) result = num2str(eval(['sp.offset_' field])); result = ['(b' result ')']; el...
%% Try different analyses and develop ISETBIO with the Vernier methods. scene = sceneCreate('vernier'); oi = oiCreate; cm = coneMosaic; locationThetaDegrees = 90; locationRadius = 10;
clc clear all C1 = 5; C2 = 3; n = 100; D = 100; dx= 0.5; dt=0.001; R = 8.314; T = 400; a=3*10^-5 %for down-hill diffusion O < 2RT arr_conc = zeros(100); arr_conc_old = zeros(100); %loop to find the initial array concentration for i = 1:100 for j = 1:100 %creating a 3d array with ran...
function UpdateTexture( im, isOrg) %UPDATETEXTURE Summary of this function goes here % Detailed explanation goes here global imageData im = imageConvertNorm(im,'uint8',true); if (~exist('isOrg','var') || isempty(isOrg) || true==isOrg) lever_3d('loadTexture',im,imageData.PixelPhysicalSize); else lever_3d('lo...
function hetero_MM(cs,cb,sav_fname,T,t,Imic, ksmm, kb,km, Y, nx, ny, options) d2dec_dcs2= @(csm,cbm,ksmmf,kmf)(-(2.*cbm.*kmf.*ksmmf)./(csm+ kmf).^3); d2dec_dkm2= @(csm,cbm,ksmmf,kmf) (2*cbm*csm*ksmmf)./(csm + kmf).^3; d2dec_dkmdksmm= @(csm,cbm,ksmmf,kmf) -(cbm*csm)./(csm + kmf).^2; d2dec_dcsdcb= @(csm,cbm,ksmmf,kmf)(k...
%M=4; %Nt=4; %Nr=4; %SNR_Vector=-15:1:15; %BBB=ABER_ANA_QSM_Rayleigh_no_CSE(M,Nt,Nr,SNR_Vector) %semilogy(SNR_Vector,BBB) SNR_Vector=-10:1:15; BBB=ABER_ANA_QSM_Rayleigh_no_CSE(4,4,4,SNR_Vector); figure; semilogy(SNR_Vector,BBB,'-*b') % QPSK/4TX/4RX hold on DDD=ABER_ANA_QSM_Rayleigh_no_CSE(4,8,4,SNR_Vecto...
function [ ] = plot_ace_relationship_bygas_serialmonth( gas_in, years_in, do_plot ) %A funcion to plot the relationships between ace gases for a given year. % *INPUT* % gas_in: STRING - the name of the gas for which you want to % compare the climatologies. % % filename_oldclim: STRING - t...
function [X, XTest] = splitTrials(X, fold, nFolds) % split X's trials into training dataset and testing dataset % The dimensions of X are: nBins * nConds * nTrials * nCells nTrials = size(X,3); if nFolds == 1 XTest = []; else s = rng; rng(0) % always split the same way iTrials = mod(1:nTrials,nFolds)+1...
fs = 16000; source_test_file = {'VC_COSPRO_VAD\F002\COSPRO 03_F002phr723_d.wav'}; audio_file=source_test_file; mccDIM = 39; addpath('STRAIGHT\STRAIGHT\STRAIGHTV40_006b'); M = 2^15; frame_length=25; % STRAIGHT analysis, synthesis set up. 25msec. frame_shift=5; % STRAIGHT analysis, synthesis set up. 25msec. prmP.de...
function Beamforming_Rypkema function [data, time, signal] = simulate_data(phones, sound_speed, noise_pwr, signal_pwr, sampling_rate, samples, signal_hz, signal_pulse, signal_azimuth, signal_elevation) %%% simulate a 'pulse' at frequency 'signal_hz' for duration of %%% 'signal_pulse', and occuring centered at ...
function xs_hat = WavRecSep(xs_hat, xw_hat, h_hat, g_hat, decimation) % x_hat = WavRecSep(xs_hat, xw_hat, h_hat, g_hat, decimation) % % Frequency-domain implementation of a separable wavelet reconstruction. % In particular: % - the input must be the DFTs of the wavelet coefficients in each subband; % - the function ret...
% Yuan Gao, Rice University test_result = zeros(3,3); BUDDHA_TEST = dir('/Users/gaoyuan/Documents/MATLAB/TestDataset_1'); BUTTERFLY_TEST = dir('/Users/gaoyuan/Documents/MATLAB/TestDataset_2'); AIRPLANES_TEST = dir('/Users/gaoyuan/Documents/MATLAB/TestDataset_3'); TRAINED_DATA = [FEAT.BUDDHA; FEAT.BUTTERFLY; FEAT.AIR...
%Space2: the GUI for Space2 tests % NO-LONGER uses dynamically updated buffers to allow longer stimuli (max about 30,000 msec) % stimuli are NOT written to disk for each loc, then loaded and played out % note: when changing stim duration, the next play-out has a large glitch % to accomodate this, each run of the ...
function[mu, var, time] = gprPITC(K, Ks, Kss, y, hyp) tic [n, ~] = size(K); sigma = exp(2*hyp.lik); % choose a random set of m_rank indices for the active set perm = randperm(n); u = perm(1:hyp.k); m=length(u); tic; [L, L_partition] = getLambda(K,getQ(K,1:size(K,1),1:size(K,1),u),sigma,m); Sigma = getS(K,L,u,L_part...
% First run the top script to set up the ss model. top; %% % We will now close the loop around the system, and use a PI controller % with our velocity feedback to choose a setpoint. % This model will use SIMULINK to create the feedback system.
function y = overlap_save(x,h,lc) % Length of x lx = length(x); % Length of impulse response lh = length(h); % Sample size equals length of h minus 1 plus chunk size x_b_size = lh - 1 + lc; % Size of convolved output of x_b and h equals length of h minus 1 plus % x_b_size. y_b_size ...
clear; close all; clc; addpath(genpath(('../third_party'))); modelsDir = '../3dmodels/'; %% Parameters modelName = 'jerboa'; resolution = 120; pad = 0; %pad = floor( ((sqrt(3) - 1)/(2 * sqrt(3))) * resolution + 1); %% Model initialization modelPath = strcat(modelsDir, modelName, '.stl'); Original = dippingPreproce...
function handles = sortLayers(handles) %SORTLAYERS Sorterer T2* billederne i snit % Finder først de unikke værdier i T2-billedernes SliceLocation. Således % opdeles der i lag (T2.LayerNo). % Gemmer antallet af lag i handles (NumbOfLayers) % For hvert lag gemmes de tilhørende billeder i handles (Layers.Imag...
function T = read_fs_files(path) T = fileread(path); T = regexp(T, '\n', 'split'); if isempty(T{end}),T(end)=[];end header_lines=cellfun(@(A) strcmp(A(1),'#'),T); T(header_lines)=[]; T = cellfun(@(A) strsplit(A),T,'UniformOutput',false); end
classdef GTM_Pi_Norm < GTM_Pi %GTM_Pi_Norm Summary of this class goes here % Detailed explanation goes here methods function obj = GTM_Pi_Norm(img,rf,smoother) obj@GTM_Pi(img,rf,smoother); end end end
function output = dM(ax, ang) if (norm(ax) == 0 | ang == 0 ) output = eye(3); else ax = ax/norm(ax); output(1,1) = ax(1)^2+(ax(2)^2 + ax(3)^2)*cos(ang); output(1,2) = -(ax(3)*sin(ang)) + ax(1)*ax(2)*(1 - cos(ang)); output(1,3) = ax(2)*sin(ang)+ax(1)*ax(3)*(1 - ...
function metrics = calculateMetrics(pattern) % This function calculates a set of metrics for a provided pattern. Any % set of functions can be called from here, that each generate their own % metric(s) for a pattern, and then these are combined into a single row % vector that is visible to the remainder of the cod...
classdef TPA_MotionCorrectionManager % TPA_MotionCorrectionManager - corrects image motion in image stack using % different algorithm % Inputs: % none % Outputs: % motion path %----------------------------- % Ver Date Who Descr %----------------------------- % ...
function Shrew_Decoding %% SaveDir = [ cd '\' 'Randomized' '_Decode\']; if exist( [SaveDir 'MD'] ) ~= 0 rmdir([SaveDir 'MD'],'s') mkdir([SaveDir 'MD']); elseif exist( [SaveDir 'MD'] ) == 0 mkdir([SaveDir 'MD']); end if exist( [SaveDir 'PFC'] ) ~= 0 rmdir([SaveDir 'PFC'],'s') ...
clc; clear; close all; load('T0020_points.mat'); thetaH = pi/2; thetaPrim = thetaH - theta ; phiPrim = atan((z./y).*cos(thetaPrim)); Err = abs(phi - phiPrim); imagesc(Err);figure(gcf);
function im_all = spiral3drecon_200520(doRots, Ndel, doGoldenAngle, doTraj) % function im_all = spiral3drecon_200520(doRots, Ndel, doGoldenAngle, doTraj) % % spiral3drecon % % Luis Hernandez-Garcia @UM 2020 % % 1- This script reads FIDs from the GE scanner acquired with a % noncartesian 3d trajectory % 2 - it reads the...
function Capacityreconfskv3 = Capacity_SMTreconfskv3(Nr,SNR_Vector,freqno,reconantenna) Capacityreconfskv3=Nr*log2(1+10.^(SNR_Vector/10))+log2(freqno)+log2(reconantenna); end
function varargout=sml1_imana_BG_new(what,varargin) % ------------------------- Directories ----------------------------------- %baseDir ='/Users/eberlot/Documents/Data/SuperMotorLearning'; baseDir ='/Volumes/MotorControl/data/SuperMotorLearning'; behavDir =[baseDir '/behavioral_data/data']; ...
function p = predict(theta, X) %PREDICT Predict whether the label is 0 or 1 using learned logistic %regression parameters theta % p = PREDICT(theta, X) computes the predictions for X using a % threshold at 0.5 (i.e., if sigmoid(theta'*x) >= 0.5, predict 1) m = size(X, 1); % Number of training examples % You nee...
function [C, sigma] = dataset3Params(X, y, Xval, yval) %EX6PARAMS returns your choice of C and sigma for Part 3 of the exercise %where you select the optimal (C, sigma) learning parameters to use for SVM %with RBF kernel % [C, sigma] = EX6PARAMS(X, y, Xval, yval) returns your choice of C and % sigma. You should co...
function ans = equation_11( J, mu ) ans=J+mu+1; end
function [positions] = modalities_sample(modalities, mask, N, kernel) if isempty(modalities.map) positions = []; return; end modalities.map = scalemax(modalities.map, 1); mask = mask .* (imfilter(double(modalities.map > 0.2), ones(5)) > 15); positions = zeros(N, 2); ...
r = {}; % r1 = load('comparacao2.mat'); % r1 = r1.resp; % r = [r,r1]; % r1 = load('comparacao3.mat'); % r1 = r1.resp2; % r = [r,r1]; % r2 = load('comparacao4.mat'); % r2 = r2.resp; % r = [r,r2]; r3 = load('fieldmap_analysis_modelo5_6segmentos.mat'); r3 = r3.r; r = [r,r3]; r4 = load('fieldmap_analysis_modelo6_6segment...
function [MatrixResults, time_MTF_GLP_CBD, I_MTF_GLP_CBD] = doMTF_GLP_CBDSens0(imageDataFile) % doMTF_GLP_CBDSens0 performes a MTF_GLP_HPM reconstruction of a Multi-spectral image, % whose relevant information is contained in ./Sensors/data/imageDataFile.mat file, % the obtained results are compared with groundtruth fo...
function assetList = FetchAssetList( index_name, index_time,conn, table_name ) %FETCHASSET 通过查询条件取股票代码 % conn 连接数据库句柄 % table_name 表名 % index_name 给定的指数 % index_time 给定的时间 % Cheng,Gang; 2013 %% default values if nargin <4 table_name = '[as].aindexmembers_temp'; if nargin < 3 conn = database('db','sa',...
classdef TrialTonesInstruction < WBTrial methods function start(this) roundn = this.flow.variable(['Block0-RoundNum']); % CREATE THE INSTRUCTION SCREEN ti = WBTextDisplay('TONES TEXT', '', 26); %ti.xLoc = 50; if (roundn == 0) ...
function op_setfigcolorbar(ax,ylabel_str,pos) if nargin > 1 gca = ax; end set(ax,'fontsize',20,'linewidth',1.5,'box','on') hylabel = ylabel(ax,ylabel_str,'rotation',270); h_ylabel = get(ax,'Ylabel'); h_xlabel = get(ax,'Xlabel'); set(h_ylabel,'Fontsize',20) set(h_xlabel,'Fontsize',20) set(gcf,'color',[1 1 1]) pos = ...
function [ x, y ] = XYZ2xy( X, Y, Z ) % x = X/(X + Y + Z); y = Y/(X + Y + Z); end
% Sean Smith and Tommy Unger % CS 542 Spring 2016 % Spring 2016 %Markov random field close all %im = img_to_bip('images/bayes_dirty.png'); im = imread('images/bayes_dirty.png'); im = int8(im); im = (im * 2) - 1; y = im; sz = size(im); xdim = sz(2); ydim = sz(1); count = 0; wrapN = @(x, N) (1 + mod(x-1, N)); h = ...
function R = resilient_estimation_Withoutprior(m,n,Pa) % function R = resilient_estimation_Withoutprior(m,n,Pa) % Description: % This function is evaluate the performance of resilient % estimation, if estimate error is larger than 1%*x0, the % estimation fails, otherwise it succ...
% GLUECK: Growth pattern Learning for Unsupervised Extraction of Cancer Kinetics % Akaike Information Criterion, AIC % as from [Burnham and Anderson, 2003] function aic = model_aic(alfa, sigma, p, M, y) N = length(M); sum_sse = model_sse(alfa, sigma, M, y); aic = N * log(sum_sse / N) + 2*p; end