text
stringlengths
8
6.12M
function [cd] = SDC (Re) % Implementation of the Standard Drag Curve from 'Bubbles, Drops and % Particles', R. Clift - 1978 (pag. 112) cd = zeros(1, length(Re)); w = log10(Re); for i = 1:1:length(Re) if Re(i) < 0.01 cd(i) = 3/16 + 24/Re(i); elseif Re(i) >= 0.01 && Re(i) < 20 cd(i) = 24/Re(i) * (1...
f = 0:10:100; u = [0 77 155 232 309 386 386 386 386 386 386]; plot(f,u) xticks([0:10:100]); yticks([0:50:400]); xlabel('f/Hz'); ylabel('UL1,A/V'); grid('on') matlab2tikz
function [shannon_rate] = DataRate_Shannon(P_RX) %This function computes the Shannon limit's achievable data rate load global_params_incr; % if(P_RX < P_RX_min) % shannon_rate = -10; % rate_lower = -10; % 'Unreachable Node - RX Power lower than Control Reqd.' % return; % end P_RX = 10^(P_R...
%Created by Maxim Yatsenko and Milan Brankovic %THIS CODE CREATES A NUMBER OF SYNTHETIC EVENTS ON WHICH WE TRAIN OUR CODE. %VARIABLES i1, i2 and i3 DETERMINE NORMAL DISTANCE FROM SOURCE TO RECEIVER %LINE, VERTICAL POSITION, AND ANGLE OF FRACTURE OPENING. %FOR EACH EVENT, POSITION AND ANGLE ARE RECORDED IN VARIABLE d...
clear all clc % S0 S1 S2 Pa= [ 0.5 0 0.5; %S0 0.7 0.1 0.2; %S1 0.4 0 0.6]; %S2 % S0 S1 S2 Pa(:,:,2)=[ 0 0 1; %S0 0 0.95 0.05; %S1 0.3 0.3 0.4]; %S2 ...
function VisualizeMode(no2xy, el2no, vtr_Fz,label) % Function: % VisualizeMode(no2xy, el2no, vtr_Fz) % Arguments: % no2xy = the coordinates of the nodes % el2no = the nodes of the triangles % vtr_Fz = z-component of the eigenmode % Returns: % - % Comments: % Visualizes the z-component of the eigenmode toge...
function [out,fesx,fesy,Xtest_out,Ftest_out,itest_out]=glisp_function2(x,y,f,comparetol,g_unkn) % Preference query function. Along with either satisfactory or feasibility % constraints (but NOT both, if the problem include both satisfactory AND feasibility constraints, % use 'glisp_function3.m' instead) % % pref=glisp_...
classdef ProgramsGenerator < Generator %This class iteratively generates all of the ways to pick one program %in each machine. properties num_machines M %M(i) = the number of programs in machine i end methods function obj = ProgramsGenerator(M) obj.num_machi...
clear all; close all; warning off; divider = sprintf('<----------------------------------------------->'); disp('Welcome to the first project!'); disp(' '); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Input %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%...
clear all; close all; %%%%%%%%%% A Completer %%%%%%%%%% PathImage = '../Base/'; nom = 'Paysages67.png'; % Quantif HSV : Completer avec votre nombre de bins nH = 34; nS = 34; nV = 34; filename= nom; I=imread([PathImage,filename]); I=double(I); I = I ./ 65535; figure(); imagesc(I); % conversion RGB->HSV J = rgb2h...
function [results, store_params] = run_sims_correct_model(numSubs, numRounds,rews) params = zeros(numSubs, 8); store_params = zeros(numSubs, 9); %stores params for exporting results_counter = 0; %Loop through subjects for j=1:numSubs participant_id = j; %generate params beta = ran...
function X_estimate=PoissonMBMtarget_estimate3(filter_upd) %Author: Angel F. Garcia Fernandez %We select the hypothesis (with fixed cardinality, i.e. considering MBM01 expansion) with highest %weight if(~isempty(filter_upd.globHyp)) globHyp=filter_upd.globHyp; globHypWeight=filter_upd.globHypWeight; ...
%Name: % clockwisePoly % %Purpose: % This program organizes a set of vertices in clockwise order % %Parameters: % V - (#vertices x 2) vertex matrix giving each vertex's X and Y coordinates % middleV - (1 x 2) vertex know to be inside our shape % n - number of vertices to reorder % %Return Values: % ...
%% MPCC_policypath % script that updates variables used when solving a time path rr = paths.rr_t(tt); w1 = paths.mu_w_t(1,tt); w2 = paths.mu_w_t(2,tt); s1 = paths.sigma_w_t(1,tt); s2 = paths.sigma_w_t(2,tt); s_bl = paths.s_bl_t(tt); % Update Rates MPCC_update_rates; % Update to include borrowing constrai...
pkg load symbolic; clc; clear all; syms x; eqn = ((x - 3)^2) * (x - 7) == 0; S = solve(eqn); ans = double(S); ans
%Ranjeeth KS, University of Calgary % SYnchrozization: From 490977th second between Xbow data, INSPVAS, Carship % Reference: 1st values of INS_PVA % g, Rn and Rm are updated in every loop, % bias values from first project, no bias or SF removed for Xbow gyro Wz % in 1 Hz rate % nova_wz(te)*cos(p)*cos(r) 0.02...
% Function that takes the map image and outputs a thresholded version % according to its histogram. Threshold occurs in the first valley. function [I_out2, TT] = valley_hist(I_out, HIST_LENGTH) [N, X] = hist(I_out(:), HIST_LENGTH); %Append the first signal twice to the left of the histogram, and the %last twice...
% ------------------------------------------------------------- % VTD_landscape_model_nosignal_v1 jacobian % ------------------------------------------------------------- % generated by change_model_for_jacobian on 06-Jun-2019 10:30:00 function jac = VTD_landscape_model_nosignal_v1_jac(t,y,p) %Mode...
function [Ypredict] = EstimateParametersFromNNmodel(Xtest,net,gpu_opt) if ~exist('gpu_opt','var') gpu_opt = 'auto'; end %% Ypredict = predict(net,Xtest','ExecutionEnvironment',gpu_opt)'; end
function cvx_optval = optimal_p_noAV(n,xi,beta) A = S2C_matrix(n,xi); % A = [0,0.2,0.8;0.4,0,0.6;0,1,0]; cvx_begin quiet variables p(n,1) delta(n) y(n,n) maximize(sum(p.*(1-p))-sum(delta)) subject to sum(y,2) == transpose(beta*(sum(A.*((1-p)*ones(1,n)),1)+sum(y,1)))+delta-(1-p) p >= 0 ...
function samples=sampleDiscreteDistributions(distributions,nr_samples,values) %samples=sampleDiscreteDistributions(distributions,nr_samples,values) %This function draws nr_samples from each of the distributions specified by %the rows of the distribution matrix and the values vector. %distributions: matrix of probabilit...
%%function CC_mk3plus_wrap CC_root = '/space/mdeh7/1/halgdev/projects/bqrosen/CC/'; subj = 'CCEP0026'; runs = [1:4]; %% load PC data fname = sprintf('%s/out/%s/%s_runs_%2.2i-%2.2i_PC_data.mat',CC_root,subj,subj,runs(1),runs(end)); PC = load(fname); savedir = sprintf('%s/out/%s',CC_root,subj,subj); ballsize = 120; %...
function [ax,mx,stdx,msg] = auto(x,options) %AUTO Autoscales matrix to mean zero unit variance. % INPUT: % x = MxN matrix to autoscale. % % OPTIONAL INPUT: % options = structure array with the following fields: % offset: scales by stdx+offset {default = 0}: % if (off...
close all; ind = find(post==max(post)); ind = ind(1); resmpl = samplestage(ind,:); xf = linspace(1,22,22); yf = 11:-1:1; [xfault,yfault] = meshgrid(xf,yf); zfault = zeros(9,22); p = xfault(:); q = yfault(:); rowp = size(xfault,1); colp = size(xfault,2); numpatch = 2*(rowp-1)*(colp-1); trired = []; for i = 1: col...
% Homework 7 Part 2 % CIC Decimation Staged Filter % Macky McWhirter clear all; close all; % Toneramp [x,fs] = audioread("toneramp.wav"); % CIC Filter 8 coefficients b = [ -1, -1, -1, -1, -1, -1, -1, -1]; a = 1; % Cascade the two filters H1 = dfilt.df2t(b,a); H2 = dfilt.df2t(b,a); h = dfilt.cascade...
function [w,b] = LRC(x,y) y= double(y); [nrow,nlen]=size(x); meanX=mean(x); w=sum(y.*(x-meanX))./(sum(power(x,2))-(1/nrow)*power(sum(x),2)); b= (1/nrow)*sum(y-x*w'); end
function dx = odefun(t,x) dx = fq(x,1); end
function ShowSSQR() % function ShowSSQR() % Illustrates the efficeint computation of the QR factorization of % a semiseparable matrix. % GVL4: Section 12.2.7 % Generate an example... n = 6; u = randn(n,1); v = randn(n,1); p = randn(n,1); q = (u.*v)./p A0 = tril(u*v') + triu(p*q',1); b = randn(n,1); % C...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright 2018 Crypto4a Technologies Inc. % % Permission is hereby granted, free of charge, to any person obtaining a % copy of this software and associated documentation files (the "Software"), % to deal in the Software without restriction,...
T_inits = logspace(-2,2, 10); alphas = linspace(0.05, 0.95, 5); data = zeros(length(alphas), 4); % For plotting alpha vs. iterations for j = 1:length(T_inits) T_init = T_inits(j); for i = 1:length(alphas) alpha = alphas(i); [m_iterations, m_obj] = SA(T_init, alpha, 1); k = i + (j-1)*len...
%% QUICKMI - quick mutual information calculation % Calculates the mutual information between two variables. The data can be % continuous or discrete. If the data is single trial, the mutual % information is calculated through time. If the data is trial based, the % mutual information is calculated at each time poi...
%% This script is to evaluate the impact of flexiblity of interactive workload on the grid. % The idea is, we can reduce the power consumption of data center by % degrading the quality of service (such as delay) of serving interactive % workload. % Discription: Given flexibility of delaying interactive workload, how t...
function [sol, nnode, nel, nmat] = parseOutput(filename) % [dofv, nnode, nel, nmat] = parseOutput(filename) % this function will not parse input data (nodes, el, mat, BC, etc) % it will only parse the computed nodal displacement nodeHeader = ' NODAL DATA (#,X,Y,Z,K1 THRU K6,F1,F2,...)'; eleHeader ...
function mutual_Info(vect, training_label,name ) H = containers.Map(); H('s') = find_Entropy(training_label); check = isEmpty(vect); check = ~check; vect = vect(check,:); [~,~, vect] = unique(vect); result = training_label(check,:); key = strcat('s#',name); H(key) = condEntropy...
function data2packets(s, event, packetPort) %data2packets(s, event, packetPort) % %%%%THis implementation was made to read variable length packets!! %%%%it is also an old inefficient method of start symbol searching %%%% overall, inefficient!!! % %this function is called when a dataPort fills it's buffer. % %the func...
function [k] = R238_246(Te) load('../lookup_files/R238-246.mat'); a1 = par238_246(:,1); a2 = par238_246(:,2); a3 = par238_246(:,3); a4 = par238_246(:,4); a5 = par238_246(:,5); a6 = par238_246(:,6); e = 1.60217e-19; k_B = 1.38064e-23; T = Te.*(e/k_B)/10^3; % T' = param...
function playedStages = playedStages(startsAt,stage) %Function to find what stage was played playedStages = cell(size(startsAt,1),1); %This goes to the beggining of a stage, and checks what is the most repeated predicted stage in the next frames for i=1:size(startsAt,1) arr = stage(startsAt(i):(startsAt(...
function [featuresGroup, classesGroup, additionalGroup] = selectGroup(features, classes, additional, GroupOptions) % Selects only certain datasets from the dataset. % Options in GroupOptions are: % classBased: 0 when valid is an vector of dataset indices, 1 when the % certain classes should be selected. % valid: When ...
function val = intersite_proj_th(dmin, X,p) % intersite proj TH method for i=1:size(X,1) if norm((X(i,:) - p),-inf) < dmin val =0; end end val = inf; for i=1:size(X,1) calc = norm(X(i,:) - p); if calc < val val = calc; end end end
clc close all clear all %Experimental setup %----------------- %Control Variables pt1 n_iter=20; N_set=[20,50,100]; num_fig=1; n_sigma_set=[1e-3,0.1]; %---------------------------Noisy case begins here------------------------- sparsity_flag_set=[0,1]; %_____________________________________________...
function [R10, R01] = points2rot(P,Q,R) % Computes the rotation matrices matrix whose column vectors are the % coordinates of the (unit vectors along the) axes of frame o1x1y1 defined % by P,Q,R expressed relative to frame o0x0y0 %Now the normal vector to the plane can be calculated through the cross %product of vect...
function [skin_mask] = filter_skin(frame) % Skin Tone Filter % INPUT: a single RGB frame for skin tone processing % OUTPUT: binary mask of same size representing skin tone % for display purposes, temporarily store unsigned int values. [framex framey framez] = size(frame); if (framex == 0) || (framey == 0) || (framez =...
% load('circledata.mat'); clear; load('Orig.mat') % rng(9999); %[L, idx, D1, D2] = getSparseBipartite(fea, 1000, 3, 'uniform'); [L, idx] = getBipartite(fea, 200); [n,d] = size(L); k = 11; nlabel = 10; npass = 10; % shared starting point X_0 = randn(d,k); [X_0,~] = qr(X_0, 0); clear opt; opt.npass = 1; opt.batchsi...
function [deltaField] = subtractField(FGfield, BGfield, ver) % 3d field subtraction code % align progressBar = waitbar(0, 'Aligning and subtracting image passes'); depth = size(FGfield, 3); for i = 1:depth [BGfield(:, :, i), success] = stabilizePair(FGfield(:, :, i), BGfield(:, :, i)); waitbar(i/(depth + 1), p...
function x1=stepit(dxdt,x,dt) k1=dt*dxdt(x); k2=dt*dxdt(x+k1/2); k3=dt*dxdt(x+k2/2); k4=dt*dxdt(x+k3); x1=x+(k1+2*k2+2*k3+k4)/6; end
function [w,index] = extractWaveforms(x, s, win) % Extract spike waveforms. % [w,index] = extractWaveforms(x, s) extracts the waveforms at times s (given in % samples) from the filtered signal x using a fixed window around the % times of the spikes. The return value w is a 3d array of size % length(window)...
nyListe = ['9489394', '39492849', '49284929', '4929493']; indeks=0; for i=100:-10:10 indeks=indeks+1; fprintf('%d.%s.%d',indeks,nyListe(rand([indeks 4])),i); end
function LOC = random_location(Poly_,N) %% random_location generate random points a polygons % % INPUT: Poly_ = boundary file in format of 'polyform.m' % N = number of points a polygon. % OUTPUT: LOC = vector of all points %% Author Nazanin z. Kermani, Imperial College London 2016 LOC = zeros(N,2) ; % Defin...
function exectime = matmult(n) addpath /usr/local/jacket/engine a = gsingle(rand(n, n, 'single')); b = gsingle(rand(n, n, 'single')); tic for i=1:5 z = a * b; end exectime = toc;
function [a,fL4]=transform_3d_cfp8B(a,k) a=double(a); %----------------------------------------------------------------------- M=8; N=size(a); w=floor(N(1:2)/M); Lev=3; H=zeros(1,Lev); W=H; H(1)=w(1); W(1)=w(2); for ia=1:Lev-1 H(ia+1)=ceil(H(ia)/2); W(ia+1)=ceil(W(ia)/2); end tanTheta=1/8; lev=2; for ia=1:9...
clear all; close all; clc; load('DATA_NEW_FEAT'); CONDATA = []; for i = 1:length(DATA) for j=1:length(DATA{i}) CONDATA = [CONDATA ; DATA{i}{j}]; end end [IDX] = kmeans(CONDATA,10); temp = 1; for i = 1:length(DATA) for j=1:length(DATA{i}) s = size([DATA{i}{j}],2); k = size([DATA{...
%SETGAIN adjust the gain of individual playback channels % % [err] = setGain(channels, gains) % % The parameter channels is a vector of channel numbers and the vector % gains contains the new values for the corresponding gains. % On failure the function returns an error string describing the problem. % % Examples: % ...
classdef Robot3D %ROBOT Represents a general fixed-base kinematic chain. properties (SetAccess = 'immutable') dof dhp h plate a_scale end methods % Constructor: Makes a brand new robot with the specified parameters. function robot = Robot...
%10 clear all load('boston.mat'); %generate random indexes to select from boston dataset for training set and %test randIndex=randperm(506); limit=round(length(boston)/3); %mix original dataset mixBoston=boston(randIndex,:); train=mixBoston(1:337,:); test=mixBoston(338:end,:); %initialize arrays for sigma and gamma g...
function [ out ] = cubesatflight(t,in) % This function evaluates a cubesat's flight and determines it's transient % behavior based upon a passive magnetic stabilization system % All work based upon Gerhardt and Palo 2010 paper out = ones(6,1); %% Constants %Important values mu0 = 1.256637e-6; %Vaccuum permeability Aer...
% Générateur de messages aléatoires en binaires % ********************************************* % % Génère une suite de N bits, chacun étant répété bitRepete fois. function [Message,msgCache,msgClair] = genMessage(bitRepete,N,varargin) if ~(bitRepete == round(bitRepete)) || bitRepete < 0 error('La répétition d''u...
%test stub for pipline code, run this using matalab < input.m > output.log Patient_ID='20111007'; Study='20120504'; ScanRange=33:40; T1_runno='B99999test'; DCE_T1map(Patient_ID, Study, ScanRange, T1_runno);
function sets = clean_sets(sets,method,scale,varargin) switch method case 'normal' for j = 1 : length(sets) % y = sets(j).y_values; sets(j).y_values = sets(j).y_values - mean(sets(j).y_values); % y = y - mean(y); sets(j).y_values = ( sets(j).y...
function tileH5mva(gc,mva,comps) %tileH5mva - tile the results of mva in an image, filing the empty gaps as %required... % What are we to plot in the images? if nargin == 2 comps = [1]; end % Tiling arrangement. numCol = 12; % How many files are there? numF = size(gc.fn,1); % Determine image sizings [numRow,pix...
function integrated_field = Tint(tvec,field); %--------------------------------------------------------------------- %--------------------------------------------------------------------- % % This function time integrates the time series/series' in field (time % must be last dimension) and returns a vector of the time ...
function newState = oneStep2D_2(dFunc,oldState, colonyIdx, colonyOutIdx) global userParam kdOut = userParam.kd1; dx = userParam.dx; dt = userParam.dt; Dc = userParam.Dc; ki = userParam.kI2; %% calculating diffusion terms si = size(oldState); diag = 0; diffFilter = [diag 1 diag; 1 -4-4*diag 1; diag 1 diag]; NC = si(...
% Lab 3 Part 2 %% 2.1 Record, graph, and play your voice. n = 5; % seconds fs = 20000; % 20 kHz b = 8; % bits channel = 1; % Recording sound x=record_sound(n,fs,b,channel); % Plotting voice plot(x); % Generating DFT of voice [f,X,f_c,X_c]=dft(x,fs); % Plotting DFT of voice figure mx = abs(X_c); plot(f_c,mx); % Playin...
function [inputSignals, inputBus, opt] = DriverAndEnvironment_road_grade_pattern(nvpairs) %% Road Grade Pattern Input Signal % Copyright 2021 The MathWorks, Inc. arguments nvpairs.InputPattern (1,1) {mustBeMember(nvpairs.InputPattern, {... 'all_zero' ... 'flat' ... 'uphill_3_percent' ... 'do...
function workpath=puller(runno,datapath,scanner,overwrite) %check arguments if nargin<3 error('not enough input arguments'); elseif nargin==3 overwrite=0; elseif nargin~=4 error('too many input arguments arguments'); end %find local disk and workpath local_volume=get_local_vol; workpath=[local_volume '/'...
close all; clear; clc; img = imread('fig0.png'); % fig0.png 이미지 파일 불러와서 img에 저장하기 img = double(img); % img의 데이터를 실수형으로 변환 (실수단위 연산을 위함) [H, W, D] = size(img); % 불러온 이미지 크기 추출 (Height, Width, Dimension) scrWH = get(0, 'screensize'); % 창 위치 조절을 위한 스크린 사이즈 추출 N = 4; % downsizing 배수 img_sampled = img(1:N:end, 1:N:end,:...
clear all; bird_ids=[1053 1034]; h=msgbox('Analysis of Calibration data for LDS PDR Expt'); uiwait(h) for i=1:length(bird_ids) h=msgbox('Select Interaural Microphone Calibration Data, Bird' num2str(bird_ids(1))); uiwait(h) cd C:\alex\calib_data uiopen('load'); end
function [I,I_seg] = load_braintumor(class,grade,patient) %basedir = '/home/haltair/Research/vision/images/Brain_tumor/BRATS-1'; basedir = '/usr/data/medical_images/BRATS2012_braintumor/BRATS-1'; if (patient < 10) temp_str = sprintf('0%d',patient); end if (patient >= 10) temp_str = sprintf(...
N=256;% number of samples fs=1000;% frequency sampling t=0:1/fs:(1/fs)*N; % time from 0 to (1/fs)*N, step each 1/fs % 5 input signals x=A*sin(2*pi*f*t) f1=0; f2=50; f3=100; f4=150; f5=200; [x,fs,nbits,soundbits] = wavread('record1.wav');subplot(211);% make 2x1 viewpoint, plot in first viewpoint plot(t,x);% plot input s...
classdef Zernike_Polynomials < handle % Zernike class written by Michael Wester (7/1/2015) % % This works with either the Wyant or Noll orderings (see Generate_PSF to see % how each can be invoked). This code is based on code originally provided by % Sheng Liu and duplicates the results using the Wyant ordering. Th...
function this = postparse(this, qty, eqn, euc, puc, opt, optimalOpt) % postparse Postparse model code. % % Backend IRIS function. % No help provided. % -IRIS Macroeconomic Modeling Toolbox. % -Copyright (c) 2007-2017 IRIS Solutions Team. TYPE = @int8; %----------------------------------------------------...
% q1_comparisonOfBroadbandMeasures % % Question 1: amplitude vs. power vs log power % How does the quality of broadband estimate vary using amplitude, power or log power estimates? % Prediction: Power best quality % Approach: vary params.method %% Set parameters clear all; params = []; % SIMULATION parameters % Se...
clear clc image_folder = '/Users/arsen/Documents/GitHub/EECE5639_Computer-Vision/Project2/DanaHallWay1/'; file_names = dir(fullfile(image_folder,'*.JPG')); total_images = numel(file_names); img = cell(1,total_images); for k = 1:total_images F = fullfile(image_folder,file_names(k).name); img{k} = imread(F); en...
function [ pars ] = get_layer_pars( layer,num_bases,num_channels) % get layer parameters % pars = get_default_layer_pars(); pars.num_channels = num_channels; pars.num_bases = num_bases; pars.layer = layer; % pars.ws = ws; % pars.spacing = spacing; % pars.num_trials = num_trials; fprintf...
%% common part for all blocks % y12 = 1 / 3.5; % z12 = 0.35; % k12 = 2.6 * logsig((y12 - 0.1935) * 120.0) - 0.49; % u01 = 2.6 * logsig(0.1935 * -120); % u12 = 2.6 * logsig((y12 - 0.1935) * 120.0); y12 = 0.245; z12 = 2.6 * 120 * (1 - y12)^2 * logsig((y12 - 0.1935) .* 120.0) * (1.0 - logsig((y12 - 0.1935) .* 120.0)); k1...
function [BBtight, BBfull, BWmerged, CC] = findROIdummy(imageFile,param,showResults) if ~exist('showResults','var') || isempty(showResults) showResults = 0; % show detected regions end % =========== RECTANGLE COVERING ========================================== % Check for image size %[imHeight, imWidth, ~] = s...
function runConstAdvectionNoSource3d M = [ 10 20 30]; Order =[ 1 2 3]; % len = deltax; Nmesh = numel(M); Ndeg = numel(Order); len = zeros(Nmesh, Ndeg); dofs = zeros(Nmesh, Ndeg); linewidth = 1.5; markersize = 8; linestyle = '-'; color = {'k', 'r','b'}; %black for order one, red for order two marker = {'o'};%circle...
clear; close all; clc; data_path = '../../data/csi_050220/'; param_path = '../../data/param_050220/'; vicon_path='../vicon_segment/segment/'; spectrum_path = '../../data/TRAP_050220_xy/'; if ~exist(param_path,'dir') mkdir(param_path) end if ~exist(spectrum_path,'dir') mkdir(spectrum_path) end % motion_files = ...
function [fid] = fidelity(f,b) f = double(f); b = double(b); fl = 255 * (f / 255).^2.2; sigma = 2; [I J] = meshgrid(-3:1:3, -3:1:3); h = exp(-(I.^2 + J.^2)/2/sigma); h = h / sum(h(:)); flh = conv2(fl, h, 'same'); blh = conv2(b, h, 'same'); flt = 255 * (flh / 255).^(1/3); blt = 255 * (blh / 255).^(1/3); ...
% ------------------------------------------------------------------------- % mpc_exp.m % Explore MPC performance v.s. period. % Author: Xiaotian Dai % https://uk.mathworks.com/help/mpc/examples/control-of-a-single-input-single-output-plant.html % ------------------------------------------------------------------------...
function plotCoherence(wcoh,f,t,coi,xlab,ylab,wcs,thresh) %% PLOTCOHERENCE Helper function to plot coherence (from example R2017a) % % PLOTCOHERENCE(wcoh,f,t,coi,xlab,ylab); % % 2019-08-12 %% PARSE INPUT if nargin < 8 thresh = 0.95; end if nargin < 6 ylab = 'f (Hz)'; end if nargin < 5 xlab = 't (ms)'; end...
function RBES_fuzzy_attributes global params r = global_jess_engine(); if params.WATCH, fprintf('Fuzzy...\n');end % jess watch all r.eval('(focus FUZZY)'); r.run(); % jess unwatch all if params.MEMORY_SAVE list_rules = r.listDefrules(); while list_rules.hasNext() rule = list_rules.next().getNam...
clear all close all N = 2 ^ 13; L = 16; M = N / L; Rs = 2; Ts = 1 / Rs; fs = L / Ts; Bs = fs / 2; T = N / fs; t = - T/2 + [0 : N - 1] / fs; f = - Bs + [0 : N - 1] / T; % 生成升余弦波 alpha = 0; % 滚降系数α Hcos = zeros(1, N); ii = find(abs(f) > (1 - alpha) / (2 * Ts) & abs(f) <= (1 + alpha) / (2 * Ts)); Hcos(ii) = Ts / 2 * (...
%%% % Creates Figures on cell bias towards aggreagtes %%% addpath('Libraries/Utils') PROJECT_BASENAME = ['/Volumes/Scratch/Chris/Paper2_Rippling/Paper2/']; run('ENVS.m') load([PROJECT_BASENAME, '/data/processed/Development/AllDataTable.mat']); % PERSISTENT = true caluclates graph for persistent runs % PERSISTENT = fa...
%% changed script close all; clear; clc format long A = [1.5 0.8 5.1; 3 4 5; -3 -2 -6]; Aori = A; numPiv = 0; % initialize the number of pivots [n,n] = size(A); p = (1:n)'; for k = 1:n-1 % Find largest element below diagonal in k-th column [r,m] = max(abs(A(k:n,k))); m = m+k-1; % Skip elimination...
function sort_pop(a) n=length(a); for i=1:3 for j=1:n-i if a(j+1)<a(j) temp=a(j); a(j)=a(j+1); a(j+1)=temp; end end end end
preds_class_lin = classify(X_crp_test',X_crp_train',X_crp_train_lbl,'diaglinear'); diffs_class_lin = preds_class_lin-X_crp_test_lbl; nmb_correct_class_lin = zeros(crp_num_img - train_number,1); for i = 1 : crp_num_img - train_number if diffs_class_lin(i) ~= 0 % if the prediction was NOT correct nmb_correct_...
function D = activationFnDeriv(z) D = sigmoid(z) .* (1 - sigmoid(z)); end
function modulationFrequencyStep_prs(obj, evt, stage) hndl = get(gcf, 'Userdata'); hndl = get(hndl.mainFig, 'Userdata'); switch stage case 1 hndl.setting.Pre.modulation.frequencyStep_P = get(obj, 'value'); if hndl.setting.Pre.modulation.Num_CK ...
function [dc, L] = dilatcond( img1, img2, opts ) % Generates an image stack, dc, for which each slice corresponds to % subsequent iterations of conditional dilations from img1 to img2. % Iterations continue until the dilation has reached img2, i.e. the area of % img2 is the same as the area of the dilation iteration. ...
function erg = rvalue(q, r) %RSQU erg=rvalue(r, q) computes the r-value for % two one-dimensional distributions given by % the vectors q and r q=double(q); r=double(r); sum1=sum(q); sum2=sum(r); n1=length(q); n2=length(r); sumsqu1=sum(q.*q); sumsqu2=sum(r.*r); G=((sum1+sum2)^2)/(n1+n2); erg=(sum1^2/n...
function dd = divdiff(x, y) % NEWTONDD - calculates the coefficients for polynomial interpolation in Newton's form. % The output dd is a row vector that contains f[x0], f[x0,x1], ... , f[x0,x1,...,xn] % It can only handle vector inputs. [x, y] = row2column(x,y); len = length(y); dd = zeros(len,len); d...
function drawgeomright1(Ldomain,q) strq=num2str(q); [pde_fig,ax]=pdeinit; pdetool('appl_cb',1); set(ax,'DataAspectRatio',[1.5 1 1]); set(ax,'PlotBoxAspectRatio',[1 1 1]); set(ax,'XLim',[-2 22]); set(ax,'YLim',[-1 1]); set(ax,'XTickMode','auto'); set(ax,'YTickMode','auto'); pdetool('gridon','on'); % Geometry descriptio...
function spc_filterFrames global spc gui %global tmp prompt = {'Filter Window Size'}; dlg_title = 'Input'; num_lines = 1; def = {'4'}; answer = inputdlg(prompt, dlg_title, num_lines, def); if isempty(answer) return; end fw = str2num(answer{1}); spc.page = 1; set(gui.spc.spc_main.spc_page, 'String', num2str(spc.pa...
%Metodo de Broyden: Sist. Ecuac. No Lineales function [iter,x,ea] = broyden_2x2 %Función para solucionar un sistema de dos ecuaciones no lineales %"ecuaciones" es una subfunción que contiene las ecuaciones %x0 es un vector con los valores iniciales en fila, %tol la tolerancia en porcentaje (%) %syms x1 x2 x...
function vector= feature_extractor(input_img) %this function receives a grayscale img as input and returns a feature vector %FIRST ORDER MEASURES vector{1}= mean2(input_img); %average vector{2}= (std2(input_img))^2; %variance is the square of the standard deviation %SECOND ORDER MEASURES -> derived from gray lev...
% Inclass11 %GB comments 1) 100 2) 100 3) 100 4) 100 overall: 100 % You can find a multilayered .tif file with some data on stem cells here: % https://www.dropbox.com/s/83vjkkj3np4ehu3/011917-wntDose-esi017-RI_f0016.tif?dl=0 % 1. Find out (without reading the entire file) - (a) the size of the image in % x and y, ...
function Y=NNTuckerCore(Y,U) %% Given tensor/ttensor Y % find the optimal nonnegative core tensor with fixed nonnegative loading matrices U. % If U is not given, U=Y.U. if nargin==1 if strcmp(class(Y),'ttensor') U=Y.U; R=size(Y.core); else error('U is required.')...
function createORG_Surface(inputFile) % USPEX Version 9.3.0 % new tags: dimension/varcomp/molecule % deleted tags: supercomputer name global ORG_STRUC getPy=[ORG_STRUC.USPEXPath,'/FunctionFolder/getInput.py']; %for surfaces %[nothing, reconstruct] = unix (['./getStuff ' inputFile ' reconstruct 1']); reconstruct = p...
addpath(pwd); fprintf('PeakDecon path is added to the MATLAB search path. Enjoy PeakDecon!!\n')
function [ message ] = data_select(obj, data_idx ) %data_select update roi list, file info table and parameter table to the %selected data according to data_idx %select_data(obj,data_idx); %% function check try %------------------------------------ %get current roi and switch them off num_roi=numel(obj.dat...