text
stringlengths
8
6.12M
function plotProperties() set(gcf,'Position', [0,0,800,400]) set(gca,'FontSize',14) set(gca, 'FontName', 'Times New Roman'); set(gca,'box','on'); set(0,'defaultlinelinewidth',0.5) set(get(gca, 'xlabel'), 'interpreter', 'latex'); set(get(gca, 'xlabel'), 'FontName', 'Times New Roman'); set(get(gca, 'xlabel'), 'FontSize...
function [theta, phi, bias] = lblDm(phiPriorMean, thetaPriorMean, biasPriorMean, phiInit, thetaInit, biasInit, phiPrec, thetaPrec, biasPrec, options, data, maxiter, dataNumber, impFeat, wPrior, dPrior) savefile = strcat('modelsResult', num2str(dataNumber), '.mat'); dataN = sum(data,2); numDocs = size(data, 1); ...
%% Information % Author: % - Nicolas Kylilis, PhD in Synthetic Biology & Molecular Biology % Date: % - 20th Aug 2020 % Description: % - Computer program that transfroms a part sequence to a StA_Level0 DNA % assembly format sequence. % -- Inputs: 1) the part sequence; 2) the StA format prefix&suffix % sequence...
function [partition, m, K, partition_bin] = pycrprnd(theta, sigma, n) % % PYCRPRND samples a partition from the Pitman-Yor Chinese restaurant process % [partition, m, K, partition_bin] = pycrprnd(alpha, sigma, n) % %-------------------------------------------------------------------------- % INPUTS % - the...
function [ J, p ] = current1D( x, V, pb, pt ) %This gives the current density and charge distribution for a 1D voltage %distribuion assuming boundary condition for leftmost side (i.e. set left %to 0 V) and right (set righthandside to some voltage Vapp) %Inputs % V: array of voltages % pb: boundary condition for conce...
clc; clear all; global Psi T miu_k k; k = 0; % x0=[0 3 0 1 0 1 1 1 1 1 1 1 1 (0.3-0.5*1)/0.14+10*1 0.7/0.14 -0.3/0.14]; x0=[0 3 0 1 0 1 5 0 0 0 0 0 0 0 0 0 0]; TT=30; [t,X] = ode23s(@TwoDOF_CIM,[0 TT],x0); figure(1) subplot(4,1,1) % plot(t,Psi*inv(T)*X(:,11:13)','b','LineWidth',1.5); plot(t,X(:,2),...
function meandata = ReadFullCalImages(filepath,wavelength,ref,nSteps) %Wavelength = scalar wavelength value %filepath = string to .h5 file %ref = 1x64 of mean reference fluxes normalized to first reference flux %nSteps = number of measurements taken (64 usually) fn = extractAfter(filepath,"Dichroic_Analysis\"); wv = ...
function [obj,varargout] = plot(obj,varargin) %@frdiff/plot Plot function for frdiff objects Args = struct('HideTitle',0,'Color','b','GroupPlots',1,'GroupPlotIndex',1, ... 'ArgsOnly',0,'ReturnVars',{''}, ... 'Hist',0,'Max',0,'VMag',0,'VAng',0,'Corr',0,'HistBins',[], ... 'YYMeanVMag',0,'YYVAngMax',0,'YScale','...
function [y,P,Y1]=ut_meas(h,X,Xn,Wm,Wc,R) %[z1,P2,Z2]=ut_meas(hmeas,X1,Xn,Wm,Wc,R); L2=size(X,2); n=size(R,2) ; y=zeros(n,1); Y=zeros(n,L2); for k=1:L2 Y(:,k)=h(X(:,k),Xn(:,k)); y=y+Wm(k)*Y(:,k); end Y1=Y-y(:,ones(1,L2)); P...
addpath('../') region = fetchregion([43.450467, 43.546597], [-110.837225, -110.732854], ... 'display', true); elevData = region.readelevation([43.450467, 43.546597], ... [-110.837225, -110.732854], ... 'SampleFactor', 10, ... ...
function [ nav, portfolio,tradelist ] = CalcY(position,fundInitValue,price,commission_index,slippageRatio,volume) %% Calculate net value of portfolio % 使用仓位计算净值,涉及价格、费用和滑点 % 核心方法 % [ nav, portfolio,tradelist ] = CalcY(position,fundInitValue,price,commission_index,slippageRatio,volume) % position: TsMatrix类 % fundInitV...
function [ avg_met_dev ] = avgMetDev( E, nz_buzz_times, nz_tap_times, plot_on ) %AVGMETDELAY Calculate the average metronome delay during a steady %metronome %Nicole Ortega @ 7/24/2017 met_period = E.met_period; d = diff(diff(nz_buzz_times)); indx = find(d > .001 | d < -.001, 1, 'first'); steady_met = nz_buzz_times(1:...
function [ output_args ] = plsr(ncomp) [folder_path] = uigetdir('../stats', 'Load Wrist Stats Data'); sub_folder = dir(folder_path); count = 0; for p = 3 : length(sub_folder) file_name = dir(fullfile(folder_path, sub_folder(p).name, '*.csv')); file_path = fullfile(folder_path, sub_folder(p).name); ...
addpath('/home/lixian/speech/MatlabCode/STRAIGHT/TandemSTRAIGHTmonolithicPackage002Test'); emotion=strvcat('neutral' ,'happy', 'angry','sad') pdir=[pwd '/../']; plotFigures = 0; % If you do not need plots, set this variable 0. for jemotion=1:4%size(emotion,1) dir=[pdir deblank(emotion(jemotion,:))]; mkdir([ di...
function [Rule] = productRule Rule.transform=@(controls)transform(controls); Rule.evaluate=... @(this_material_index,cell_index,controls)evaluate(this_material_index,cell_index,controls); Rule.sensitivity=... @(this_material_index,cell_index,controls)sensitivity(this_material_index,cell_index,controls); end %%%...
function [gtrain gtest] = accuracySamples(m, delta, k) # m = samplesNeeded(g, delta) # Computes the least number of samples (m) needed to ensure that that the training error e # is less than (100-delta) percent with a probability less than g. # Inputs: # g: The confidence level (0,1) with which we need to predict. # d...
clc; %读取训练图片数据文件 [FileName,PathName] = uigetfile('*.*','选择测试图片数据文件t10k-images.idx3-ubyte'); TrainFile = fullfile(PathName,FileName); fid = fopen(TrainFile,'r'); %fopen()是最核心的函数,导入文件,‘r’代表读入 a = fread(fid,16,'uint8'); %这里需要说明的是,包的前十六位是说明信息,从上面提到的那个网页可以看到具体那一位代表什么意义。所以a变量提取出这些信息,并记录下来,方便后面的建立矩阵等动作。 MagicNum = ((a(1)*256+...
function [error_M,error_A,P] = compare_2_endmembers(M1,M2,A1,A2,m,n,... names,wl,show_figure,options) %COMPARE_ENDMEMBERS Summary of this function goes here % Detailed explanation goes here if nargin < 9 show_figure = 0; end if nargin < 10 options = []; end A1 = double(A1); % use_uncertainty = 0; var_d...
function [newCandidate,bestGenArray] = PlusSelection(candidate, bestGenArray, mu, i) [~,I]=sort(candidate.fit,'descend'); %best value for each generation bestGenArray(i)= candidate.fit(I(1,:),:); newCandidate.binx(1:mu,:) = candidate.binx(I(1:mu),:); newCandidate.biny(1:mu,:) = candidate....
A = load('/home/harald/ws/scan_match/logs/lidar_raw.txt'); angle = A(:,2); dist = A(:,3); X = cos(angle).*dist; Y = sin(angle).*dist; offset = 0; fig = figure; hax = axes; hold on; line([offset offset], [0 3635],get(hax,'YLim'),'Color',[1 0 0]) line([offset 2430+offset], [3635 3640],get(hax,'YLim'),'Color',[1 0 0])...
function PK_model_data_voxelwise = create_voxelwise_PK_model_data_struct(PK_model_data_scanwise, varargin) fields_to_ignore = {'Info'}; if length(varargin) fields_to_ignore = {fields_to_ignore{:} varargin{:}}; end % Get a list of struct fields to process struct_fields = fieldnames(PK_model_data_scanwise); valid_id...
function Irow = inertia_row_5(rob,in2) %% INERTIA_ROW_5 - Computation of the robot specific inertia matrix row for corresponding to joint 5 of 6. % ========================================================================= % % Irow = inertia_row_5(rob,q) % Irow = rob.inertia_row_5(q) % % Description::...
function [ R, x, stepT ] = Comp( gyro, Mea, sf, parameters ) N = size(gyro,2); dt = 1/sf; %% settings % angular velocity noise parameters if exist('parameters','var') && isfield(parameters,'omegaNoise') randomWalk = parameters.omegaNoise.randomWalk; biasInstability = parameters.omegaNoise.biasInstability; els...
function [data,flag_task] = Trans(veh_info,TimeToGo) %车辆和VEC传输任务 setting; d = sqrt(d_r^2 + (RoadLength/2 - veh_info(1,1))^2); if d > Radius flag_task = 1; %传输计算任务失败 else Rate = veh_info(5,1) * log(1 + P_t * d^(-P_loss) / P_n); %传输速率 单位:bit/s data = veh_info(9,1) - Rate * TimeToGo / 10^6; flag_task = ...
function tof_map = threshold_picker(varargin) %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %varargin{1}: rfdata %varargin{2}:kgrid %varargin{3}:frequency [kHz] %‚µ‚«‚¢’l–@‚Å”gŒ`æ“ª‚𒊏o‚·‚éD %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %“‰Šú‰»““““““““““““““““““““““““ if nargin == 2 % ‘—M”g’†SŽü”g”F‚QMH‚š rfdat...
%THINNING Applies a binary blob thinning operation, to achieve a skeletization of the input image % % dst = cv.thinning(src) % dst = cv.thinning(src, 'OptionName',optionValue, ...) % % ## Input % * __src__ Source 8-bit single-channel image, containing binary blobs, with % blobs having 255 pixel values. % %...
classdef side %SIDE Summary of this class goes here % Detailed explanation goes here properties xA yA xB yB m p xMatrix yMatrix end methods function obj = side(xA,yA, xB, yB) %SIDE Construct an instance o...
clear; addpath('D:\SEMESTERS\Sem7\neural\project\libsvm-3.18\libsvm-3.18\windows'); s = RandStream('mt19937ar','Seed',1); RandStream.setGlobalStream(s); n_points = 20; range = 10; X = range*rand(n_points, 2); n_plots = 100; psfile=[strtok('test','.') '.ps']; pdffile=[strtok('test','.') '.pdf']; ...
function dsigma_dq = dsigma_dq(q1,q2,q3,q4,q5,th) %DSIGMA_DQ % DSIGMA_DQ = DSIGMA_DQ(Q1,Q2,Q3,Q4,Q5,TH) % This function was generated by the Symbolic Math Toolbox version 8.5. % 22-Apr-2020 15:08:02 t2 = sin(q1); t3 = q1+q2; t7 = th.*4.0e+2; t4 = cos(t3); t5 = sin(t3); t6 = q3+q4+t3; t8 = t2.*1....
clear var acciones aux_estado = [0 0 0; 0 0 0; 0 0 0]; acciones = []; for i = 1:length(experiencias) if experiencias(i).E == aux_estado; aux_accion = experiencias(i).A; acciones = [acciones aux_accion]; end % % if experiencias(i).R == 1 % acciones = [acciones aux_accion]; % ...
function [newModuleFrames] = transform_snake(moduleFrames, T) % TRANSFORM_SNAKE % [new_module_frames] = transform_snake(module_frames, T) % % Given a shape of the snake in the form of a set of homogeneous % transforms, and a new homogeneous transform, the snake is transformed to % a new body frame. % % For example: ...
%LINEARFE linear FE solver % LinearFE (L, EI, q, N) performs a linear finite element analysis on a % beam. The beam has 4 degrees of freedom, given by: % i,j=1: displacement at first node; % i,j=2: rotation at first node; % i,j=3: displacement at second node; % i,j=4: rotation at second node. % ...
clear; global b; J = [2, 1; 3, 2]; [eigvec, eig] = eig(J); lam1 = log(eig(1,1)); lam2 = log(eig(2,2));
% The RemoveAction function helps to creates an image that % has the action removed by applying a median filter. % % Input: sourceImageArray - A 1xn 1D cell array containing n % images, where each element is an RGB image % % Output: OutputImage - An RGB image (stored as 3D arrays of ui...
function fig = ManageListFig() % This is the machine-generated representation of a Handle Graphics object % and its children. Note that handle values may change when these objects % are re-created. This may cause problems with any callbacks written to % depend on the value of the handle at the time the object was save...
run('EO_boundary'); data_path = '~/Data/Extracted/bound_shift/'; subjects = { 'Daphne' 'Julia' 'Sucty' 'Leora' 'Loek' 'Dominiek' 'Chris' 'Sacha' 'Renout' 'Roel'}; n = numel(subjects); classification_rates_ctrl = zeros(n, 12); classification_rates_exp = zeros(n, 12); Allchannels = [1:64]; channelsgood = A...
function num = count_unique_keypoints (keypoints) % num = COUNT_UNIQUE_KEYPOINTS (keypoints) % % Returns the number of keypoints that are unique with respect to % center coordinates and size. % % Input: % - keypoints: array of OpenCV keypoint structures % % Output: % - num: num...
%---- Implementación criterio de corte por estructura % Una parte relevante de la población no cambia de generación en generación function changed = compute_change(old_pop, new_pop) global parte_pobl; global error_estruc; global structure_changes; changed = 0; inv_n = size(old_pop,1); lotus_n = size(old_pop,2); ind_...
function [ Px, Py , delta_x, delta_y, x_mat, y_mat] = gen_dist( n,cx,cy,r1,r2,g1,g2,xmax,ymax,xmin,ymin ) %GEN_DIST Summary of this function goes here % Calcul de la déviation nécessaire pour chaque rayon pour que les % paramètre de distortion soient respectée. La fonction de distortion est % calculée directement...
function ERP = ctap_manu2_grdavg_oddball_erp(... ERPS, cond, eeg_srate, path, name, loclab, PLOT) if ~exist('PLOT', 'var'), PLOT = true; end ERP = cell(numel(cond), 1); %%%%%%%% Obtain condition-wise grand average ERP and plot %%%%%%%% for c = 1:2:4 ...
%Add the current directory here cd('C:\Users\...') fileID_15=xlsread('number_of_green_pixels_15.xlsx'); fileID_10=xlsread('number_of_green_pixels_10.xlsx'); fileID_5=xlsread('number_of_green_pixels_5.xlsx'); year=fileID_15(:,1); month=fileID_15(:,2); year=year(month==2); %Divide by 4.66 to produce km square...
function [ nr_bits_per_symbol ] = test_constellation(type_of_mod) %UNTITLED5 Summary of this function goes here % Detailed explanation goes here if strcmp(type_of_mod, 'qpsk') == 1 nr_bits_per_symbol=2; elseif strcmp(type_of_mod, 'bpsk') == 1 nr_bits_per_symbol=1; elseif strcmp(type_of_mod, '16-QAM...
%% High Pass - Butterworth %%Karamesinis Antonios-Rafail %% AEM a_1 = 8; a_2 = 4; a_3 = 3; a_4 = 0; %% Prodiagrafes m = 0; fp = (4 + m) * 10^3; fs = fp / 2.6; a_min = 24 + a_3*(6/9); a_max = 0.5 + a_4/36; w_p = 2*pi*fp; w_s = 2*pi*fs; Wp = 1; Ws = w_p/w_s; %% sintelestes a, e, taksi filt...
function att1 = aligni0vn(imu, pos, t1) % SINS initial align based on inertial-frame & vn-meas method. % % Prototype: att0 = aligni0(imu, pos, t1) % Inputs: imu - IMU data % pos - position % t1 - inertial-frame align time % Output: att1 - attitude align result % % Example: % glvs; % [imu, avp0, ...
function c=fcoefMaclaurin3(grau) %f(x)=sen(x) naux=fix((grau-1)/2); %grau=(2*n+1) -> ultimo indice = grau+1 %coeficientes nulos de índices i impares: for i=1:2:grau+1 c(i)=0; end %coeficientes não nulos de índices (2*i+1) pares: for i=1:1:naux+1 c(2*i)=(-1)^(i+1)/factorial((2*i-1)); end end
function im=colorbar_flush(h,hc,data,mask,lim,cscale,t,intensity,int_lim,gamma) % Copyright (C) 2013 Imperial College London. % All rights reserved. % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % ...
%Constants eps0=8.85418782e-12; % F/m mu0=1.2566370614e-6; % H/m c0=1/sqrt(eps0*mu0); eta0 = sqrt(mu0/eps0); width1 = 0.005; %1/2 cm width2 = 0.01; % 1 cm width3 = 0.02; % 2 cm %% Get data air_file = 'Brandon(1)emptycoax.s2p'; frequency = dlmread(air_file,' ',9,0,[9 0 209 0])/1e9; air_m11 = dlmread(air_file,...
function [X,B]=get_iwcoff(W,B) wname ='db4'; samp = waverec2((real(W(1,:))),B,wname); X1 = zeros(size(samp,1),size(W,1),size(samp,2)); X2 = X1; for k =1:size(W,1) X1(:,k,:) = waverec2((real(squeeze(W(k,:)))),B,wname); X2(:,k,:) = waverec2((imag(squeeze(W(k,:)))),B,wname); end X = X1+1i*X2;
clc, clear, close all I = imread('issimple2_demo.png'); I = double(I); I = I(:,:,1); I = 1-I/max(I(:)); figure; imagesc(I) colormap gray axis off axis square hold on tic; S = zeros( size(I) ); R1 = zeros( size(I) ); for i=find( I==1 )' if issimple2(I,i) [x,y] = ind2sub(size(I), i); R1(y, x) = 1; ...
function IR = ISM_dis(sourc_x,sourc_y,sourc_z,mic_x,mic_y,mic_z,width,large,... height,Fs) %ISM_mov Based on 'ISM.m'. Distance damping coefficient was added. % IR vector initialization IR = []; % Sound velocity cSound = 340; % Air damping coefficient airDamp = 0.005; % Number of reflections per ...
function ChibiOS_SelectCallback(hDlg, hSrc) % ChibiOS_SelectCallback is called from "configuration parameters" window % after target selection % assignin('base','hDlg',hDlg); assignin('base','hSrc',hSrc); h = waitbar(0,'Setting configuration. Please wait...','Name','ChibiOS Setup'); ChibiOS_DefaultConfig...
function pixel = create_pixel(B, L,side_length) %生成二维数组,表示元胞空间的状态矩阵 global pixellength;%道路长度 pixel = zeros(pixellength,B+2);%生成pixel矩阵 pixel(1:pixellength,[B,B+2]) = -1000;%设置障碍行程干路 pixel(floor((pixellength-side_length)/2):pixellength-floor((pixellength-side_length)/2),1:B-1)=-1000;%生成小区范围 for i = 1:pixellength if ...
% Script used to demonstrate the use of different facial feature detectors % for face frontalizations. % PLEASE MODIFY THIS SCRIPT AS REQUIRED BY THE FACIAL FEATURE DETECTOR % INSTALLED ON YOUR SYSTEM. This is part of the distribution for % face image frontalization ("frontalization" software), described in [1]. %...
%{ this is a handle for the stabilizing Linear MPC scheme. min. 1/2 sum_{k=0}^{N-1} ||y_k - y_r||_Q + ||u_k - u_r||_R + ||x_N - x_r||_P s.t. x^+ == Ax + Bu \forall k\in[0,N-1] lmin <= Mx_k <= lmax \forall k\in[0,N] umin <= u_k <= umax \forall k\in[0,N-1] The handle takes the system and ...
function [distsVerified] = distanceVer(dists) %if one or more of the three distance measurements are off by 5%... %displays dialogue box alerting the user, and asking if they want... %to continue anyway. mistake = 'No'; if abs(dists(1,1)-dists(1,2)) > dists(1,1)*.05 prompt = questdlg('One or more of your values...
function varargout = static(varargin) % STATIC MATLAB code for static.fig % STATIC, by itself, creates a new STATIC or raises the existing % singleton*. % % H = STATIC returns the handle to a new STATIC or the handle to % the existing singleton*. % % STATIC('CALLBACK',hObject,eventData,handles,...
% 计算每只股票的过去LookBack(参数)日的动量,并作标准化处理作为股票权重,持有Holding(参数)日,其中权重允许为负数,即允许做空股票 %% % !!!!!!add 提取数据 %% weight function weight = calc_mom(price,lookback) weight = zeros(size(price)); weight(:,1) = price(:,1); [m,n] = size(price); % weight(1:lookback,2:end) = nan; weight(1:lookback,2:end) = 0; for j ...
clear; addpath(genpath('~/github/global_tool')); % [ver, face] = read_wrl('/home/scw4750/3-13-preprocess/BU_3DFE/F0001/F0001_AN01WH_F3D.wrl'); ffp = '/home/scw4750/3-13-preprocess/BU_3DFE/F0002/F0002_AN01BL_F3D.wrl'; img_ffp = [ffp(1:end-6) '3D.bmp']; pt5_ffp = [img_ffp(1:end-3) '5pt']; % [ver, face, texture_idx, textu...
%% Binary file creator clear %% Paths %% Make file fp1 = fopen('Sound_tx1iii.bin', 'wb'); fwrite(fp1,Tx_soundIQ_int,'int16'); fclose(fp1);
function smooth(im,colm) Image=im; n =1; m =colm; a='a'; if m==8 kk='a'; end if m==3 kk='b'; end if m==2 kk='c'; end Image = imresize(Image, [712 712]); rf = floor(712/n); cf = floor(712/m); m=1; for v = 1:n for s = 1:m %nXm files need to be made startr = (v-1)*rf; startc =...
function [p ] = payoff_1( S ) % 输入量S是一个序列 T = size(S,2); M = floor(T/2); if M > 1.4 || M<0.95 p = S(:,M).*S(:,M); else p = max(S(end) - 1, 0 ) + S(end-1)/2; end end
% % %Script Author @ Amr Abdeen% % % % % close all % % clc % % clear % % % X=[1,2,3;4,5,6]; %Test Array% % plot(X) % % X=[1 2 3 ; 4 5 6 ; 7 8 9] % % %plot(X,'r*') % % %grid on % % X=linspace(1,200,50) % % m=1 % % b=0 % % Y=(X*m)+b % figure % % %hold on % % plot(X,Y,'*') % % axis([0 50 0 100]) % % title('Plotting')...
Nw=10; %number of equalizer coefficients h=[0.1; 0; 0; 0.5; 3; 0.2; -0.1]; %channel impulse response Nh=length(h); %number of impulse response coefficients Hhat=convmtx(h,Nw); %convolution matrix. Note that Hhat*w = conv(w,h) Nc=Nw+Nh-1; %number of elements in convolution output MSEvalues=zeros(Nc,1); %pre-allocat...
% %% stack Microcat data % clear num p t c s th % % for n = 1:numel(data(1).Microcats) % num{n} = []; % p{n} = []; % t{n} = []; % c{n} = []; % % for i = 1:numel(data) % hold on % num_ = cell2mat(data(i).Microcats(n).Timestamp); % % p_ = data(i).Microcats(n).Pre...
function [p_ref,t_ref,master_ref,idx_ref,rfht] = ... create_refinement(p,t,refine_list,refref) % function [p_ref,t_ref,master_ref,idx_ref,rfht] = ... % create_refinement(p,t,refine_list,refref) % % Create refined mesh using reference refinement refref. % (p,t) represent the unrefined "master" triangulation, % wh...
function config_info=Interp_GetConfigInfoStr(SrcImageName, DesImageName, ROIImageInfo, ROIImageInfoNew) config_info = cell(30,1); config_info{1,:} = SrcImageName; config_info{2,:} = sprintf('Endian = %d', 0); config_info{3,:} = 'unsigned short'; config_info{4,:} = sprintf('x_dim = %d', ROIImageInfo.XDim); con...
% FOLDER - A class that manages and provides utilities for path strings pointing to folders. % % Folder Properties: % Exists - Gets a Boolean indicating whether or not the file or folder exists on the computer. % FullPath - Gets a string containing the full path to the stored reference. % Name - Gets a string c...
function [avgpeaks_LP, avgpeaks_HP] = avg_peaks(final_locs_l_max, final_locs_h_max, timeframe, xl_filt_offset, xh_filt_offset, k) peak_idx_LP = final_locs_l_max{1,k}; peak_idx_HP = final_locs_h_max{1,k}; avgpeaks_LP = zeros(1,2*timeframe+1); avgpeaks_HP = zeros(1,2*timeframe+1); for i = 1:size(peak_idx_LP) ...
function L = CholeskyZerlegung( A ) % Berechnet die Cholesky-Zerlegung der Matrix A % Rückgabewert ist die untere Dreiecksmatrix L N = size(A,1); L = zeros(N); for j = 1:N % Schritt 1: Diagonalelement berechnen % Schritt 2: Spalte von L nach unten auffüllen end
function rootPath = iterSpEstRoot() rootPath = which('iterSpEstRoot'); rootPath = fileparts(rootPath); end
% Intrinsic and Extrinsic Camera Parameters % % This script file can be directly executed under Matlab to recover the camera intrinsic and extrinsic parameters. % IMPORTANT: This file contains neither the structure of the calibration objects nor the image coordinates of the calibration points. % All thos...
function result = testChange(Data) Data(1:end,2)=0; % Data(51:100,2)=100; % Data(51:end-50,2)=100; Data(51:65,2)=100; Data(end-10:end,2)=100; result=Data;
function [Sx, Varx, ftt1fill, fttfill] = fftTemplatePre(template, ny, nx) [a,b]=size(template); % precompute kernel sum(x), sum(x^2), and var(x) Sx=sum(template(:)); Sx2=sum(template(:).^2); Varx=(Sx2-Sx^2/(a*b))/(a*b-1); % generate a kernel of ones the same size as template tone...
function g = sigmoid(z) %SIGMOID Compute sigmoid functoon % J = SIGMOID(z) computes the sigmoid of z. g = zeros(size(z)); negativeZ = -z; exponent = e .^ negativeZ; ones = ones(size(z)); g = ones ./ (ones .+ (exponent)); end
function calculate_RMS_contrast imagesDir = '/home/lisandro/Work/Project_CFS/CFS/CFS_BuenosAires/Stimuli/100Stimuli/'; outDir = '/home/lisandro/Work/Project_CFS/CFS/CFS_BuenosAires/Stimuli/'; files = dir( [ imagesDir '*GB.png']); RMS = zeros(1,length(files)); for i = 1: length(files) im = double( imread([imag...
function results = compareToTruth(image_label,real_Xcentre,real_Ycentre,real_SigmaSpot,real_offsetBgNoise,real_bgNoiseStd,real_num_molecules) % % Created by Isabel Llorente-Garcia, July 2012. % If you use this code please acknowledge Isabel Llorente-Garcia in your % publications. % % Compare the results from bright spo...
classdef prob_pc_relpose_5p_sir3u < problem properties N = 5; end methods function [eqs_sym, abbr_subs] = gen_eqs_sym(obj) [in, out] = obj.gen_arg_subs(); R = sym_quat2dcm([out.s; out.u]); obj.config.R = R; eqs_sym = sym([]); ...
%% Figure 6 - L-cone curves for default human and defocus % % Illustrate the disp('**** EI Figure 6') nTrials = 100; nBasis = 40; % Integration time % Captures eye movements up to 100HZ % Adequate for absorptions (ms) tStep = 10; % Scene FOV. Larger than usual to show the continuing pooling sceneFOV = ...
%% k2_generate_and_test.m % Generates and tests the neighbourhood of the current instance % Improved speed and memory constraints for k=2 %% Input: % num_machines: The number of machines % curr_makespan: the makespan of the current instance % L: The machine numbers of all the loaded machines % M: The...
function result = shuffle(input) % function result = shuffle(input) % % re-order the data in a vector in a random order. % len = length(input); idx = randperm(len); result = input(idx); return
% Mark pixel pair locations as circles on image. function varargout = OverlayPoints(higResRgbRot, hsiImage, pixelListRgb, pixelListHsi) % [h, w, d] = size(hsiCube); point = 1; for n = 1:length(pixelListRgb) r = 3; th = 0:pi/50:2*pi; xunit = round((r * cos(th)) + pix...
% calculate the log posterior function postprob = logpost(chi, data) logpriorprob = prior(chi); lh = likelihood(chi, data); postprob = -(logpriorprob+ lh.loglh); % rt.postprob = postprob; % % rt.lh = lh.loglh; % rt.G1 = lh.G1; % rt.M = lh.M; % rt.H = lh.H; % rt.sigmat = lh...
function [wynik]=pom(A,x,wolne) rozmiar = size(A,2); koniec = false; % zmienna pomocnicza mówiąca o błędzie w algorytmie e = 10^-10; % błąd przybliżenia mnoznik = 0; % wartość przez jaką przemnażamy dodawany do innego wiersz suma = 0; % zmienna na...
close clear clc %% Special Peak %load data signal = load("Signal.csv"); % 1801 smaples ExpectedMean = load("ExpectedMean.csv"); % 0.6833 % the instructions never banned the use of the built in % function detrend in matlab and the problem stated that the bias was % linearly accumulating at some unknown accumulatio...
close all; clear all; %------------------------------------------ % Squelette de GRAPH MATLAB %------------------------------------------ % DATALOAD %------------------------------------------ % dataload du fichier data=load('Ib_HallmV_I_4_35.txt'); I = data(:,1); V = data(:,2); data=load('Ib_HallmV_I_4_35_descen...
function [out] = corr_crossval(G,varargin) % calculates crossvalidated correlations between activity patterns across % conditions. % Correlation distance is then the compliment of resulting corrs. % INPUT: % G: [numConds*numConds] crossvalivadted second moment matrix % VARARGIN: % reg: regular...
function a=Pre2p_DCT4p(a) [h,w]=size(a); for ia=3:4:h-2 a(ia:ia+3,:)=prefilter_2point(a(ia:ia+3,:)); end for ia=1:4:h a(ia:ia+3,:)=dct(a(ia:ia+3,:)); end a=a'; for ia=3:4:w-2 a(ia:ia+3,:)=prefilter_2point(a(ia:ia+3,:)); end for ia=1:4:w a(ia:ia+3,:)=dct(a(ia:ia+3,:)); end a=a';
w = -pi:0.01:pi; theta = pi/3; subplot(3,1,1) r = 0.99; H = (1 - r) ./ (1 - 2*r*cos(theta)*exp(-j*w) + (r^2)*exp(-2*j*w)); plot(w, abs(H)) title('|Hi(e^jw)|, theta = pi/3, r = 0.99') xlabel('w') ylabel('|Hi(e^jw)|') subplot(3,1,2) r = 0.9; H = (1 - r) ./ (1 - 2*r*cos(theta)*exp(-j*w) + (r^2)*exp(-2*j*w)); plot(w, abs...
function scatter3(Q, varargin) % SCATTER3 Display pure quaternion array as 3D scatter plot % (Quaternion overloading of standard Matlab function.) % % Takes the same parameters as the Matlab function of the same name, except % that the first three parameters (X, Y, Z) are replaced by a single % quaternion parameter, w...
function [cv, images] = create_cvpartition(ds) rcount = unique(ds(:, {'Dataset', 'Image', 'RegionCount'})); roi = unique(ds(ds.Relevance(:, 1) == '1', {'Dataset', 'Image', 'Region_A'})); images = outerjoin(rcount, roi, 'Type', 'left', 'MergeKeys', true); has_roi = ~isnan(images.Region_A); ...
function [A, A_Hat, C] = rotation_constraints(PI_Hat) % PI_Hat is 2F x 3K. nPose = size(PI_Hat, 1) / 2; K = size(PI_Hat, 2) / 3; %Solve all the G_k or Q_k A = zeros(2*nPose,(3*K)*(3*K)); A_Hat = zeros(2*nPose,(3*K)*(3*K+1)/2); C = zeros(1, (3 * K) * (3 * K)); %Using the rotation constraint only %For each frame,...
function triu_new_adj_matrix = frequentist_diagonal_ordering(orig_matrix,n_iter) % Input attributes: orig_matrix - the original adjacent matrix before frequentist diagonal ordering % n_iter - the predefined number of iterations % Output attributes: triu_new_adj_matrix - upper triangular of the new ...
background = zeros(8,8); for i = 1:9 for j= 1:9 if(mod((i+j), 2) == 0) background(j,i) = 1; else background(j,i) = -1; end end end pcolor(background); colormap(gray(2)); axis ij; axis square; hold on;
% example: detail enhancement % figure 6 in our paper close all; I = double(imread('test1.jpg')) / 255; p = I; r = 16; eps = 0.1^2; q = zeros(size(I)); q(:, :, 1) = guidedfilter(I(:, :, 1), p(:, :, 1), r, eps); q(:, :, 2) = guidedfilter(I(:, :, 2), p(:, :, 2), r, eps); q(:, :, 3) = guidedfilter(I(:,...
% Clear everything i.e. memory, console, etc. and close all opened images clear; clc; close all; % Delete parallel pool of workers if any delete(gcp('nocreate')); % Delete Codebook i.e. 'BOW.mat' if it exists if exist('BOW.mat', 'file') == 2 delete('BOW.mat'); end % Create new Codebook i.e. 'BOW.m...
% definindo uma função tipo "handle" %f = @(x) x.^2 - 4*x + 3 %g = @(x) sin(2*x+pi/2) % avaliando as funções %f(1) %g(0) % definindo séries de dados para a função f x = 0:-4:4 y = e % plotando o gráfico de f plot(x,y,'-or') % definindo séries de dados para a função g x = 0:0.1:4*pi; y = g(x); % ...
generateHex DIP=20; x=10; y=10; z=10; phi=90; sig=1; [T] = AIK_T3_1(x,y,z,phi,sig,DIP) TL=T; TR=T; %[f00,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,fle,fre] = FK_T3_1(TL,TR,DIP); %PLOT_T3_1(f00,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,fle,fre); [pos_vec,vel_vec] = MOTOR_DATA_T3_1(TL,TR); %[sync_packet] = PACKETS_T3_1(pos_vec...
%% ------------------------------------------------------------------------% % EE 569 Homework #3 % Date: Nov. 1, 2015 % Name: Faiyadh Shahid % ID: 4054-4699-70 % Email: fshahid@usc.edu %------------------------------------------------------------------------% clear all; clc; row = 512; col =512; BytesPerPixel = 3; fil...
% demo to test bcdLrLr1_alsls algorithm. clear all close all clc %********************************************** %--- Choose PARAMETERS of the DEMO %********************************************** %--- Data parameters ---- data_type='complex'; % choose 'real' or 'complex' to select the kind of data to g...
function outputIm = SeamlessClone(destIm,sourceIm,imMask,offsetY,offsetX) %SEAMLESSCLONE Blends SOURCEIM into DESTIM using IMMASK % % Parameters % DESTIM: background image % SOURCEIM: m by n image to blend into DESTIM % IMMASK: m by n matrix of logicals to determine which pixels of SOURCEIM % to use % O...