text
stringlengths
8
6.12M
function [ ichangepts, rchangepts, trajmap] = changepoint_detection( object_change_tuples, trajs, itimes, k, rtimes) %CHANGEPOINT_DETECTION This function detects change points in trajectories % object_change_tuples: N x d matrix % trajs: N x 1 matrix where each entry is a number of which trajectory % that example...
function [J, grad] = costFunction(theta, X, y) %COSTFUNCTION Compute cost and gradient for logistic regression % J = COSTFUNCTION(theta, X, y) computes the cost of using theta as the % parameter for logistic regression and the gradient of the cost % w.r.t. to the parameters. % Initialize some useful values m = l...
function PlotEpsAndMu(dd20,dd25,dd30,dd35,dd40,dd45,dd50,material_width,material) %{ figure; plot(dd20.t_frequency/1e9,real(dd20.epsilont),'k','LineWidth',2) hold on plot(dd20.frequency/1e9,real(dd20.epsilon),... dd20.frequency/1e9,real(dd25.epsilon),... dd20.frequency/1e9,real(dd30.epsilon),... dd20.freque...
%%Testing %VMC(1:7,1) myaxes = axes('xlim',[-10 10],'ylim',[-10 40], 'zlim',[0 2]); view(-14,14); % VIEW(3) sets the default 3-D view, AZ = -37.5, EL = 30 grid on; axis equal; %hold on xlabel('x') ylabel('y') zlabel('z') %% 1.1 Create Road lines for reference p=0; for s = 0:100 p = s*3; line([-5 5],[p...
function [f_best, x_best] = geneticAlgorithmA(f, l, u, pop_size, n_generations) % f - Function % l - Lower Bound % u - Upper Bound p = (u-l).*rand(size(l,1),pop_size); % Initial Population (first generation) n_intervals = 256; % Intervals for Binary Discritization n_crossovers = 3; % Number of Crossovers k = 0; % Iter...
data = load(fullfile(files_path, 'postprocessed_data', 'ofc_celldatas_ensemble')); singles = find_singles(data.celldatas); clear data ephys_regression_results = load(fullfile(files_path, 'postprocessed_data', 'ephys_regression_results')); nRegs = size(sse.sse_leftout{1,1},1); %% Plots for singles % Re-organize for l...
%learn mixed strategy from set of basis for new map %mixed strategy is learn row by row until last block is reached function [AggtdPolicy, AggtdWeights, CompositePolicies]=C_mixedMap(map) global blockSize; global N_ACTIONS; global N_STATES; global N_POLICIES; global T; global showProgress; ...
function test_close10() % test_close10() runs unit tests on close10(a,b) and returns the number that fail % author: Tim Hickey % date: Feb 14 2011 (Valentine's Day) % Modified by Sean Kilachand % Fixed syntax of test file % Added 2 test cases e=0; e=e+ runTest(8,13,8); e=e+ runTest(13,8,8); e=e+ runTest(7,13,0); e=e+ ...
function [ tcm ] = thecannon_norm_test_flux( tcm, varargin ) % Written by: Bo Zhang (NAOC, bozhang@nao.cas.cn) % Last modified: 25-Jun-2016 % % Aim: % - % Example: % - % - % INPUT: % - % - % OUTPUT: % - % - % HISTORY: % - % - wave = tcm.wave; test_flux = tcm.test_flux; test_ivar = tcm....
%In this program the two plots of the Paper are generated: 1. fallspeed and mass 2. fall distance mkdir('Plots','4_Sublimation_var_icecrystal'); %create folder for plots close all set(0, 'DefaultFigureRenderer', 'OpenGL'); %to remove the distance between 100 and mu in label. %OpenGL does not so...
% Activity no.: Matlab 2, Task 5 % File: ML2_ACT_Task5_katherto.m % Date: 22 November 2015 % By: Natalie Zimmermann % Login ID: zimmermn % Kathryn Atherton % Login ID: katherto % Ryan Hellyer % Login ID: rhellyer % Section: 04, 3:30 - 5:30, C111 % Team: 59 % % ELECTRONIC SIGNATURE % Natalie Zimmermann % Kathryn Atherto...
%Heat Equation 2D - Cas homogène | Régime permanent | Sans source interne %| Méthode différences finis | Code fonctionne de préférence avec plaque %carré L = 3 clear all clc %Plaque plane rectangulaire %Données N = 4; %Discrétisation (faire en sorte que h C |N) => taille matrice ax = 0; bx = 4; Lx = ax - bx; %Longue...
function [L,H]=De97Sym(A) hlen=length(A)/2; lenL=ceil(hlen); lenH=floor(hlen); [L,H]=dwt(A,'bior4.4','mode','symw'); %%%%%%%%%%%%%%%%%% L=L(3:2+lenL); H=H(3:2+lenH);
function name = plot1(x, y) x = -10 : 4: 15; y = x.^2; plot(x,y); hold on y = exp(x); plot(x,y);
function [q] = CreateComplexGrid2(z,c,cutoff) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here i = 1; q = 1; complex = z^2 + c; while i <= cutoff absolute = abs(complex); if absolute < 3 q = q + 1; complex = complex^2 + c; i = i + 1; ...
% Rate of CH3C(O)CH2O2 + NO --> products % Updated 7/14/06 AEP % Based on JPL Data Evaluation #15 % rate=kNOCH3COCH2O2(T,M) function j=kNOCH3COCH2O2(T,M) j=2.9e-12.*exp(300../T);
function [ Word ] = ConvertInkmlToSequence( DataSetPath, filename ) %CONVERTINKMLTOSEQUENCE Summary of this function goes here % Detailed explanation goes here % [ WordSequence ] = ConvertInkmlToSequence( 'C:\Users\kour\OCRData Old\Archieve\adab_database_v1.0\Data\set_1', '1231874526312' ) inkmlPath = [DataSe...
function [R_BW] = euler2dcm(e) % euler2dcm : Converts Euler angles phi = e(1), theta = e(2), and psi = e(3) % (in radians) into a direction cosine matrix for a 3-1-2 rotation. % % Let the world (W) and body (B) reference frames be initially aligned. In a % 3-1-2 order, rotate B away from W by angles psi (ya...
function handle=WriteMRCHeader(map,pixA,filename,sizes,org,mode,isVol,handle) % function handle=WriteMRCHeader(map,pixA,filename,sizes,org,mode,isVol, handle) % Write out the header of an MRC map file, and leave the file open, % returning the file handle, so that data can be written sequentially into % the file and the...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 本函数用于画Equity右图2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function h = draw_right2_e(f,equity) h = axes('parent',f,'position',[0.84,0.35,0.15,0.21]); hold on; bar(1,equity.maxConwl(1),0.5,'r'); bar(2,equity.m...
function [cents] = pointdrift_points(im) config = get_config(); orig = im; if config('pointdrift_use_dog') im = pointdrift_dog(im); else % FIXME constant size here %size_threshold = 40; % smooth the image %im = histeq(im); im = imtophat(im, strel('d...
function finetune_cat(DATA_DIR, question_dir, model_dirname, dset_dir, setlist, trainval_prefixes, trainval_sets, tr_set, val_set, caffestuff, net_params, deploy_params, solver_params, ... caffe_bin_path, create_lmdb_bin_path, compute_mean_bin_path, parse_log_path) cat_idx_all = setlist.cat_idx_all; obj_lists_all ...
function syscomtest( ) cmd=['echo "lala" > log_test_sys_com']; system(cmd); end
function [ out ] = get_baseball_stats( season_folder ) f_dir = dir(season_folder); file_list = {}; for i = 1:length(f_dir) %is this a file? if f_dir(i).isdir == 0 file_list{length(file_list) + 1} = [season_folder f_dir(i).name]; end end %open file pitchers = {}; %init the current pitcher cell, ...
% CUSTOM_defaults_in.m ADVISOR 3.0 rev a input file created: 21-Dec-2000 15:05:37 global vinf vinf.name='CUSTOM_defaults_in'; vinf.block_diagram.name='BD_CONV'; vinf.drivetrain.name='custom'; vinf.fuel_converter.name='FC_SI41_emis'; vinf.fuel_converter.ver='ic'; vinf.fuel_converter.type='si'; vinf.transmission.nam...
% f(X,Y) = Y + sqrt( X^2 + Y^2) with a surface over X and Y % X range [ -5 5] Y range [ -3 2.5] with 200 equally spaced values X = linspace(-5,5,200); Y = linspace(-3,2.5,200); [X,Y] = meshgrid(X,Y); Z = Y + sqrt( X.^2 + Y.^2); surf(X,Y,Z);
load('Stat.mat'); plot(StatFile.qcno_dB, [sqrt(StatFile.DestPhi./StatFile.Np)*180/pi; sqrt(StatFile.DestPhiSredn./StatFile.Np)*180/pi; sqrt(StatFile.DestPhi_Theor)*180/pi]); title('RMSE \phi') ylim([0 100]); figure plot(StatFile.qcno_dB, [sqrt(StatFile.DestW./StatFile.Np)/2/pi; sqrt(StatFile.DestW_Th...
function [to yo] = konvolusi(f,g,t) ink = t(2)-t(1); yo=conv(f,g)*ink; to=linspace(2*min(t),2*max(t),length(yo));
function [nav, Date] = nav2month(nav1 , Date1) % 将任何周期的输入数据nav1转化为月周期数据 % --------------------- % 唐一鑫,20150730 Date = zeros(length(Date1),1)-1; nav = zeros(length(nav1),1)-1; i = Date1(1); j = 1; temp = findclose(Date1,i); % 返回最接近的项数 Date(j) = Date1(temp); nav(j) = nav1(temp); while(true) j = j + 1; i = i +3...
clear all; %Load data files1 = dir('./BEACH24/*.mat'); files2 = dir('./DUCK24/*.mat'); Nfeature = 8; Ndata1 = size(files1,1); Ndata2 = size(files2,1); Ndata = Ndata1 + Ndata2; BeachData = cell(Ndata1,1); i = 1; for file = files1' BeachData{i} = load(file.name); i = i + 1; end DuckData = c...
close all; clear all; clc; x0=0.5; x1=1.0; h=x1-x0; s=0.5*(f(x0)+f(x1))*(x1-x0); esatto=ff(x1)-ff(x0); errteorico=h^3*fdd(x1)/12.; fprintf("%f\t%f\t%f\t%f\n", s, esatto, s-esatto, errteorico); npts=101; xx=linspace(x0,x1,npts); yy=f(xx); y1=flin(xx,x0,x1); plot(xx,yy); hold on plot(xx,y1); functi...
function I = SwI_NIDAQUSB5132(obj) % Measure switching current of a dc SQUID/Josephson junction under ramp driving by % using NI DAQ USB5132 for switching voltage signal aquisition. % Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences % mail4ywu@gmail.com/mail4ywu@icloud.com NIDAQUSB5132OBJ ...
function [ users_path ] = create_path( users, dimensions, total_positions, step_distance, mean_distance ) %CREATE_PATH Creates a random path for each user in a surface % users Number of users % dimensions Dimensions of the surface in meters users_path = NaN(2,total_positions,users); for user = ...
%uniform mutation function new_child = mutation(child) p_mutation = 0.25; range = [2 18; 1.05 9.42; 0.26 2.37]; new_child = zeros(3, 1); for i = 1:3 rand_num = rand(); if(rand_num > p_mutation) new_child(i, 1) = child(i, 1); else new_child(i) = round(range(i, 1) + (range(i, 1)-range(i, 2))*r...
function [game_mat, patterns] = map_to_matrix(mat_size, corrs, threshold) game_mat = zeros(mat_size); patterns = {}; % 优先使用相关系数高的数据进行归类 for k = 1:length(corrs) % 相关系数已低于阈值,并且每一块已被检测过时,结束归类 if corrs(k,1) < threshold && all(game_mat(:)) break; end ...
clc; clear; close all; N=16; % 16 32 128 n=[0:N]; f1=0.22; f2=0.34; xn=1/2*sin(2*pi*f1*n)+sin(2*pi*f2*n); Xn = fft(xn); subplot(2,1,1); stem(n,abs(Xn)); subplot(2,1,2); stem(n,angle(Xn));
function [cfr] = rls_dualr(X,y, opt) % rls_dualr(X, y, opt) % computes a classifier for the dual formulation of RLS. % It uses a randomized method to solve the associated linear system. % The regularization parameter is set to the one found in opt.paramsel. % In case of multiclass problems, the regularizers need to be ...
function [S] = clamped_cubic_splines (x, y, yp) % Clamped Cubic Splines for Interpolation % % Approximates f(x) given x and y using clamped cubic spline interpolants. % % Error : max_{a<=x<=b}[|e|] <= C_0 h^4 max_{a<=x<=b}[|f^4(x)|] % Notes : At the bounds the interpolating interval, S''(x) = 0...
function dh = DenavitHartenberg(q) % DenavitHartenberg returns a matrix dh wich has one row per joint and % each row is [theta d a alpha]. Joints are assumed revolute. q_1 = q(1); q_2 = q(2); q_3 = q(3); q_4 = q(4); q_5 = q(5); q_6 = q(6); %% Defining constants d_1 = 0.0892; % [m] a_2 = -0.425; % [m...
function [C1,C2,C3,C4,C5,C6,C7,C8,C9]=cluster_maker(S,n) x1=0; x2=0; x3=0; x4=0; x5=0; x6=0; x7=0; x8=0; x9=0; for z=1:1:9 if(z==1) for i=1:1:n if (S(i).id==z) x1=x1+1; C1.nodes(x1)=S(i).name; end end end if(z==2) for i=1:1:n if (S(i).id==z) x2=x2+1; C2.nodes(x2)=S(i).name; e...
function [f,siglinesup,siglinesdown,magnitudes,pvals,sortorder]=compareplot_singlemetricnew(data,parameter,genotypeinds,siglinesup,siglinesdown,magnitudes,pvals,mode,colour,sortorder) %function f=compareplot(data,parameter,genotypeinds) %insert parameter data for all parameters (data) %the parameter of interest (ie cur...
function geomview_write_off(outputFile,fv) % geomview_read_off - Read GeomView .off mesh file format % % [vertices,faces] = geomview_write_off(outputFile,fv) % % This function will write an ascii file that contains a one line % specification of the 'OFF' file format followed by another line to % specify number of vert...
iasi_paths for f = findfiles([prod_dir '/' datestr(JOB(1),'yyyy/mm/dd') '/ecm.iasi_l1c*']) disp(['Loading ' f{1}]) [h ha p pa] = rtpread(f{1}); disp(get_attr(ha,'rtpfile')) [h2 ha2 p2 pa2] = rtpgrow(h,ha,p,pa); if ~isequal(size(p2.rcalc),size(p2.robs1)) disp('different sizes') unlink(f{1}) end if...
%% Feedback particle filter for state estimation problems % - Defines the state and observation processes - X_t and Z_t % - Defines the prior distribution p(0) % - Generates particles Xi from the prior p(0) % - Passes these particles Xi to four different gain function approximation % functions - i) diff TD learning (...
function pixels = Lv(inpic, kernel_type, shape) if (nargin < 3) shape = 'same'; end [dxmask dymask] = get_delta_dir_kernels(kernel_type); Lx = filter2(dxmask, inpic, shape); Ly = filter2(dymask, inpic, shape); pixels = Lx.^2 + Ly.^2; end
% tabula rasa: clc; clear all;close all; %% This is to solve Prelab Q1: %% % Read the image given to you (use function imread()) im = imread('image1.jpg'); % plot the original image (use imshow()) figure imshow(im); % convert your image into hsv color space (use function rgb2hsv()) hsvim = rgb2hsv(im); h = hsvim(:...
function plot_IPM_fit(modelnum,Year) fit_filename = strcat(['Tomales_IPM_fits/Tomales_Model_',num2str(modelnum),'_20Jan2018_fit.mat']); post_filename = strcat(['Tomales_IPM_fits/postproc_Tomales_Model_',num2str(modelnum),'_20Jan2018.mat']); metaname = 'Tomales_20Jan2018_metadata.mat'; load(fit_filename) load(post_fil...
classdef LM_LeftPaneListBase < LM_UnitBase properties (GetAccess = ?LM_UnitBase, Constant) titleHeight = 25; end properties (Access = private) numElements = 0; gVBox; heightIndex = struct(... 'title',1,... 'elements',@(this) 1+(1:this.numElements)); end methods (Access = {?LM_...
%---------------------------------------------------------------- % scripts to read and open data from a netcdf file into Matlab % % this should work for Matlab 2015 as used on the macbook % % levi silvers dec 2016 %---------------------------------------------------------------- %source='/Users/sil...
b= linspace(-ts/2,ts/2,60); plot(b,s7,'k','linewidth',2);title('S_7(t) = - S_1_5(t)');grid; A=0.7071; axis([-1.5e-6 1.5e-6 -1.3 1.3]) line([-ts/2 -ts/2],[-1.3 -1],'color','k','LineStyle','--','linewidth',1.5) line([ts/2 ts/2],[-1.3 1],'color','k','LineStyle','--','linewidth',1.5) ax=gca; ax.XTick=[-1.0417e-6 -.5e-6 0 ....
load XBaseAleatoireBruit.mat load YBaseAleatoire.mat x=XBaseAleatoireBruit; y=YBaseAleatoire(:,3); nbslices=20; expoparamess=-10:1:0; omega=cov(x); nbess=length(expoparamess); erreur=zeros(nbess,1); for j=1:nbess; j param=10^(expoparamess(j)); erreur(j)=cross_validation(x,y,10,param,nbslices,omega); erreur(j) e...
function [ obj ] = readSutterMetadata( obj, imageDesc ) %READSUTTERMETADATA Extract metadata ofr SutterMOM Tiff files % Parse the ImageDescription Tiff tag and extract the relevant % information. % INPUT % obj: current TiffReader object % imageDesc: string containing the ImageDescription tag content % ...
function handles = guiHIO(HIOtab,width,height,left1,left2,prepareHIO) % Left panel with a reconstructin parameters HIO ################## uicontrol('Parent',HIOtab,'Style','text',... 'String','H...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Description: This script implements the Lax Friedrich method to % numerically solve the scalar advection equation u_t + au_x = 0. % It stores all the parameters that define the desired % method. Stable provided mu=abs(ak/h)<=1 % Lax ...
function varargout=cachedcall(varargin) %% CACHEDCALL can be used to cache the results of slow function calls to disk % % You can call an arbitrary function using CACHEDCALL. It will then check % if you have made the same call with the same arguments before. If you % have then it will quickly load the previously comp...
function Y = sign(X) % Symbolic sign function. % For each element of X, sign(X) returns 1 if the element % is greater than zero, 0 if it equals zero and -1 if it is % less than zero. For the nonzero elements of complex X, % sign(X) = X/ABS(X). % % See also ABS, SYM/ABS % Conv...
clear clc for index = 11:-.5:1 disp(index); end %% clear clc for index = 1:.5:11 disp(index); end %% clear clc time = 1:1:8; for index = time disp(index); end %% clear clc %dont do this time = linspace(0,50,100); for index = length(time); disp(index); end %% clear clc %do this time = linspace(0,50,...
v1=input('enter a vector\n'); v2=input('enter another vector\n'); v11=v1(1,1); v12=v1(1,2); l1=( v11^(2) + v12^(2))^(1/2); v21=v2(1,1); v22=v2(1,2); l2=( v21^(2) + v22^(2))^(1/2); v1dotv2 = v1.*v2; v1v2=v1dotv2(1,1); cosine = v1v2/(l1*l2); theta =(180*acos(cosine))/pi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Author: Josh Smith %% Discription : init and connect to a vrep simulation %% %% INPUTS %% none %% %% OUTPUTS %% clientID: should be a value >-1 if initialization succeeded %% vrepObject: A vrep object used to call vrep api functions %%%%%%%%%%%%...
%Calling function: main function [avg_currency_rnd, currency1, currency2, currency3, currency4, currency5, avg_service_rnd, avg_request_rnd, trade1, trade2, trade3, trade4, trade5, total_rnd_income, total_rnd_income_DSO, total_rnd_income_sellers, income_round1, income_round2, income_round3, income_round4, income_rou...
%fill any missing data gaps function [OMS, ECDataCut] = conditionUTSappData(OMS, ECData, info) fprintf('\nConditioning data...\n'); %Get fields from scintillometer data firstDay = floor(OMS.MWSC(1, 1)); %despike data datatmp = deSpike(OMS.MWSC, info, [1]); %Fill missing timesteps time = datatmp(:, 1...
function [perf, directory] = find_perf(key, outputDir) arguments key; outputDir = 'outputs'; end if isnumeric(key) % if key is a non-positive number: % 0: current commit % -n: the previous nth commit. % if the perf for the commit is missing, an error is thrown. intKey = int32(key); if i...
% Demo to run learn structure on real UCI Adult dataset % % U: contNodeNum * sampSize, real/noisy continuous attributes data. % V: discNodeNum * sampSize, real/noisy discrete attributes data. % L: levels in each categorical variable % Requires UGM at http://www.di.ens.fr/~mschmidt/Software/UGM_2009.zip % Req...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Wasserstein Inverse covariance Shrinkage Estimator % Viet Anh NGUYEN, Daniel KUHN, Peyman MOHAJERIN ESFAHANI %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % The solar irradiation application % clear all; close all; clc; startup;...
%% It requires to load the next 4 variables: % - tsne1 % - tsne2 % - names % - classes %% Randomnes monitor RandStream.setGlobalStream( RandStream('mt19937ar','Seed',0) ) ; %% To manually select samples from some particular classes idx1 = find( strcmp(classes,'unstim') > 0 ) ; idx2 = find( strcmp(classes...
DURATION=312; TR=1; hdrname= 'sim0001.hdr'; imgname = 'sim0001.img'; noise_amp=0.1; resp_amp=0; card_amp=0; bold_amp=0; h =read_hdr(hdrname); img=read_img_data(h,imgname); mask=read_img2(h,imgname); mask = zeros(size(mask)); mask(20:30,20:30, h.zdim/2) = 1; mask = reshape(mask,size(img)); load phys_phases resp = s...
function [a_estime,b_estime] = estimation_1(x_donnees_bruitees,y_donnees_bruitees,psi_tests) %ESTIMATION_1 Summary of this function goes here % Detailed explanation goes here %calcul du centre de gravité: Xg=mean(x_donnees_bruitees); Yg=mean(y_donnees_bruitees); x_donnees_bruitees_centree = x_donnees_bruitees-Xg; y...
%{ mice.Death (manual) # info about each mouse's death -> mice.Mice --- dod=null : date # date of death death_notes="" : varchar(4096) # other comments death_ts=CURRENT_TIMESTAMP : timestamp # automatic %} classdef Death < dj.Relvar properties(Constant) ta...
% Create figure figure1 = figure; % Create axes axes1 = axes('Parent',figure1); box(axes1,'on'); hold(axes1,'all'); % Create multiple lines using matrix input to plot plot1 = plot([psnr_sr1',psnr_bicubic'],'Parent',axes1); set(plot1(1),'DisplayName','Алгоритм с обучаемыми словарями'); set(plot1(2),'DisplayName','Бик...
function [fits sems] = getML_ddOU(Monk, recompute) % get coh and time dependence of performance using OU model savepath = ['/work/mirror_jeff/code/matlab/tmp-mat/getML_ddOU_' Monk '.mat']; if recompute % get session data fn = [Monk 'TRain_psy.txt']; a = getML_txt(fn); fname = a.data{strcmp(a...
%%%%% NAPE @ HOME STATISTICS COURSE EXERCISE 1 %%%% % Kevin Coffey - 04/09/2020 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Start Fresh clear all % % Load from relative path t=readtable('College.csv'); % Load from abosute path % t=readtable("C:\Users\MrCoffey\Desktop\NA...
function total = income( rate, price ) %INCOME Summary of this function goes here % Detailed explanation goes here total = sum(rate .* price * 16 * 6); end
% Check if the image designated by the given path string has already been % processed. If it has been processed, return the processed image. % Otherwise, return an empty array. % % Author: Elliot Tuck % Date: 20170803 function processed_image = getProcessedImage(path) processed_image = []; if (~isappdata(0, 'pr...
%% Init %% ref_data create_ref_data; %% Index open_index;
function str = pcalc(str) % PCALC calculates the values of the 2nd AWG parameter group. % SF, January 31, 2006 p = str.param; p.lambda0 = p.c_light/p.freq0/1000.0; %center wavelength in um p.Nc_nc = 1-(p.lambda0*1000.0/p.inchannel)*p.dNc_dLambda; p.dlambda = p.c_light/p.freq0^2*p.channel/10...
function ha = shMocF(QC, Conn, skel, varargin) % Show one mocap frame. % % Input % QC - 3D or 2D coordinates of joint, d x nJ % Conn - joints that bone connect, 2 x nB % skel - skeleton % varargin % show option % key - whether the current frame is a key-frame or not, {'y'} | 'n' % ...
close all; clear; global Link num=1; ToRad = pi/180; for th1=-180:30:180 for th2=0:30:180 for th3=-180:30:180 for th4=0:30:180 % %描点法% % % DHfk_Robot1_JC(th1,th2,th3,th4,1); % px(num)=Link(5).p(1);py(num)=Link(5).p(2);pz(num)=Link(5).p(3); % ...
clear addpath '/mnt/homes/home024/pmurphy/Toolboxes/fieldtrip-20160221' addpath '/mnt/homes/home024/chernandez/matlab/cbrewer' ft_defaults loadpath = '/mnt/homes/home024/chernandez/meg_data/surprise/preprocessed/Data/ERF/'; % path of preprocessed MEG data % load some stuff for plotting load([loadpath,'CTF275_helmet....
f = @(x) exp(x(1)^2 + x(2)^2); g = @(x) x(1) + x(2) + 4; q = @(c) @(x) f(x) - (1 / c) * (1 / g(x)); seq = 10 .^ (0:10); x0 = [0, 0]; eps = 10 ^ (-5); for i = seq grad1 = @(x) 2 * x(1) * exp(x(1)^2 + x(2)^2) + (1 / i) * (1 / (g(x) ^ 2)); grad2 = @(x) 2 * x(2) * exp(x(1)^2 + x(2)^2) + (1 / i) * (1 / (g(x) ^ 2));...
function [ Qpsk ] = modulation( x ) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here i=1; n=length(x); for k=1:n/2 if x(i)==0 && x(i+1)==0 Qpsk(k)=1+1j; elseif x(i)==0 && x(i+1)==1 Qpsk(k)=1-1j; elseif x(i)==1 && x(i+1)==0 Qpsk(k)=-1+1j; ...
function target = Read_CASTEP(flag) % created by Zamaan Raza % Rewritten by Maxim Rakitin, July 2014 if flag == 0 [nothing, results] = unix('grep ''Final Enthalpy'' cstp.castep | awk -F= ''{print $2}'' | awk ''{print $1}'' '); if isempty(results) | isempty(str2num(results)) disp('CASTEP relaxation is not done...
%% Definte the penetrations make_fras = 1; min_num_neurons = 5; %How many neurons of each type there have to be to use the penetration all_pen_dir = '/mnt/40086D4C086D41D0/Inhibitory_excitatory_analysis/For_analysis/All_pens'; pen{1} = '/mnt/40086D4C086D41D0/Inhibitory_excitatory_analysis/For_analysis/Ronnie/P04/P04-qu...
function [r1, r2, r3] = crisg4_split(id,rad); % function [r1, r2, r3] = crisg4_split(id,rad); % % Split radiance computed with the UMBC "g4" CrIS RTA into % three bands. Returns non-empty data only for those bands % for which input data was supplied. % % Input: % id - [nchan x 1] channel IDs {1-1329} % rad - ...
%DeltaHedgingPnL(100,100,0,0.05,0.4,0.2,1,250,250,7); function [PnL]=DeltaHedgingPnL(S0,K,mu,r,sigma_a, sigma_i,sigma_h,T,f,hf, nSim, iCallPut) % f is stock frequence, hf is hedge frequence dt=T/f; step=f/hf; figure; PnLs=[]; for l=1:nSim s=Stock(S0,mu,sigma_a,T,f); i=1:step:f+1; ii=i(1:length(i)-1); ...
function checkExamHashes() %% Get the hashes of current files mfiles = dirmf(); cnt = 1; for i = 1:length(mfiles) try absPath = fullfile(mfiles(i).folder,mfiles(i).name); hash = GetHashCodeFromMFile(absPath); if ~isempty(hash) HashCodes{cnt} = hash; AbsPathHashCodes...
function [AoAChange] = WingTwist(y) run AircraftData; b = Vanguard.Wing.b; ZeroLiftAngle = Vanguard.Wing.Airfoil.ZeroLiftAngle; GeoTwist = Vanguard.Wing.GeoTwist; AoAChange = (GeoTwist/2-y/(b/2)*(GeoTwist) - ZeroLiftAngle)*pi/180; end
function n = normala_bez(b,t) [tangenta,~] = bezier_der1(b,t); normala1 = [tangenta(2);-tangenta(1)]; n = normala1 /norm(normala1); end
function rebuild_dir(path) % delete and rebuild the dir if exist(path,'dir') rmdir(path,'s'); end mkdir(path); end
function [pts, I] = trajPredictor(tpar, k, expos, isize) % render a trajectory into an image % % [I, T] = trajRender(isize, tpar, N) % % isize ... output image size; [height, width] % tpar ... trajectory parameters x(t) = a + b*t + c*t^2; format: [a,b,c] % could be a cell array of parameters -> then generates mul...
%% Rohde & Schwarz GmbH & Co. KG % 32bit MATLAB calllib example for R&S Spectrum Analyzer Instrument Driver rsspecan % The example configures spectrum analyzer, performs the sweep, % reads the trace data from one sweep and then from 5 maxhold / minhold % faster sweeps from 2 different traces. Then, makes a screenshot ...
function [vout] = paramsel_hodualr(X,y, opt) % paramsel_hopdualr(X,y, OPT) % Performs parameter selection when the dual formulation of RLS is used. % The hold-out approach is used. % The eigendecomposition used to compute the regularization path is % computed using a randoamized method. % The performance measure speci...
function [evaluated_value,huberInside_mat,huberOutside_mat] = objective_func_ica_huber(raw_sig,processedSig,artifactSig,varargin) numTrials = size(raw_sig,3); numChans = size(raw_sig,2); huberInside_mat = zeros(numChans,numTrials); huberOutside_mat = zeros(numChans,numTrials); % default params fs = 1.2207e04; plotIt...
function [ stimArray ] = MonocomponentSinusoidalGratings(params, c, tf, sf) % Simple monocomponent sinusoidal gratings % Output format is [time x space x numStim] % Convert time and space vectors into units of radians tVec = 2 * pi * tf * params.t; xVec = 2 * pi * sf * params.x; % Allocate a container stimArray = zer...
function [slope_common, offsets_ch1] = inhibit_remove_bleedthrough(Ys, Xs, maxIter, onlyRegress) % Solve the model: red_ch1 = offset + slope * green_ch2 % you need the following vars: % trace_ch2, trace_ch1 if ~exist('maxIter', 'var') maxIter = 1000; %100; end if ~exist('onlyRegress', 'var') onlyRegress = 0; ...
clear; %close all; colorCode = [0 0 0 ;%background 0 0 255 ;%bed 255 102 102 ;%#books 0 0 20 ;%ceil 0 102 204 ;%#books 255 255 0 ; %floor 0 204 204 ;%furn 102 0 255 ;%#obj 153 255 204 % painting 102 0 0 ; % sofa 255 0 255 ;%#table ...
function varargout = detectFaceTampering(varargin) % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @detectFaceTampering_OpeningFcn, ... 'gui_O...
function weights = helicalConeAngleWeights( gammas, beta, Delta, tanAlpha, s, uu, vv, segmentLength ) a = Delta / 2; weights = zeros( size( tanAlpha) ); for i = 1:length(gammas) gamma = gammas(i); if abs( beta + pi - 2 * gamma ) < a angleCongj = + pi - 2 * gamma; elseif abs( beta - pi -...
% created by JN Kather and CA Weis 2015-2016 % jakob.kather@nct-heidelberg.de % license: MIT license, see separate file for license and disclaimer % % parts of the code are based on the following publication % Kather, JN et al. Continuous representation of tumor microvessel % density and detection of angiogenic hotspo...
%Anchor 1 coordinates anchor1 = [0,2]; %Anchor 2 coordinates anchor2 = [4,0]; %Anchor 3 coordinates anchor3 = [8,0]; %Anchor 4 coordinates anchor4 = [12,2]; %Mobile coordinate mobile1 = [2,6]; anchors = [anchor1;anchor2;anchor3;anchor4]; nodes = [anchors;mobile1]; clf('reset') plot(nodes(:,1),nodes(:,2),'*') xlab...
% 4_8 转化为极坐标下的图像 % 4-13 直接的从(x0,y0)竖直向下 逆时针旋转为对应的 theta角度 function polarv = pupil_to_polar_coordinate(pic, x0, y0, Rmax) % 定义内圆 pupil极坐标图像大小 与 相位间距(分360份) np = 360; dp = pi / 180; [pic_xsize, pic_ysize] = size(pic); polarv = zeros(np, Rmax); pic = double(pic); for i = 0 : np - 1 for j = 1 : Rmax theta = ...