text
stringlengths
8
6.12M
ptDir='MG49'; sessionNum=3; for ch=1:96 for cellNum=1:4 for wakeBool=0:1 if(wakeBool) stateName='Wake'; timeLimits=[0 10000]; else stateName='Sleep'; timeLimits=[10000 16000]; end chStr=getChStr(ch); cellStr=[chStr num2letter(cellNum)]; try inputStruct.cellStr=cellStr; inp...
function obj = setType(obj, type) % Sets the joint type % % Parameters: % type: the joint type @type char valid_types = {'prismatic',... 'revolute',... 'continuous',... 'fixed'}; obj.Type = validatestring(type,valid_types); end
function best_variables = run_pso(zn, kn) %% each time optimize one anchor node tic clc %clear all close all rng default LB=[0 0 0 0 0 0 0 0 0 0 0 0]; %lower bounds of variables UB=[100 100 100 100 100 100 100 100 100 100 100 100]; %upper bounds of variables % pso parameters values m=12;...
Lb=[4000:64000]; n=ceil((1-0.000005).^(-8*(Lb+8+(Lb+20)/(1500-20)*28))); h1 =plot(Lb,n,'-b'); hold on; n2=ceil((1-0.000005).^(-8*(Lb+8+(Lb+20)/(1500-20)*28)))+2; h2 =plot(Lb,n2,'-k'); hold on; n3=ceil((1-0.000005).^(-8*(Lb+8+(Lb+20)/(1500-20)*28)))+3; h3 =plot(Lb,n3,'-g'); hold on; %第一组实验数据 C1_16K =[2,2,2,2,2,2,3,2...
function [M_c, R_c, P_c, d_S, rho_mantle] = fn_get_C_m_implications(... rho_silicate, rho_sulfide, m_frac_sulfide, dispersed, C_m) if length(rho_silicate) == 1 rho_silicate = rho_silicate * ones(size(m_frac_sulfide)); end if length(rho_sulfide) == 1 rho_sulfide = rho_sulfide * ones(size(...
function [out] = Proj2_Ice_Dream_Team14_Func2(cd,isCorr,V) %% Constants cdw = cd; cda = cd; cdpw = 0.0035; cdpa = 0.0022; P_max = 74569987158/1e3; p_ice = 917; %% Initial Iceberg Conditions path = 4; [lats,lons,v_air,v_wat,Tw,mode] = GetPath(path); % mode = 1 --> tow to next point % = 2 --> ride current/ now towi...
function [y,Fs] = getaudio(filename,range,channel) %GETAUDIO Summary of this function goes here % Detailed explanation goes here % Parse input arguments: if nargin > 0 filename = convertStringsToChars(filename); end if nargin > 1 range = convertStringsToChars(range); end if nargin > 2 channel = convert...
function img_ = norm_img(img) minz = min(min(img)); maxz = max(max(img)); img_ = uint8(double(img - minz) ./ double(maxz - minz) * 255);
function a4_test_all dir_images= '.\tracking_output\video_frames\'; dir_output= '.\tracking_output\particles\'; wait = 0.01; % skip time files=dir(strcat(dir_output,'a_*.dat')); n_files = length(files); idx = 1; idxs=[]; data=[]; for i=1:n_files file = load(strcat(dir_output,files(i).name)); idxs = [...
%% Plot the probability density function of disparities %% %% Input: %% NO.1 para. = the index of figure %% NO.2 para. = the dataset of disparities %% NO.3 para. = the probability density function %% NO.4 para. = the boundary %% NO.5 para. = the activation for showing title (0=false, 1=true) function plot_pdf(inde...
% Part B load("problem2"); maxiter = 100; p = randperm(1000); x_train = dataset(p(1:500),:); x_test = dataset(p(501:1000),:); train = []; test = []; for i=1:5 [ltrain,ltest,alpha,mix]=EM(x_train, x_test, i, maxiter); n = size(ltrain', 1); % figure(i) % subplot(1,2,1); % plot(1:n,ltrain'); % ti...
% Benjamin Shih % 16868f13 Muscle and Neural Control % 1a Hill-Type Contractile Element Fisomax = 6000; % N lopt = 8e-2; % m w = 0.56*lopt; % m vmax = 12*lopt; % m/s Necc = 1.5; % dimensionless % Velocity of the contractile element [m/s] vce = linspace(-vmax, vmax, 100); % Length of the contractile element [m] lce = ...
classdef TrainMapTest < matlab.unittest.TestCase % Copyright 2014 - 2016 The MathWorks, Inc. methods ( Test ) function train(testCase) % Create data dim = 2; N=20000; N_test = N/5; data = randn(dim+1,N); target = [data(1,:);data(2,...
X z = X(:,1); q = zeros(0,2); for i = 1:size(z,1) q(1,:) = fcn_inv([0;z(i)],l1,l2); end
function pop = order( pop) %UNTITLED10 Summary of this function goes here % Detailed explanation goes here h=size(pop); population=h(2); for i = 1:population en_cour=pop(i); MIn=en_cour.erreur; for j = i:population if pop(j).erreur<=MIn pop(i)=pop(j);pop(j)=en_cour; en_cour=pop(i)...
conf = dsp2.config.load(); io = dsp2.io.get_dsp_h5(); signal_path = conf.PATHS.signals; signal_path = fullfile( signal_path, 'transfer', '081617' ); mats = dsp2.util.general.dirstruct( signal_path, '.mat' ); mats = { mats(:).name }; pathstr = 'Signals/none/wideband/targon'; io.require_group( pathstr ); current_day...
function [solution] = cournot_game(P, b, N, mc, qbar, k) % A COURNOT GAME SOLVER % USAGE :cournot_game(P, b, N, mc, qbar, k) % Demand Function : Price = P - b*Quantity % P : Intercept % b : Slope % N : Number of firms % mc : Marginal cost for each sub-level units % qbar : Production Constraints of each...
clear; % Population y0 rabbits = 100; foxes = 30; wolves = 20; init = containers.Map({'r', 'f', 'w'}, {rabbits, foxes, wolves}); y0 = [rabbits foxes wolves]; options = odeset('RelTol', 1e-5); steps = 0:0.01:100; [t, y] = ode45(@(t,y) predPrey(t, y, init), steps,y0,options); r = y(:,1); f = y(:,2); w = y(:,3); figu...
function ROI_struct = PMOD_VOI_reader_match_image(filename, handles);%, zV, x1, y1, z1, x2, y2, z2) % only support PMOD VOI on static images % only support ROI drawn on axial slices % does support multiple contours on the same slice h = msgbox('Reading the PMOD VOI file. Please wait...'); zV = -fliplr(handles.zV...
% function plot_gauss(M,C) % % Plot a contour of a Gaussian PDF % % Parameters are: % M - the mean % C - the covariance function plot_gauss(M,C) [V,L] = eig(C); % eigen-decomposition of cov matrix C = V L V' , L is diagonal l = diag(L); % select diagonal phi = acos(V(1,1)); % angle of fi...
function dydt = cr3bpse(t,y) % non-dimentional circular restricted 3-body problem for Sun-Earth. % y(1) = xp, y(2) = yp, y(3) = zp, % y(4) = xv, y(5) = yv, y(6) = zv xp = y(1); yp = y(2); zp = y(3); xv = y(4); yv = y(5); zv = y(6); muSE = 3.036e-6; x1 = -muSE; x2 = 1-muSE; ...
function structplot2(searchString,x,y,Param) % if(~ishold) washeld = false; figure1 = figure; axes1 = axes('Parent',figure1); %axes1 = axes; box(axes1,'on'); hold(axes1,'all'); xlabel(x); ylabel(y); legend(); title(strrep(searchString,'_',' ')); else washeld = true; end St...
function [ ] = Bounds( ) n = 1:100; %Bounds markov = 2/5 ; chebyshev = 16./(9.*n); hoeffeding = 2*exp(-n.*(9/50)); %True Binomial Probability binProb = 1 - binocdf(floor(0.5.*n-0.5), n, 0.2); plot(n, markov,'-', n, chebyshev,'r--', n, hoeffeding, 'b:', n, binProb, 'g-'); xlabel('n'); ylabel('Proba...
clc; clear; addpath('./data') load CMUsubject16_TRAIN_X load CMUsubject16_TRAIN_Y load CMUsubject16_TEST_X load CMUsubject16_TEST_Y load CMUsubject16_inverse; load CMUsubject16_means; TRAIN_X=CMUsubject16_TRAIN_X;%TRAIN_X是训练集样本 TRAIN_Y=CMUsubject16_TRAIN_Y;%TRAIN_Y是训练集标签 TEST_X=CMUsubject16_TEST_X;%TEST_X是测试集样本 TEST_Y...
%BFGS method f =@(x1,x2)3*(sin(0.5+0.5*x1))*cos(x2); ezcontour(f,[0,20],[0,5]) hold on %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% x=[1.75;0.5]; %starting point tol=0.0001; dx=0.01; a=1.61803; b=0.0005; f = @(x) 3*(sin(0.5+0.5*x(1)))*cos(x(2)); n=1;%starting iteration SIZE=size(x); H=eye(SIZE(1));%H...
function q = box_frame(char,Q) qK = [0,0,0,1]; switch char case 'a' th1 = 0.0283; qv1 = [0,0.5121,-0.8589,0]; % imu frame th2 = -0.0277; case 'b' th1 = 0.0871; alfa = -0.3005; qv1 = [0,cos(alfa),sin(alfa),0]; th2 = -...
function [c1,c2,c2b] = Divided_Differences(N0, N5, M0, M5, x, y, Q,... Index, Order) c1 = zeros(N5,M5,Order-1); c2 = zeros(N5,M5,Order-1); c2b = zeros(N5,M5,Order-1); c = zeros(1,Order+1); % Divided differences in the x direction for j = M0:M5-Order for i = N0:N5-Order xa = x(i:i+Order); ...
eps0=8.85418782e-12; % F/m mu0=1.2566370614e-6; % H/m c0=1/sqrt(eps0*mu0); numFrequency = 5e3; frequency = linspace(0.69,3,numFrequency)*1e9;%*exp(1)/2.7; numError = 1e3; error = linspace(1e-6,1e-3,numError)*pi/3; k0 = 2*pi*frequency/c0; device_length = 0.05; %in meters normally 50cm material_width = 0.01; % in meters ...
function [ x,varargin] = gen_babble_speech(M,d,t,varargin ) %-------------------------------------------------------------------------- % % Example that generates babble speech received by a uniform linear array % of sensors. % % Author : E.A.P. Habets % Date : 29-06-2017 % % Related paper : E.A.P. Habe...
%Creates mat files for test of RHD data with old scripts from LPNC %Adrielle de Carvalho Santana %Rodar com passivo.rhd %22/05/2019 clear all %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% load('idx_passive.mat') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% num=sort(abs(unique(idx))); read_Intan_RHD2000_file2('passivo_190529_110950.rhd') amplifi...
function y = ustep(n) y = ones(n); endfunction
for ii = 1:10 fname = sprintf('hidstates3rd_10_WB_(24f40f288f6ws9ws9ws)_%d',ii); f1=load(sprintf('%s.mat', fname)); temp = double([f1.hidstate;]); temp = permute(temp,[3,2,1]); xtr(ii,:) = temp(:)'; % f1=load([CIFAR_DIR '/filter8_ws12.mat']); end fname = sprintf('hidstates3rd_10_WB_(24f40f288f6ws9ws9ws)'); save(spri...
function value = CS4300_conversion(y_value) if(y_value == 1) value = 4; end if(y_value == 2) value = 3; end if(y_value == 3) value = 2; end if(y_value == 4) value = 1; end if(y_value == -1) value = -1; end
function results=run_FCN1(seq, res_path, bSaveImage) addpath('utilities/'); addpath('/home/vis/zhangzhe/caffe-future/matlab/caffe'); caffePath = '/home/vis/zhangzhe/caffe-future/'; input_size = [224,224]; duration = 0; rects = zeros(seq.len,4); for imgNum = 1:seq.len tic; imgName = seq.s_frames{imgNum}; im...
% % (C)lassical (R)unge-(K)utta (4)-th order method % -> progressing in the REAL space % % solves U_t=f(U,t), U(to)=Uo % % IN: u :: initial solution (A,B)' % s :: structure that contains system coefficients % n :: number of points on x-grid % h :: time step % t_end :: time is assumed to very in ...
xs= [54, 59, 66, 71, 71, 76, 79, 73, 69, 69, 56]; ys= [68, 55, 56, 60, 66, 71, 80, 75, 68, 60, 55]; plot(xs, ys) dis= 0; for i= 2: 1: length(xs) dis= dis+ sqrt( ( xs(i)-xs(i-1) )^2+ ( ys(i)-ys(i-1) )^2 ) end speed= dis/ (4* length(xs) )
% runToAnalyse.m % In vitro data analysis. GFP % -------------------------------- % % limitsROI = [250 500 250 500]; % limitsYzoom = [-2000 6000]; % params.SNR_min = 2; % params.rsq_min = 0.2; % r554 = analyseFixedBrightSpots('554',15,100,''); % % for params.x_limit_spectr = 2000; % % r556 = analyseFixedBrightSpot...
function EDB2editpathlist(edpathsfile,useedges,symmetricedges,pathstokeep) % EDB2editpathlist - Does some semi-automatic editing of an edpathsfile. % A vector, 'multfactors' is introduced, which will boost or % keep or switch off paths in the list of paths. % % Input parameters: % edpathsfile An edpaths file that...
function [root] = secant(func, x0, x1) % func: target function % x0, x1: interval % root: output root0 root = 0; i = 1; while i>=1 root = x1 - (func(x1) * (x1-x0) / (func(x1)-func(x0))); if abs(root-x1)/abs(root) > 1e-5, i = i+1; else, break; end x0 = x1; x1 = root; end end ...
function [roiShapes indices] = FRAPMeasure(theImages, imageId, imageName, roiShapes, datasetName, pixels) %Author Michael Porter % Copyright (C) 2009-2014 University of Dundee. % All rights reserved. % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Publi...
% function y = enc_prac(im)clc clc clear im = double((imread('/Users/INNOCENTBOY/Documents/MATLAB/pic/4.2.06.tiff'))); R = im(:,:,1); G = im(:,:,2); B = im(:,:,3); % im = mat_rev_diffussion4(im); [row,col,dim]=size(R); tic Mu = 3.99; xlog1= 20.1; ylog1= 22; zlog1= 19; k_5 = 34; k_6 = 40; k_7 = 36; pix = 0.1; N = numel...
function labels_struct = segmentation_pairwisePotts_oracle(param, model, X, Y) %segmentation_pairwisePotts_oracle does the loss-augmented decoding on a given example (X, Y) using model.w as parameter % % The model consist of the unary potentials for label 1 (the potential for label 0 is its negation) and Potts pairwise...
%> @brief Evaluate the post function %> The post-function function fphys = matEvaluatePostFunc( obj, fphys ) end
function [ bool ] = Present( i , j , IMG ) if(i>=1 && i<=size(IMG,1) && j>=1 && j<=size(IMG,2)) bool = true; else bool = false; end
ANPV=diag(Area)*NPV; vht=diag(Area)*Vol; for i=1:889 for j=1:15 f(1, j+15*(i-1))=ANPV(i,j); end end A=zeros(15,13335); for i=1:14 for j=1:889 A(i, 15*(j-1)+i)=0.5*vht(j,i); A(i+14, 15*(j-1)+i)=-1.5*vht(j,i); end end Aeq=zeros(889,13335); for i=1:889 for j=1:15 ...
function raw_data=fermi_filter_isodim2_memfix(raw_data,w1,w2) % ------------------------------------------------------------------------- % kspace_filter(iraw) generates the 3D filtered kspace image. Only filter % function is a fermi window. The input complex kspace dataset is % multiplied by the 3D fermi window. % % ...
clc; clear all; close all; %#ok %% load K.mat K; h = [10*.3048 10*.3048 2*.3048]; layer = 76; % 75 76 80 85 Kn = K(:,:,layer); %myPlot(log10(Kn),'b'); test = 0; uGrid = upsGrid(Kn,h,2,2,test); save uGrid.mat uGrid; K = uGrid.K; %myPlot(log10(K),'b'); pureNeum = 1; makeFineData(K,h,pureNeum); % save fineData...
%uArena{1}.agents{1}.plotVelocityComponents(); %uArena{1}.agents{1}.plotGlobalAttraction(uArena{1}.p_axe_lim(1):0.3:uArena{1}.p_axe_lim(2),uArena{1}.p_axe_lim(3):0.3:uArena{1}.p_axe_lim(4),uArena{1}.c_fun(0)); for j=1:length(names) % Create movie/frames visObj = visualArena(uArena{j}); % Figure...
function [diffVal, daeVal, barVal]=macd(price, long, short,compare) %% if ~exist('long', 'var') || isempty(long), long = 26; end if ~exist('short', 'var') || isempty(short), short = 12; end if ~exist('compare', 'var') || isempty(compare), compare = 9; end %% % 计算短期和长期指数平滑 ema_short = ind.ma(price,short,'e'); ema_lon...
function p = getCurveFitEffComp(SAECompMap); %% xData = [SAECompMap.PR SAECompMap.m_dot]; yData = SAECompMap.eff; [p, resnorm] = lsqcurvefit(@myFun,p0,p,xData,yData); function F = myFun(p,xData) x1 = xData(:,1); x2 = xData(:,2); F = x(1) + x2.*(p(2) + x2.*(p( 3) + x2.*(p( 4) + x2.*(p( 5) + x2.*p( 6))))) + ... ...
function movie(Y) %Set-up drawing at initial conditions cube_side = .5; z_cmd = 5; %Set-up movie nframe=max(size(Y)); mov(1:nframe)=struct('cdata',[],'colormap',[]); set(figure,'Color','white') set(gca,'nextplot','replacechildren') % Set the edges of the cube x=[0 1 1 0 0 0;1 1 0 0 1 1;1 1 0 0 1 1;0 1 1 0 0 0]*cube_...
function u = F(p, gamma, zeta) %F Summary of this function goes here % Detailed explanation goes here if (gamma - p) >= 1 u = 0; else u = zeta .* (1-gamma+p).*sqrt(abs(gamma-p)).*sign(gamma-p); end end
function [HRV_measures]= HRV_Calculation (IBIsec, fs) %% original made by Tara Chand % To calculate HRV measures % % VLF=[0.0 0.04]; LF =[0.05 0.15]; HF=[0.15 .5]; % The range low and high frequency if length(IBIsec)>=2 % HR hr=60./(IBIsec); meanHR=nanmean(hr); %% time domains sdHR=...
%#codegen function val = Serial_read( ) val=char(' '); val =coder.ceval('Serial.read'); end
close all set(0,'DefaultLineLineWidth',2) set(0,'DefaultAxesFontSize',14); %Specify the directory cd('/Users/') filenames = {'068 establishments.xls','071 income (England).xls','072 income (England).xls',... '106a income (Saxony).xls','106b income (Saxony).xls','123 income (Prussia).xls',... '124 income (Old...
close all; clear all; clc vm=0:0.1:10; lm=1; k=1; w=1; delta=0.5; sigmam=delta/2; lambdam=((lm)^2)/sigmam; %part 1 l=2.*(1/sqrt(k)).*(k.*vm-1); m=(-2).*(1/sqrt(k)).*(k.*vm+1); n=exp(8*vm); z1 = normcdf(l); z2 = normcdf(m); F1 = z1 + n.*z2; k1=k-1; l1=2.*(1/sqrt(k1)).*(k1.*vm-1); m1=(-2).*(1/sqrt(k1)).*(k1.*vm+1);...
function [ fv ] = hello( a,i ) a = imresize(a, [10 10]); eno=eulerno(a) eno(1).EulerNumber(1); MM=feature_vec(a) pro=projection(a) fv=[eno(1).EulerNumber(1) MM(1) MM(2) MM(3) MM(4) MM(5) MM(6) MM(7) pro(1) pro(2) pro(3) pro(4) pro(5) pro(6) pro(7) pro(8) pro(9) pro(10) pro(11) pro(12) pro(13) pro(14) pro(15) pro(16)...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Schallanalyse mit FFT %%% %%% Copyright Gentian Rrafshi %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Fs = 1e9; L = 10000; % Length of signal t = 0:...
%%随机生成无线传感网络分布。 load TestData.mat X %X=X(:,5:10); [~,N]=size(X); for i=1:1:N for j=1:1:N % 节点j到节点i的距离 if i~=j Distance(i,j)=((X(2,j)-X(2,i))^2+(X(1,j)-X(1,i))^2)^0.5; else Distance(i,j)=0; end end end tic; CH1=1; CH2=2; CH3=3; CH4=4; Existed(1,:)...
%% Direction Measurement (Magnetic Field) %% Description % 피가 흐르는 방향으로 센서를 이동시킬 때 혈류 속도와 센서의 이동속도간의 % 상대속도를 계산. 상대속도(v_r)에 따른 Rate Change Of MagneticField를 구한다. dsdfsdf %% Parameter setting clear all clc N_p = 30; % number of particle d_int = 1e-4; % interparticle spacing N = 1; % Number of positive point charge con...
%Prob. 11(a) w = linspace(-3*pi, 3*pi, 61); Fs1 = 1000; 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 - 200*pi == 0 X1(N)= X1(N) + 1/T1*5/2*(sqrt(3)/2 + i*1/2); elseif (W-2*pi*k)/T1 + 200*pi == 0 ...
function [AnimationTextures, frameToTrialMatrix] = AnimateFixationCross(AnimationTextures, crossTexture, frameToTrialMatrix, trial, duration, ifi) % AnimateVisualNoise takes noise textures and concatenates them onto an existing AnimationTexture (1D matrix containing textures). Duration can be a single value or bielemen...
function [a1, ax, ay, w] = est_tps(ctr_pts, target_value) % Estimate Thin-Plate Spline (TPS) Parameters % Author: Brian Wright % % ctr_pts: N x 2 with corresponding points in second image % target_value: N x 1 representing point position x or y in first image % a1: TPS parameter (double) % ax: TPS parameter (double) % ...
function plot_circle clear, clc, close; x = zeros(100, 1); y = zeros(100, 1); t = 0; for i=1:75 x(i) = 1 * cos(t); y(i) = 1 * sin(t); t = t + (0.0838); end figure, plot(x, y, '+') end
%% Times2ElapsedSecs.m % Author: Julianna Evans % Date: 07.31.17 % Last Revision: 07.31.17 % Converts time from the inputted STK datetime string to elapsed seconds % from the scenario starttime function [elapsedSecs] = Times2ElapsedSecs(SCNstarttime, BALLOONstarttime) %set timevectors using MATLAB's "datevec" functi...
function [points0, points1, points2] = ... Triangles(pionG, pionD, pozL, pozP, t) % komentarze % Autor: Maciej Chlebny % Funkcja zwraca wektory z punktami dla 2n^2 trójkątów % Parametry wejściowe: % pionG, pionD - odpowiednio górna i dolna granica przedziału na "y" % pozL, pozP - odpowiednio lewa i prawa g...
% plot data [~, uniqueInd] = unique(t_rmse); ax = []; ratioRMSE_plotUnique = ratioRMSE_plot(uniqueInd, :); lengthArray = length(t_rmse); % com = sqrt(sum(feature_all.com.^2)); com = feature_all.com; upperBound = 4; if size(ratioRMSE_plot, 2) < upperBound upperBound = size(ratioRMSE_plot, 2); end h5_1 = figure; f...
close all; % clear all; clc; %% Data Import global z global N global dt global u global angPos global gyro_angVel global t measurement_number = input('Which measurement do you want to import?'); filename = strcat('../Measurements/measurement_',num2str(measurement_number),'.csv'); display(filename, 'Opened File'); M...
function [W_new11] = cunchuW(num1) W_new11=zeros(64,2,4,384); for i=1:4 for j=1:384 W_new11(:,:,i,j)=num1((i-1)*64+1:i*64,(j-1)*2+1:j*2); end end end
function generate_Multimedia(frames, varargin) % ------------------------------------------------------------- % generating dynamic multimedia files required, % including *.gif and *.mp4 formatting % ------------------------------------------------------------- % frames -> pic frames got from a cert...
function [ output_args ] = high_low( rankingData,outputData,cutoffRate ) %High-Low: [ output_args ] = high_low( rankingData,outputData,cutoffRate ) %Data input has to be single column, otherwise, would get wrong output. % vector wise is more convenient than matrix wise %get rid of NaN in ranking factor % nansum of out...
function [x,y,width,height] = enlarge_rectangle(x,y,w,h,factor) %UNTITLED Summary of this function goes here % Detailed explanation goes here x = x - factor*w; y = y - factor*h; width = w + 2*factor*w; height = h + 2*factor*h; end
classdef AbelianBlock < MatrixBlock %ABELIANBLOCK Summary of this class goes here % Detailed explanation goes here methods function Y = axpby(a, X, b, Y, p, map) %% Special cases % only overload general case, other cases are unchanged. if a == 0 || ......
close all; clear all; clc; a=1; b=0; w=pi/5; p=0; init_x_p=-9.9; init_x_p_dot=1; simtime=10.0; sim 'abg_x_p1.slx' %plotting figure(1) subplot(3,1,1) plot(sim_abg_x_p.time, sim_abg_x_p.signals.values) subplot(3,1,2) plot(sim_abg_x_p_dot.time, sim_abg_x_p_dot.signals.values) subplot(3,1,3) plot(sim_abg_x_p_dd...
function [varargout] = calc_SHG_spectrum(E_om,crystal_length,crystal_theta) % This code calculates SHG/SFG spectrum (field magnitude and phase vs omega OR intensity vs wavelength) % for type I phasematching if fundamental excitation (field magnitude and phase vs. omega) is known. % Pump depletion is not included. %...
%% Stelling 18 % % De output van een commando kan, na het uitvoeren % ervan, te zien zijn in het Command Window. % Antwoord = 1;
function [LSsig, DIRsig, DIFFsig, DirAC_struct] = DirAC_run_stft(insig, DirAC_struct) %% Run-time processing of 2D or 3D virtual-microphone STFT DirAC %% for loudspeaker output %% Archontis Politis and Ville Pulkki 2016 lInsig = size(insig,1); % signal length nInChan = size(insig,2); % normally 4 for B-format ...
%% csd_odas % Estimate the cross- and auto-spectrum of one or two vectors. %% % <latex>\index{Functions!csd\_odas}</latex> % %%% Syntax % [Cxy, F, Cxx, Cyy] = csd_odas(x, y, nFFT, rate, window, overlap, msg) % % * [x] Vector over which to estimate the cross-spectrum. % * [y] Vector over which to estimate the cross-sp...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % DeepSqueak 2.7.0 % % Copyright (c) 2021 Kevin Coffey , Ruby Marx, & Robert Ciszek % % % % Licensed under th...
close all; %% 读取两帧pcd文件,或读取txt文件 % 然后根据IMU数据显示配准结果,或手动调整配准参数,显示配准结果 %Method 1 读取pcd文件 UR=rotz(0); TR=[0.1 0.05 0.0]; pcd1=pcread('/home/yaoshw/Downloads/tofpcdt3/1585031800.627109274.pcd'); pcd1=pcd1.Location; pcd1=pcd1+TR; pcd2=pcread('/home/yaoshw/Downloads/tofpcdt3/1585031802.667761645.pcd'); pcd2=pcd2.Location; pc...
function [control, r_err, i_err, px_err, py_err] = wiggle_test(winsize, angle, radius, epsi); %winsize = 10000; %angle = 0; %radius = 0; %epsi = 0.0000001; % generate complex single-pole modal signal [x, y] = pol2cart(angle, radius); lambda = x+y*1i; [vec, r] = modesynth_single_norand(winsize, lambda); % control...
clear; close all folder = 'C:\Users\Orpheus\Desktop\DataFiles\DataFiles'; % Plot Body Temperature BT = get_data(folder, 'BT'); figure(1) plot_data(BT) ylim([96 100]) title('Body Temperature') xlabel('Time (s)') ylabel('Temperature (F)') % Plot Blood Pressure Diastolic BP = get_data(folder, 'BP'); BPD ...
function B = generateBox(s) B = zeros(s,s,s); p = 0.5; i_1 = 1 + ceil(s*(1-p)/2); i_2 = s - ceil(s*(1-p)/2); range = i_1:i_2; B(range, range, range) = 1; end
%% Script para teste dos classificadores Bayesianos % Estimativa de parametros baseada em maxima verossimilhança %% Limpa variáveis clc; clear; %% Carrega base de dados % TODO - automatizar a separação das views rgb_view_Path = '../Data Base Image Segmentation/RGB_view_order.csv'; shape_view_Path = '../Data Base Imag...
%Set data paths global chardata; addpath('Data_path', '-begin'); addpath('..', '-begin'); disp('Initilation of data'); load('character_recognize.mat'); %add library for process_frame(); disp('Load DIPlib 2.7'); run('C:\Program Files\DIPimage 2.7\dipstart.m'); disp('DIPlib 2.7 Loaded successfully ');
% This matlab script plots the dielectric constant field and the Poynting % vector field for electromagnetic-wave simulations by the maxwell2d % program. To run this script you need the matlab netcdf toolbox to be % installed. % Do we print figures immediately? is_print = 1; visible = 'on'; % Get a list of the netcdf...
function [header]=getHeader(IQ_File,groupNames,chanNames,refYN) clear header; header=cell(14,2); for z=1:3 header{z,1}=IQ_File.Data.Root.Property(z).Name; header{z,2}=IQ_File.Data.Root.Property(z).Value{1}; end header(4,:)={'Date/Time',IQ_File.Data.Root.Property(4).Value}; for z=5:10 header{z,1}=IQ_File.Da...
cfg=[]; cfg.channel='all'; cfg.elecfile='standard_waveguard64.elc'; % The electrodes are read prior to using this in the structure cfg.headmodel=Standard2; cfg.inwardshift=20; %how much should the innermost surface be moved inward to constrain %sources to be conside...
function img_sum = RT_CylArray(image_F,angle, n,Nt) % implement the adjoint operator of tomographic photography % angle is the array specifying the angle in degrees of integration in each lenslet % line_image:(N_angle,n); % image_F: a vector of [n*N_angle*Nt(Nt),1] % image_t: [n,n,Nt] GPU_A...
function figuretool0(functionlist) global camparam imgbound cellbound usedlist bondlist; imgbound=[Inf,Inf,Inf,-Inf,-Inf,-Inf]; cellbound=[Inf,Inf,Inf,-Inf,-Inf,-Inf]; usedlist=[]; bondlist=[]; fcnnames=cellfun(@(x)x.function,functionlist,'UniformOutput',0); if ~ismember('drawraMO',fcnnames) for j=1:numel(fcn...
clc; clear all; % some testing of modulated signal generation... fs = 10000; N = 5000; f0 = 50; fm = 5; A0 = 1; Am = 0.2; phm = 10/180*pi; u = mod_synth(fs,N,0, f0,A0,0, fm,Am,phm, 'sine', [1 1.5 0.5],[0.1 0.2 -0.3]*pi); plot(u);
function inv = inversa(A) N = length(A); Af = Factorizacion(A); inv = zeros(N,N); for k = 1: N b = zeros(N,1); b(k) = 1; y = sustitucion_hacia_adelante(Af, b); x = sustitucion_hacia_atras(Af, y); inv(:,k) = x; end; end
% Lab6 Decision trees % VV ML_T2018 load data_ionosphere % Contains X and XLabels variables N_classes = 2; N_samp = length(XLabels); % training, validation and test indices rng(1); % for reproducibility P_train=0.6; P_val=0.2; P_test=1-P_train-P_val; Index_train=[]; Index_val=[]; Index_test=[]; for...
size = 100000; rate = zeros(10,11); x = 0:10; for n = 1:11 x(1,n) = x(1,n)/10; end for m = 1:10 for n = 1:11 [Ha, Sa, Hb, Sb, Ce, He, Se, qubits, rate(m,n)] = BB84(size, (n-1)/10); end end p = plot(x,mean(rate)); xlabel('Eve attack rate'); ylabel('correct rate'); p.Marker = '*';
function s = sumapi(m) % Funció convergència a pi x = 0; for n = 0:m x = x + ((-1/3)^n)/(2*n+1); end s = sqrt(12)*x; end
function [Xc CXc]=imancon(C,X) % Rank correlated sampling using Gaussian copula % % Input: % C : correlation matrix of the variables (nvar,nvar) % X : uncorrelated samples % Output: % Xc : LHS sampling with corretion control (nsample,nvar)(units % CX: Correlatoin matrix of rank-sorted samples Xcf. % ...
% makeP1Fig2.m % Make Fig. 2 of Post 1 % REA 2011-05-28 %% make Figure xray_energies = 10:0.2:10000; % keV mus = []; % will hold mu data for xray_energies along rows and for all elements in material along columns %plot the results fh = figure; dat = BodyMaterialCompositionFunc; % composition of body materials [...
function spincomp(pdefun, tspan, u0, pref) %SPINCOMP Compare time-stepping schemes. % SPINCOMP(PDECHAR, TSPAN, U0, PREF) solves the PDE specified by the STRING % PDECHAR on TSPAN x U0.DOMAIN, with initial condition U0, using the various % time-steps DT stored in PREF.DT and the timestepping schemes listed in % ...
%{ -> acquisition.Session photostim_datetime: datetime # the time of performing this stimulation with respect to start time of the session, in the scenario of multiple stimulations per session --- -> stimulation.PhotoStimulationInfo photostim_timeseries=null: longblob # (mW) photostim_start_time=null: float # (s) ...
function varargout = gui05(varargin) % GUI05 MATLAB code for gui05.fig % GUI05, by itself, creates a new GUI05 or raises the existing % singleton*. % % H = GUI05 returns the handle to a new GUI05 or the handle to % the existing singleton*. % % GUI05('CALLBACK',hObject,eventData,handles,...) cal...