text
stringlengths
8
6.12M
function [Yw,Xw,estrho] = myprewhiten(Y,X); % function [Yw,Xw,estrho] = myprewhiten(Y,X); % % Created by Daniel Rowe For Luis Hernandez-Garcia % seriously by Luis HG for speed. % % Prewhiten for AR(1) noise % Y = n by p data % X = design matrix n by (q+1) % % Yw is new, whitened data % Xw is new whitened desi...
function path = lp2(X0, Xf, udata) % Local planner for 3DOF planar robots [valid, t0, tf, ... q_src_0, qp_src_0, q_src_f, qp_src_f, ... q_sen_0, qp_sen_0, q_sen_f, qp_sen_f] = checkBoundaryConditions(X0, Xf, udata.x_lb, udata.x_ub); if ( ~valid ) path = struct('xi',[],'ew',[]); return; end ...
clc clear close all %%%%% calculating MSE and PSNR %%%%% %% W=5,Wsim=3 W=10,Wsim=3: [MSE1,PSNR1]=PSNR_func(5,3); [MSE2,PSNR2]=PSNR_func(10,3); sig = linspace(0.1,1,10); % base MSE and PSNR: In=imread('krishna_0_001.png'); % noisy image Il=imread('krishna.png'); % latent image In=double(In)/255; Il=doub...
function [y] = rsqrt(x, table, num_iter, W, F, Fm) % disp(horzcat('x: ', num2str(x.double))) % disp(horzcat('x: ', x.bin)) y0 = computeY0(x, table, W, F, Fm); % disp(horzcat('y0: ', num2str(y0.double))) % disp(horzcat('y0: ', y0.bin)) y = newtonIterationBlock(y0, x, num_iter, W, F, Fm); end
% XXXXXXXXXXXXXXXXXXXXXXXXXXXX htet_export_results_to_excel_files XXXXXXXXXXXXXXXXXXXXXXXXXXXXX % % Author : Htet % Date : Sep 11, 2019 % Function : export prediction results to excel files % Syntax : htet_export_results_to_excel_files(SYSTEMS, isLateral) % % SYSTEMS - can be either lateral systems ...
function Jmat = jacFxn(t,Y_in,jacOut,knotSeq,CP,maxT) NoutCol = bSplineMat_lite(knotSeq,t/maxT,jacOut.orderS); fluxCombine = jacOut.fluxStoicTode*CP*NoutCol;%%%flux needs int k = 1./(jacOut.Y2concY*Y_in); xFract = Y_in.*k; xCoeff1 = k - Y_in.*k.^2; xCoeff2 = -xFract(jacOut.yTagBEM_denom).*k(jacOut.yTagBEM_denom);%col2...
function [r_rmse, g_rmse, b_rmse, rmse] = RootMeanSquareError(image1, image2) [h1, w1, d1] = size(image1); [h2, w2, d2] = size(image2); image1 = double(image1); image2 = double(image2); if d1 ~= d2 sprintf("Error: Image color channels are not equal."); rmse = 0; ...
%Project by Students: % % Παναγιώτης Πράττης / Panagiotis Prattis % %Code for: % Isolate columns, join tables and create a new matrix % containing the common elements of the u, u1 matrixes % u = u(:, [1 2]); u1 = u1(:, [1 6:24]); [~, length_i] = ismember(u(:, 2), u1(:, 1)); Matrix = [u, u1(length_i, 2:2...
function [ newDBN ] = dbninit( dbn, x ) %dbninit initilaze dbn using rbminit for u = 1 : numel(dbn.sizes) - 1 dbn.rbm{u} = rbminit( dbn.rbm{u}, x ); end newDBN = dbn; end
%Prob. 6(b) w = linspace(-3*pi, 3*pi, 61); Fs1 = 30; T1 = 1/Fs1; F1 = linspace(-3/2/T1, 3/2/T1, 61); X1 = zeros(1, 61); for N = 1:61 W = (N-31)/10*pi; for k = -1:1 if (W-2*pi*k)/T1 - 16*pi == 0 X1(N)= X1(N) + 1/T1*4; elseif (W-2*pi*k)/T1 + 16*pi == 0 X1(N)= X1(N) + 1/T1*2...
function run_null_lda_cc_sf(measure, varargin) defaults = struct(); defaults.n_perms = 1; defaults.p_training = 0.75; defaults.per_context = true; defaults.is_drug = false; defaults.start = 1; defaults.stop = []; defaults.analysis_type = 'lda'; defaults.specificity = 'contexts'; defaults.n_trees = 50; defaults.config ...
l1 = 10; % length of first arm l2 = 7; % length of second arm % l3 = 4; nr_p = 50; theta1 = linspace(0, pi/4, nr_p); % all possible theta1 values theta2 = linspace(0, pi/2, nr_p); % all possible theta2 values % theta3 = linspace(0, pi/4, nr_p); % all possible theta3 values [THETA1,THETA2] = meshgrid(theta1,theta2); ...
function y = sum_of_squares(x1,x2) y = ((0.75*(x1*x1)) + (2*(x2*x2))); end
function plot(obj,key) [m,rz] = fetchn(vis2p.RFMapRaw(key),'onpoff_rf','rz'); for i = 1:length(m); im = double(imresize(m{i},1/rz)); [~,X] = max( squeeze(mean(im,3)),[],3); [~,Y] = max( squeeze(mean(im,4)),[],3); clf; % set(gcf,'position',[680 756 660 342]) subplot(2,4,1:3) imagesc(...
function [MKT, HML, SMB, VOD, BP, SHELL, GSK, SL] = DatasetHandling() % Load from Excel datasheet = 'BookN100.xls'; SMB = dataset('XLSFile', datasheet ,'Sheet','SMB') file = 'SMBdata.dat'; % Save to matlab dataset save(file, 'SMB') % Load from matlab dataset load(file,'-mat') MKT = dataset('XLSFile',datash...
%输入脸部视频 %将人脸视频先定位6个点,再根据6个点每个点分五块皮肤,每块皮肤像素绿色通道取平均得到30段序列,划分训练集与测试集保存 clc clear addpath('.\脸部视频') num=1; row=1; face_num=1; total_face_num=30;%修改总的人脸个数 total_sample_num=30;%y样本 train_sample_num=20 ; test_sample_num=10; % data=zeros(total_sample_num*total_face_num,5000); % train_data=zeros(20*total_fac...
function wout = wfromdpdt(t, p, ntunits, tskip) % wout = WFROMDPDT(t, p, ntunits, tskip) % % inputs: % - t: time vector. % - p: pressure (same length as t). % - ntunits (optional): normalization to the units. % - tskip (optional): time difference to disconsider the % ...
function result = accfm_pdf_batch(network, distribName, distribParams, number_of_scenarios, settings, output_file) % batch processing for the AC Cascading Fault Model following a probability % distribution % accfm_pdf_batch(network, distribName, distribParams, number_of_scenarios, output_file) % runs the AC-CFM in...
function [Ma,Mrb,M] = Stiffness_matrix(p) %% Mass matrix of the linearized system % assembles the mass matrix of the linearized system with integrated % boundary conditions. M = zeros(2*(p.Xn-1)*(p.Zn-1) + 2*(p.Xn-1)); %% mass matrix for the algae Ma = zeros((p.Xn-1)*(p.Zn-1)); for j = 1:p.Xn-1 % xi for i = 1...
%% Drawing bar plot for manipulability measure scales % totally 10 steps red = linspace(1,0,10)'; blue = linspace(0,1,10)'; dum_zeros = zeros(10,1); rgb_map = [red dum_zeros blue]; % draw plot fig_total = figure('position', [0, 0, 600, 600]); x_temp = [1;nan]; % 10 jobs pos_bar1 = []; y_temp = []; % maxium measure...
function NP_init_directory_structure % Not intended to be called by the user % Function that creates the NP folder structure. main_dir = pwd; get_dir_for = { 'Anatomy' 'Functionals' 'Stimuli' 'Results' }; for n = 1:length(get_dir_for) make_dir = fullfile(main_dir,get_dir_for{n}); ...
clear all; close all; clc; N=16; % numero di punti l=2; % potenza di partenza punti=2*ones(1,N); esponente=linspace(l,N+l-1,N); punti=punti.^esponente; % norm2FFT=zeros(1,N); % norm2DFT=zeros(1,N); % norma=zeros(1,N); % for i=1:N % vettore=rand(1,punti(i)); % norma(i)=norm(vettore); % FFT...
function status = myOutputFcn(t,q,flag,params) if strcmp(flag,'init') && (t(1) == 0) params.RaRb = []; end if ~strcmp(flag,'done') && ~strcmp(flag,'init') [~, Ra, Rb, zB, yA, zA, yB, Fp ] = dqdt(t, q, params); fprintf('t=%6.3f s: Ra=%+5.3f N, Rb=%+5.3f N\n',t, Ra, Rb); end % continue... status = 0; e...
% LASSO regularization with alpha = 1 which returns fitted least-squares regression coefficients for linear models of % transcript/flux/transcript+flux data (x) and the growth rates (y) in 12 growth conditions load('transcripts_subset.mat') % load transcript data corresponding to 12 growth conditions load('all_atp...
%{ # subject.Strain strain_name: varchar(63) # strain name --- strain_description='': varchar(255) # description %} classdef Strain < dj.Lookup properties contents = { 'C57BL6/J', '' } end end
%Calling cos_one() function to generate the required sinusoid [signal, time] = one_cos(95, 200, pi/5, 0.025); %CT Plot using plot() figure; plot(time, signal, 'k', 'LineWidth', 2); xlabel('Time Axis (t)', 'FontSize', 12); ylabel('sin(t)', 'FontSize', 12); title('Sinusoidal Plot', 'FontSize', 12); %Vectors output signa...
function [ aYield ] = annualYield( nav, period) % 根据一段时期Period的nav,计算年化yield % [ aYield ] = AnnualYield( nav, period) % nav: 净值序列,第一个元素为1 % period可取如下值: d365, d360, d245, w, m, q, y,默认为d365 % 注意,这里在通过nav计算yield的时候,统一采用了离散复利的计算方法 % 也就是说,r=x(end)/x(1)-1 % ------------------ % 唐一鑫,20150510 % 程刚,20150529,加入 period值 'w' ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Sandeep Manandhar %% University of Burgundy, France %% MSCV6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% inputs % image % kernelSize % deprecating value C; C = mean - threhold %% output % threhold image %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function ThresholdImage = localThresh(imag...
function [ ] = mtf ( input_args ) %Creacion de 4 im?genes por medio de comandos de MATLAB % El programa crea 4 imagenes utilizando unicamente comandos de Matlab. % La primera imagen es guardada como "rampa.jpg" la cual representa una % gradiente de negro a blanco de izquierda a derecha. La segunda imagen % es...
function [Cd,S] = Cd3Deploy(h,t) Cd = .6; %Rocket Cd S = pi*(2*2.54/100)^2; if h < 6100/3.2808 %1500 above spaceport ground in m - main deployment Cd = 1.5; S = pi*(45*2.54/100)^2; elseif h < 9100/3.2808 %Drogue deployment in t or h Cd = 1.5; ...
function disp_the_size(X) [r c]=size(X); disp(r); disp(c); end
function [ AUS6,SPT ] = TAL( SHABR,SDELTA,SHBR,SDTDH0 ) %TAL CALCULATES THE COEFFICIENTS SPT FOR THE POLYNOMIAL % SUBROUTINE TAL(SHABR,SDELTA,SHBR,SDTDH0,AUS6,SPT) % CALCULATES THE COEFFICIENTS SPT FOR THE POLYNOMIAL % Y(X)=1+SPT(1)*X**2+SPT(2)*X**3+SPT(3)*X**4+SPT(4)*X**5 %...
%changing value of n n = 5; %Gaussian A1 = matgen(n,1); A2 = matgen(n,10^4); A3 = matgen(n,10^8); A4 = matgen(n,10^12); A5 = matgen(n,10^30); xtrue = randn(n,1); b1 = A1*xtrue; b2 = A2*xtrue; b3 = A3*xtrue; b4 = A4*xtrue; b5 = A5*xtrue; x1 = A1\b1; x2 = A2\b2; x3 = A3\b3; x4 = A4\b4; x5 = A5\b5; rel_err(1) = norm(x1-...
1; function ei = solve_marquardt(damper_x, wt_start, hx, ht, t, nth) global vareps wt_bounds st num_of_dampers n k a l; alpha = osc_alpha(hx, ht); beta = osc_beta(hx); b = osc_b(); c = osc_c(alpha, b); c_inverted = inv(c); sweep_side = eye(2); cTilde = osc_cTilde(alpha, b); u = osc_y(hx); v = osc_sec_y...
close all clear all clc param.alpha_m = 22*1000; param.beta_m = 13*1000; param.alpha_h = 0.5*1000; param.beta_h = 4*1000; param.alpha_n = 1.5*1000; param.beta_n = 0.1*1000; param.alpha_q = 1.5*1000; param.beta_q = 0.025*1000; Fs = 50000; time = 0:1/Fs:0.05; index_s = zeros(1,length(time)); index_s(0.01*Fs:0.01*Fs+rou...
%% 1D CNN for distance density classification. function [neuralNet, opts] = CnnDistanceDensityNetwork(height, width, channels) InputLayer = imageInputLayer([height,width,channels]); % Distance density method uses [3, 1] or [5 1]convolutions. c2 = convolution2dLayer([1 3], 32, 'stride', [1 1]); %F...
a = 200; b = 100; for i=1:10 froma = round(0.03 * a); fromb = round(0.05 * b); a = a - froma + fromb; b = b - fromb + froma; fprintf('%f\t%f\n', a, b) end
function [ tmp ] = unbiasedestimaton_1n( theta, angle ) % Unbaised estimation of angular velocity w_i and oritantion angle_i % Pass function the value angular velocity and angle and return a value for % Phi matrix estimation % Preallocate local variable tmp = double.empty; for n = 2:(length(theta)) tmp(n) = (thet...
function representation_onepath(eddatafile,reflpathsfile,fuente_imagen,num_rayo,plot_source,plot_receive,separacion_point_edges) [eddatafilepath,eddatafile,fileext] = fileparts(eddatafile); eddatafile = [eddatafile,fileext]; Filestem = EDB2strpend(eddatafile,'_eddata'); [reflpathsfilepath,reflpathsfile,fileext] = fil...
function [H_ue, H_in] = gen_quadriga_channel_file(B, nbr_of_RB, nbr_of_ue, nbr_of_in, fname, new_generate) % check if result same % Example: % [H_ue, H_in, lay] = gen_quadriga_channel_file(4, 8, 8, 1); %%%%% CHECK SAVE REQUIRED OR NOT dir_name = 'ch_files'; if exist('fname', 'var') ...
function omcompile (filename,modelname,varargin) % Filename des *.mo-files, modellname, libraries, debug % % Loads Modelica-File *.mo and compiles Model modelname, % optionally loads additional libraries such as 'Modelica' or sets debug flag, first all old files % are deleted. After compilation the *_init.txt file is...
function [Is] = ver_eq2(I) l = length(I); Is = []; if l > 1, for i=1:l-1, aux = I(i); auxI = I(i+1:end); el = find(auxI == aux); if isempty(el), Is = [Is,aux]; end; end; Is = [Is,I(end)]; else, Is = I; end end
function [ val ] = exp_helper( ksi,sigma,para ) %This exponential function helps to calculate the exponential part of the %Weibull CDF. base = para/sigma; temp = -1.0 * power(base, ksi); val = exp(temp); end
function [F,u,v,Nu,Nv,Du,Dv]=griddatacyclic(unoneq,vnoneq,Fnoneq,N) % u must be 2*pi periodic. % v must be 2*pi/N periodic. % (unoneq, vnoneq) is the non-equidistant grid on which F is given. % (u,v) is the equidistant grid generated with ndgrid which to interpolate to. Nu=size(Fnoneq,1); Nv=size(Fnoneq,2); Dv=2*pi/N...
clear clc k1 = 1; k2 = 1; Cont_k1 = 10; Cont_k2 = 10; beta = 1;
load('f9.mat'); f=figure; labels= {'First Half: Acquisition', 'Second Half: Acquisition', 'First Half: Extinction', 'Second Half: Extinction'} for i = 1:size(DATA,2) subplot(2,2,i) s=scatter(DATA.(i), anx_scores.TraitAnx, 20, [0 0 0], 'MarkerFaceColor', [0.8 0.6 0.1]); [r,p] = corr(DATA.(i), anx_scores.Trai...
function createTemporalTPAForBDA(BDA_name, BDA_trials_count, TPA_num_frames, outputfile) strROI{1} = TPA_RoiManager(); strROI{1}.Name = 'ROI:Z:1:001'; strROI{1}.Data = zeros(TPA_num_frames, 2); strROI{1}.xyInd = zeros(30, 2); strShift = zeros(TPA_num_frames, 2); for index = 1:BDA_trials_cou...
% test filtering % % This script test different configurations of entropy % filter over a previously calculated entropy vector e0. % It uses combination of two parameters of the filter: % Buffer_size and K, % % A matrix with the following columns is generated: % % BUFFER_SIZE % K % TP: True Positive % FN: False Negati...
function G = zassenhaus(f,Zx) % FACTORIZATION IN Z[x] (ZASSENHAUS) n = length(f) - 1; if (n == 1) G = {f}; return; end A = max(abs(f)); b = Zx.lc(Zx,f); B = sqrt(n+1) * 2^n * A * b; C = (n+1)^(2*n) * A^(2*n-1); gamma = ceil(2*log2(C)); r = 1; gcd = 1; while(isequal(r,0) || ~isequal(gcd,0)) p = primes(2*ga...
function [Az El] = RaDec2AzEl(Ra,Dec,lat,lon, Mjd_UT1) % Programed by Darin C. Koblick 01/23/2010 %-------------------------------------------------------------------------- % External Function Call Sequence: % [Az El] = RaDec2AzEl(0,0,0,-104,'1992/08/20 12:14:00') % % Worked Example: pg. 262 Vallado %[Az El] = RaDec2A...
function scs = ApplyDetector(Cparams, ii_ims) sum = 0; for t=1:Cparams.T fidx = Cparams.theta(t, 1); theta = Cparams.theta(t, 2); parity = Cparams.theta(t, 3); fx = Cparams.fmat(fidx, :) * ii_ims; r = Cparams.alphas(t) * ((parity * fx < parity * theta) * 2 - 1); ...
function value = H(adjI, adjJ, x) % q-coloring energy function % colored_graph = G*diag(x); % Row i contains colors of vertices connected to i % colored_reverse_graph = colored_graph'; % % slow_value = sum(colored_graph(G) == colored_reverse_graph(G))/2; % value = 0; % fo...
% Author: Eseoghene Okonofua <EseO@Eseoghenes-MacBook-Pro.local> % Created: 2017-09-25 % Orthonormal-Coordinate-System % Intput: % Points: %[point1x, point1y, point1z] %[point2x, point2y, point2z] %[point3x, point3y, point3z] %Output: %[base1x, base1y, base1z] %[base2x, base2y, base2z] %[base3x, base3y, ...
axis equal; hold on; xlabel('x'); ylabel('y'); zlabel('z'); rotate_x = @(theta)[ 1 , 0 , 0 , 0; 0 , cos(theta) , sin(theta) , 0; 0 , -sin(theta) , cos(theta) , 0; 0 , 0 , 0 , 1; ]...
function out=calc_elevel_conso(dB_SPL) %out is elevel in a 4 by 16 matrix p.electrodes=(22:-1:1)'; p.channel_stim_rate=900; p.reference_SPL_dB = dB_SPL; p.num_selected=8; p.Q=20; p.phase_width = 25*ones(size(p.electrodes)); p.phase_gap = 8; p.modes = 103; p.threshold_levels=zeros(size(p.electrodes)); %electro...
function str = calculate(str) % This function calculates CALC fields needed for AWG layout. % SF, January 31, 2006 global alphai; global lx; global theta0; global dl; global bcoo; global ji; p = str.param; %load AWG parameters str.calc = []; %delete previous AWG calculations lx = p.Lx; %initializing globals t...
%% Electricity usage, Matlab learning load dataset/electricity.mat res = usage(:,1); comm = usage(:,2); ind = usage(:,3); yrs = (1991:2013)'; plot(yrs, res, 'b--'); hold on plot(yrs, comm, 'k:'); plot(yrs, ind, 'm-.'); title('July Electricity Usage'); xlabel('Years'); ylabel('Usage KwH/m'); legend('Residentials', 'Co...
function [ index ] = quadrant( p ) %QUADRANT индекс квадранта в котором лежит точка % Функция возвращает индекс квадранта в котором лежит точка. index = 0, % обозначает что данная точка не подпадает под условия, то есть квадрант % не определен. % p - точка начала луча % index - квадрант % Zheltov Victo...
% Function to crop and resize images of caltech 101 dataset to 224*224 % Input: % caltechPath: path to caltech 101 dataset. % eg:'SomePath/101_ObjectCategories' % outPath: path to cropped dataset. function cropImages(caltechPath, outPath) if ~exist(outPath,'dir') cmd = sprintf('mkdir %s', outPath); ...
clear all close all cd(root); pat = patienten; cond= {'onset-klein', 'onset-mittel', 'onset-gross'}; med={'ON','OFF'}; for b=1:length(cond); for c=1:length(med) images = ffind(['*' cond{b} '*' med{c} '*' '.nii']); outimage=['contralateral_' cond{b} '_' med{c} '.nii']; spm_imcalc(images,ou...
function period = findPeriod(pulse_model) pm = pulse_model; pm = smooth(pulse_model);%perform gentle smoothing to eliminate ridges at peaks and troughs %get max and min values pmmax = regionalmax(pm); pmmin = regionalmax(-pm); max = pm(pmmax); maxidx = find(pmmax==1); min = pm(pmmin); minidx = find(pmmin==1); %get abs...
function y = butterworthSmoothing(x,w) % y = butterworthSmoothing(x,w) % % Implements a simple second-order butterworth smoothing filter. The % boundary conditions are implemented by using a first-order filter, and % then by using the raw data value at the very edge. % % INPUTS: % x = vector of uniformly spaced data ...
function K = kernelComponent(freq_grid, var_grid, x, y) %Given the lists of hyperparameters and the difference matrix, compute all %the sub kernel matrices and store in a cell. Q = length(freq_grid); subKernels = cell(Q,1); % compute the difference matrix based on x_train diffMat = diff_mat(x, y); % constr...
function [wimg, flag] = quadtobox(img, M, X, Y, f_type) if nargin<4 f_type = 'bilinear'; end % Get all points in destination to sample xy=[X';Y';ones(size(X'))]; % Transform into source uv = M * xy; % Remove homogeneous uv = uv(1:2,:)'; xi = reshape(uv(:,1),numel(uv(:,1)),1); % can be optimized yi = reshape(uv(:,2)...
%% test circulant and convolutional algorithms %% clear everything close all; clear; clc; % the code used omptoolbox, if you have it already comment this line!!! addpath([pwd '/omptoolbox']); %% read input data images = {'lena512.bmp', 'barb.bmp'}; Y = readImages(images); disp('Done!'); [p, N] = size(Y); %% remove ...
%Density data L = 400; number = 15000; beta = 0.5; a=0.1; Input = zeros(number , L); Output_q = zeros(number, L); Output_th = zeros(number,L); for j= 1 :number s = -2*rand(L,1)-2*rand; s(1) = -1; s = Flatten_potential(s,L); A = zeros( L,1) ; B = zeros(L,1); rho =zeros(L,1);psi = zeros(L,1); K = sqrt(-s); A(1) = 1...
%% Factorización de un polinomio en un cuerpo finito parte 1, parte 2, parte 3 % % SFD: Factorización libre de cuadrados % % DDF: Factorización en grados distintos % % EDF: Factorización de mismo grado % path(path, 'Algorithms'); path(path, 'Classes'); clear %% $$F_{q}[x] \quad q = 3^{1}$ %% SDF % p = 3; n = 1; fqx...
% EJERCICIOS RESUELTOS DE VISIÓN POR COMPUTADOR % Autores: Gonzalo Pajares y Jesús Manuel de la Cruz % Copyright RA-MA, 2007 % Ejercicio 8.6: Descripción de contornos, regiones y superficies 3D %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 8.5.4 Regiones: propiedades métricas %%...
% do_bst_extract_alpha.m %% list all the pairs subj = {'S01';'S02'; % list subj#1 subj#2 in the order of the file 'S03';'S04'; 'S05';'S06'; 'S07';'S08'; % list subj#1 subj#2 in the order of the file 'S09';'S10'; 'S11';'S12'; 'S13';'S14'}; nsubj = size(subj,1); cond = { 'm1SelfSameComp'; ...
function [aGmx_RE,cos_d_ang_RE] =... RE_Constraints... (aGmx,G_diag,K,TK,pi2,angPSF_pi2_m,angGmx,sqrt2,m,... angPSF_m,z_M,cos_d_ang) %------------------------------------ % Refer to Section 3.1 for details. %------------------------------------ ...
function X_rand=Sample(map,goal) % if rand<0.5 % X_rand = rand(1,2) .* size(map); % random sample % else % X_rand=goal; % end if unifrnd(0,1)<0.5 X_rand(1)= unifrnd(0,1)* size(map,1); % ¾ùÔȲÉÑù X_rand(2)= unifrnd(0,1)* size(map,2); % random sample else X_rand=goal; end
layer_c1_num=20; layer_s1_num=20; layer_f1_num=100; layer_output_num=10; yita=0.01; bias_c1=(2*rand(1,20)-ones(1,20))/sqrt(20); bias_f1=(2*rand(1,100)-ones(1,100))/sqrt(20); [kernel_c1,kernel_f1]=init_kernel(layer_c1_num,layer_f1_num); pooling_a=ones(2,2)/4; weight_f1=(2*rand(20,100)-ones(20,100))/sqrt(20); weight_outp...
% PREY ALGORITHM % LFG clc, clear all, close all global M MAXPreyTypes NNeighbors %% ----------------- Generate data and dissimilarity matrix --------------- % Generate data disp('Generating data ...') ScaleBetween = [-1 1]; [X,labels] = gen_data('gaussian2',ScaleBetween,false); % Dissimilarity Metri...
function data = updateMap(data,Hval) img = getHSVmap(Hval); set(data.h.SVchooser,'cdata',img); data.img = img;
clear ; close all; clc img = rgb2gray(imread('/Users/INNOCENTBOY/Downloads/videos/Imageprocessing/week6/original_cameraman.jpg')); img = im2double(img); figure; imshow(img); %1D motion blur h = zeros(size(img)); s = size(h); for i = (s(2)/2 - 8) : (s(2)/2 + 8) h(s(1)/2, i) = 1/16; end blurImg = imfilter(img, h...
function A_sampled = ColumnSelect(A, k , eps) A_cur =[]; J=[]; C = k*log(k/(eps^2)) ; %C = k ; [m,n] = size(A) ; %[u,sigma , v] = svd(A) %[W,lambda] = eig(A' * A) ; %W = W(:, end:-1:1) ; %lambda = lambda(:, end:-1:1) ; [UU,SS,W ] = svd(A); W_top = W(:,1:k) ; for j = 1:n pie = norm(...
function instrlist = management() %UNTITLED8 此处显示有关此函数的摘要 % 此处显示详细说明 import real_instrument.* import virual_instrument.* import instrument.* idx = []; InstrInFile = readtable('.\Defaults_para\Defaults_setting\instrlist.txt','Format','%s%s%s%s%s%s','Delimiter','space','ReadVariableNames',0); InstrInFile = tabl...
%% Figure for JEF Gaussian line spreads % %% Create the scene and initiate the optics vParams = vernierP; scene = sceneCreate('vernier','display',vParams); ieAddObject(scene); sceneWindow; scene = sceneSet(scene,'fov',1.2); %% pupilMM = 3; zCoefs = wvfLoadThibosVirtualEyes(pupilMM); zCoefs(5) = 0; oi = oiCreate('wvf...
clear clc close all % load results/simulation1/detectorCounts_z0mm.mat % load results/simulation1/simulationData.mat load results/detectorCounts_z0mm.mat load results/simulationData.mat %Lensmaker M=1; f=20; % d0=lensZ; % d0=f*(1+1/M); d0=25; M=f/(d0-f) zf=1/(1/f-1/d0); M=1; if isinf(zf) zf=50; end %estimate ...
fprintf("Classification using mnrfit\n") data = readtable('wine.csv'); data = data.Variables; y = data(1:end-50,1); X = data(1:end-50,2:end); y_val = data(end-49:end,1); X_val = data(end-49:end,2:end); B = mnrfit(X,y); y_pred = mnrval(B,X_val); [~,I]=max(y_pred, [], 2); acc = sum(y_val ==I); acc = acc/length(y_pred);...
%%%%%%%%%%%%%%%%%%%%%%%%%% %(c) Ghassan Hamarneh 1999 %%%%%%%%%%%%%%%%%%%%%%%%%% function W=GetWeights(Xu); %function W=GetWeights(Xu); Distances=zeros(size(Xu,1)/2,size(Xu,1)/2,size(Xu,2)); %using 3 dimensional matrix to contain the distances from landmark1(x) to landmark2(y) in a shape(z) hwtbar = waitbar(0,'Cal...
function [tfim_ord,idx_tfim,updated_Operators112,updated_OperatorsINEM,updated_Lines112,updated_LinesINEM,UP_FE112,UP_FEINEM,UP_FEINEM112, updated_state_vars, wait_R,End,Start,last,UP_wait_time,UP_wait_time112]=release(Operators112,OperatorsINEM,Lines112,LinesINEM,FE112,FEINEM,FEINEM112,Type, idx, state_vars,tfim_ord,i...
mdl_eul = rlCModel('JumpModel_Eul.xml'); vis = rlVisualizer('vis', 480, 960); vis.addModel(mdl_eul); mdl_eul.forwardPosition; vis.update; clear vis;
function out = yolov4Predict(matFile, image) %#codegen % Copyright 2021 The MathWorks, Inc. % Convert input to dlarray. dlInput = dlarray(image, 'SSCB'); persistent yolov4Obj; if isempty(yolov4Obj) yolov4Obj = coder.loadDeepLearningNetwork(matFile); end % Pass input. out = cell(size(yolov4Obj.OutputNames,2),1);...
g=zeros(size(a.linear_link_ids)); %green g(ismember(a.linear_link_ids,a.link_ids_beats(a.good_mainline_mask_beats)))=2; %yellow g(ismember(a.linear_link_ids,a.knobs.link_ids))=-1; %blue g(ismember(a.linear_link_ids,a.link_ids_beats(logical(a.good_source_mask_beats+a.good_sink_mask_beats))))=1; %beige figure imagesc(g)...
function all_test %plot_mesh_test %block_example disp('running all tests') tol = 1e-9; err=[ check(@adj_mat_test),... check(@fun2mat_test),... check(@mlap3z_test),... check(@adj_test),... check(@mass_cons_int_test),... check(@poisson_fft3z_test),... check(@wind2flux_test),... check(@mat_...
function varargout = groupmanager(varargin) % GROUPMANAGER MATLAB code for groupmanager.fig % GROUPMANAGER, by itself, creates a new GROUPMANAGER or raises the existing % singleton*. % % H = GROUPMANAGER returns the handle to a new GROUPMANAGER or the handle to % the existing singleton*. % % GR...
function [ sig1, sig2, sig3 ] = window_frequency( seq ) %The function calculates three arrays based on the given sequence seq, %which identifies the consecutive window frequencies of the occurences %of rise fall and level transitions. sig1 = zeros(length(seq),1); sig2 = zeros(length(seq),1); sig3 = zeros(length(seq),1...
function output=LSTM_output_ff(outputLayer,w_k,b_k,y2) %×îºóÒ»²ã T=size(y2,1); z_k2=y2*w_k+ones(T,1)*b_k; numClass=size(w_k,2); switch outputLayer case{'softmax'} temp=exp(z_k2-max(z_k2,[],2)*ones(1,numClass)); output=temp./(sum(temp,2)*ones(1,numClass)); otherwise output=tanh(z_k2); end
function [ddq,Fx,Fy] = autoGen_dynamics_minimal(m,g,r,I,slope) %AUTOGEN_DYNAMICS_MINIMAL % [DDQ,FX,FY] = AUTOGEN_DYNAMICS_MINIMAL(M,G,R,I,SLOPE) % This function was generated by the Symbolic Math Toolbox version 6.2. % 13-Aug-2015 08:53:37 t2 = r.^2; t3 = m.*t2; t4 = I+t3; t5 = 1.0./t4; t6 = sin(slope); ddq ...
function v = clarke(V, Delta, f, fs, phi, N) A = (sqrt(6)/6) * (V(1)*exp(1i*Delta(1)) + V(2)*exp(1i*Delta(2)) + V(3)*exp(1i*Delta(3))); B = (sqrt(6)/6) * (V(1)*exp(1i*Delta(1)) + V(2)*exp(-1i*(Delta(2)+(2*pi/3))) + V(3)*exp(-1i*(Delta(3)-(2*pi/3)))); v = A*exp(1i*(2*pi*(f/fs)*(1:N)+phi)) + B*exp(...
function fimage = regiongrow(I, varargin) % % Performing mean_shift operation on image % % Usage: % [output] = edison_wrapper(I, ...) % % Inputs: % I - original image % % Allowed parameters: % 'hi' - hard uphill constraint % 'lo' - soft uphill constraint % 'sumlo' - sum of consecutive 'lo' constraints allow...
function uncommentBlocks(nbBlocks) h=load_system("MMADC"); for i = 1:nbBlocks basepath = 'MMADC/Sensing Channel '; path = append(basepath, num2str(i)); set_param(path,'commented','off') end % for i = 1:nbBlocks % basepath = 'MMADC/LNA '; % path = append(basepath, num2str(i)); % set_param(path,'...
% calculate f1a from our spin wave velocity data function calc_f1a() addpath /home/sla/he3/he3lib/matlab pp=0:35; [p1,cpar1,cpar1e,cper1,cper1e,~,~] =... textread('DATA_SW_VEL.txt', '%f %f %f %f %f %f %f'); f1a1 = he3_f1a(p1); cpar1min = cpar1 - cpar1e; cpar1max = cpar1 + cpar1e; cper1min = cper1...
ClearMonomialOrder[]; SetMonomialOrder[{a,b,c,d,e,f,g,h,i,j,k,l,m,n},1]; Iterations=5; rels={ a**a - a, a**a**a**a**a**a - g**f, b**a**a -c };
p=zeros(30,1);p(1)=400; pa=zeros(30,1);pa(1)=120; for n=2:30 if(rand(1)<0.35); p(n)=p(n-1)*(0.9); pa(n)=pa(n-1)*(0.8); else p(n)=p(n-1)*(1.1); pa(n)=pa(n-1)*(1.2); end end p pa
function [Iout] = enhanceContrastLS(Iin,m,c) Lut = contrast_LS_LUT(m,c); Iout = intlut(Iin,Lut); end
K = 9*10*10*10; # keturzenkliu skaiciu kiekis K_skirtingais_skaitmenim = 9*9*8*7; ats1 = K - K_skirtingais_skaitmenim K_be_7 = 8*9*9*9; ats2 = K - K_be_7 ats3 = K_be_7 T = 10*10*10; # n( [0;1000) ), intervale imant sveikus skaicius T_tam_tikroje_pozicijoje_6 = 1*10*10; ats4 = T_tam_tikroje_pozicijoje_6 * 3 T_be_6 ...
function out1 = sym_jc_rnd(tauU,tauL,T,state) % function out1 = sym_jc_rnd(tauU,tauL,T,state) % This program generates observations from % a Symmetrised Joe-Clayton (BB7) copula % % INPUTS: tauU, a scalar or a Tx1 vector, the upper tail dependence parameter % tauL, a scalar or a Tx1 vector, the lower tail de...
% load('twomoons_sk.mat') load('usps.mat') k = length(unique(gnd)); n = size(fea, 1); n_sample = 20; m = n - n_sample; sigma = 0.2; samples = randsample(n, n_sample); W = EuDist2(fea, fea(samples,:)); W = exp(-W / (2*sigma^2)); % nystrom spectral clustering A = W(samples, :); nonsamples = setdiff(1:n, samples); B = W...