text
stringlengths
8
6.12M
function [ y ] = DelaySumBeamform( X, T, W ) %DELAYSUMBEAMFORM Calculate the weighted sum of delayed sensor signals % Inputs: % X - m x n matrix of m signals whose length is n % T - m length array of delays corresponding to the channels in X % W - m length array of weights corresponding to the channels in X % Ou...
function A = KLDE(X, labels, K, k1, t1, k2, t2, d) [W1, W2] = LDECompute(X, labels, k1, t1, k2, t2); D1 = spdiags(sum(W1, 2),0,speye(size(W1,1))); D2 = spdiags(sum(W2, 2),0,speye(size(W2,1))); tmp = K * (D1 - W1) * K; if ~isempty(find(sum(abs(tmp)) == 0)) tmp = tmp + 10^(-8) * eye(size(tmp)); end [A, D] = eigs(...
%close all clear all for shuffle=1; % Shuffle for the requirements of HW 4. 1 is 0 is ordered, 1 is shuffle on epoch, and 2 is randomize once. tic neurons=[3,3,3,4]; % This is your neural structure first layer is input neurons, %last number is output neurons, and there can be 1-3 inner layers. Any %number of ...
dialect = mavlinkdialect("common.xml"); gcsNode = mavlinkio(dialect); gcsPort = 14540; connect(gcsNode,"UDP", 'LocalPort', gcsPort); uavClient = mavlinkclient(gcsNode,1,1); paramValueSub = mavlinksub(gcsNode,uavClient,'PARAM_VALUE','BufferSize',10,'NewMessageFcn', @(~,msg)disp(msg.Payload)); Atti_1 = mavlinksub(gcsNo...
%{ # Patching traces ->psp.Exp ->psp.Probes trial : int # trial number --- trace : mediumblob # trace std : float # standard deviation of trace mean : float # mean of trace seal_res ...
%% This is a script for running adaptive PPD on real data sets % The data used here are observations of the supernova remnant 3C391 using the VLA % For more details please refer to following VLA tutorial % https://casaguides.nrao.edu/index.php/VLA_Continuum_Tutorial_3C391-CASA5.0.0 %% clear; clc ; close all try ...
function filestruct = MakeFileStruct(folder,airfile,mutfile,mut180,width,powers) filestruct.airfile = fullfile(folder,airfile); filestruct.mutfile = fullfile(folder,mutfile); filestruct.mut180 = fullfile(folder,mut180); filestruct.width = width; filestruct.powers = powers; end
%% Spin Echo with kspace traversal from top to bottom % Author - Sairam Geethanath % Date - 21/01/2017 %% Path preferences % cd('C:\Users\arush\Desktop\MR_INDIA_CODE\pulseq-master_All\matlab'); % addpath(genpath('.')); cd('C:\Users\arush\Desktop\PSD_CODE\MATLAB'); addpath(genpath('.')); sname = 'PRESS_MIRC.se...
function [ hmw ] = halfmaxwidth( sig ) %halfmaxwidth finds the half mas width of the signal. It assumes that the %baseline is zero. % [ hmw ] = halfmaxwidth( sig ) % Find he value and index of the max value of the signal [maxval , maxind] = max(sig); halfmax = maxval / 2; % Find the left arm point leftarm = find(s...
function [final] = identifyTails(x,y,g,flag) %identifyTails - find variables at the base of large peaks that are %artifacts. Try to remove them from the spectra % For each group (g) find the average spectrum. % For large peaks determine if it has peaks within a window of m/z|int % For plotting if nargin == 3 flag...
clear;clc;clf t=linspace(0,4*pi,10000); comet(t,sin(3*t)+cos(tan(t))) %繪出彗星軌跡圖,彗星尾巴拖的長度為p*length(y) %若p省略,預設為0.1 %動態方式呈現 xlabel('x-axis');ylabel('y-axis') text(7,1,'sin(3t)+cos(tan(t))','color','c') %在(7,1)上加入說明文字
%% Definitions clc;clear; path='c:\data2'; fileinfo = dir(fullfile(path,'*.au')); filesnumber=size(fileinfo); for i = 1 : filesnumber(1,1) [signal{i} fs{i}] = audioread(fullfile(path,fileinfo(i).name)); disp(['Loading Sound No : ' num2str(i) ]); end; win = 0.050; step = 0.050; fs2=fs{1}; fs3=44100; ...
clc; clear; close all; % INPUT f = @(x,y) (y-x-1)^2 + 2; y0 = 1; x0 = 0; h = .1; N = 1; % Main x = x0; y = y0; y_star = y0; error = 0; [x,y,y_star,error] = RKF(f,x,y,h,N); x y y_star error function [x,y,y_star,error] = RKF(f,x,y,h,N) format longg for n=1:N k1 = h*f(x(n),y(n)); k2 = h*f(x(...
function rescalingParams = computeRescalingParams(expParams, LI_stats) % @ Matt Golub, 2018. intuitive.pushingVectors = computeFactorPushingDirections(expParams.intuitiveMapping); perturbed.pushingVectors = computeFactorPushingDirections(expParams.perturbedMapping); intuitivePMs = columnNorms(intuitive.pushingVectors...
function err = simulationError(T,trial) X = xsmoothToFullState(trial); steps = 1:100:size(trial.fuse.xsmooth,2); err = zeros(size(X,1),length(steps)); i = 1; for t = steps(1:(end-1)) t_range = (1:100)+t; S = simulateK50Model(T,trial,t_range,1); err(:,i) = sum((X(:,t_range) - S.X).^2,2)./var(...
% 例3,RC电路,正弦信号通过低通滤波器的稳态响应 % 北京邮电大学,尹霄丽 % 2018年12月 syms R C w; ZR=R; ZC=1/(i*w*C); H=ZC/(ZR+ZC) R=2; C=1; H_w=subs(H); t=0:0.01:4*pi; e=sin(t)+sin(30*t); H_w1=subs(H_w,'w',1); H_w2=subs(H_w,'w',30); r=abs(H_w1)*sin(t+angle(H_w1))... +abs(H_w2)*sin(30*t+angle(H_w2)) subplot(2,1,1); hh=plot(t,e); set(hh,'linewidt...
% Function name: getVecToNextPoint % Function to get vector to the next point in the track % Input: % inputTrack: Object of cTrack class % indexCurrentPoint: Index of the current point % Output: % retVec: Calcutlated vector function [ retVec ] = getVecToNextPoint( inputTrack, i...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % reference paper: [kong18apply] Applying Lattice Reduction Technique to Space-Time Coded Multiplexing Systems % This program calls a generalized pairwise QR deomposition, that works together with pairwise ELR, and records the complexity of the procedure % % Written by: ...
%conpq does a least square fit of a conic through several points xyvals = input('[x(1) x(2 ...x(t);y(1) y(2)...y(t)]'); t = length(xyvals); M = zeros(2*t,6); x = xyvals(1,1:t); y = xyvals(2,1:t); for s = 1:t-1 u(s) = (x(s)+x(s+1))/2; v(s) = (y(s)+y(s+1))/2; M(s,:) = 2*[1 x(s) y(s) x(s)^2 x(s)*y(s) y(s)^2...
function [u,v] = pixel_to_cartesian(i,j,nrow,scalefac) u=j-1; v=scalefac*(nrow-i);
function set_colormap(a) % set_colormap - set colors for display % % set_colormap('jet'); % set_colormap('gray'); % set_colormap('hot'); % % Copyright (c) 2008 Gabriel Peyre if strcmp(a, 'jet') colormap jet(256); elseif strcmp(a, 'gray') colormap gray(256); elseif strcmp(a, 'hot') colormap hot(256);...
%Michael Evans %PHYS 432 %NH3 inversion energy levels function y = energylevel(jval, kval, fval) cval = (fval * (fval + 1)) - 2 - (jval * (jval + 1)); %calculates C %the following is the expression broken down into smaller bits numerator1 = 3 * kval * kval; denominator1 = jval * (jval + 1...
function [w,b,Ein,Eout]=rbf_bias(X,Y,Xout,Yout,K,XS,gamma) % %[w b Ein Eout] = rbf_bias(X,Y,Xout,Yout,K,SPACE,gamma) % %X,Y % input training data X, each x in row and corresponding y in each row of Y. % %Xout,Yout % similar as X,Y % %K % how many clusters are required %SPACE % the input space. [lower_limit uppe...
function filter = isObservable(compArray) filter = logical([compArray.obs]);
function [finalPic, histNew, histOld] = hist(image) maximum = max(image(:)); minimum = min(image(:)); range = maximum - minimum; histOld = zeros(256,1); histNew = zeros(256,1); for i = 1:length(image(:,1)) for j = 1 : length(image(1,:)) % disp(ima...
% save_3D_matrix_as_gif % --------------------- % Function that saves a 3D matrix in a gif image. % % input: % filename = the desired name of the output file % e.g.: 'C:\Users\John\Desktop\animation.gif' % or 'animation.gif' (saves in current folder) % matrix = the 3...
function f=hw3fun(x,a) % assignment 3; problem 4; f=(x.^a) .* tan(x); end
% RTO/RTE Oscilloscope example using SING command with STB polling synchronization % Make sure you have installed NI VISA 15.0 or newer % This example does not require MATLAB Instrument Control Toolbox % It is based on taking advantage of .NET assembly called Ivi.Visa % that is istalled together with NI VISA 15.0 or ne...
% Sarah's code to analyze the ephys experiments clear all; close all; %(in this code, you need to change lines 4 through 12 if necessary) outputcell = 'A0'; % I presume this is the channel that reads the cell's response file = 'example'; % rename file! hyperpolsweep = 1; pAincrease = 20;% pA increase per sweep! (in ...
% Reads an eyetribe file saved as a result of a tcpip recording... % % * Author: Ian Stevenson % * This work is licensed under a Creative Commons Attribution 4.0 % International License (https://creativecommons.org/licenses/by/4.0/). function F = readTETfile(fname) fid = fopen(fname); tline = fgetl(fid); F=[]; whi...
% Copyright (c) 2017, Amos Egel (KIT), Lorenzo Pattelli (LENS) % Giacomo Mazzamuto (LENS) % All rights reserved. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided that the following conditions are met: % % * Redistributions of source ...
stems=fix(Attacks/10); leaf=fix(rem(Attacks,10)); [stems, index]=sort(stems,'ascend'); leaf=leaf(index); [a,b]=hist(stems,unique(stems)); n=length(a); b(n); start = 0; fprintf('Attack points made by women volleyball player in FIVB 2020 (Preliminary Round)\n'); for ii=1:n fprintf('%2d | ',start); while b(ii) > s...
classdef TPA_MultiTrialDataManager % TPA_MultiTrialDataManager - Collects Behavioral and TwoPhoton info from all the relevant trials % Inputs: % BDA_XXX.mat, TPA_YYY.mat - data base % Outputs: % data for different graphs and searches %----------------------------- % Ver Date...
%% Analysis parameters %ps.path = './data/'; %ps.fname = 'cix22_04Feb2019.mat'; ps.baseInds = 1:1000; ps.respInds = 1000:2000; ps.dFBLWindowLen = 500; % Pre/post are ms before/after stimulus onset ps.dFWindow = [-1000,3000]; % Response period length ps.lickWindow = 1500; ps.hitRateLB = 0.3; ps.faRat...
load('trainparameters.mat'); load('../data/k_fold_partitions_data.mat'); %VARIABLE number of epoch MAX_EPOCH = 1000; % set of integer versions of our labels labels = 1:6; % Confusion matrix: "actual class" x "predicted class" CM = zeros(length(labels), length(labels)); success_count = 0; total_test_count = 0; foldCou...
%求向量X的熵,(概率为0时,它对熵的贡献为0) function H_X=Entroy(X) n=length(X); X_1=nnz(X);%向量X中含1的个数 X_0=n-X_1;%向量X中含0的个数 p_0=X_0/n;%向量X中0出现的概率 if p_0==0 I_0=0; else I_0=-p_0*log(p_0); end p_1=X_1/n;%向量X中1出现的概率 if p_1==0 I_1=0; else I_1=-p_1*log(p_1); end H_X=I_0+I_1;%向量X的熵H_X
function valor = my_trap(f,a,b,k) n = length(k); TT = []; ve = integral(f,a,b); for i = 1:n h = 1/(2^k(i)); x = a:h:b; y = f(x); w = [1 2*ones(1,length(y)-2) 1]; valor = sum(y.*w*(h/2)); TT = [TT; k(i), h, valor, abs(valor-ve), fix(-log10(2*abs(valor-ve)))]; ...
function [ H ] = Hest(p1, p2) p1 = p1./p1(3,:); p2 = p2./p2(3,:); K = []; for i = 1 : length(p1) K = [K; kron(p2(:,i)', CrossOp(p1(:,i)))]; end [U, S, V] = svd(K); H = V(:,end); H = reshape(H, [3,3]); X1 = p1; Mean1=mean(X1')'; X1(1,:)=X1(1,:)-Mean1(1); X1(2,:)=X1(2,:)-Mean1(2); S1=mean(sqrt(diag(X1'*X1)))/sq...
function [ BGobj ] = ConstructNetwork( outputBubbleCell ) % INPUT: outputBubbleCell from the results of MSER from each preprocessing % methods % OUTPUT: Biograph object % -- Mapping outputBubbleCell into Biograph object % - Count no of bubbles bubCounts = 0; numCell = size(outputBubbleCell); numCell = numCell(2); ...
%%Run This Before Starting Simulink c1=1.2801; % maximum value of friction curve c2=23.99; % friction curve shape c3=0.52; % friction curve difference between the maximum value and the value at lambda =1 c4=0.03; % wetness characteristic value (Lies b/w 0.02 and 0.04 s/m) m=342; %kg r=0.33; %m jw=1.1...
function varargout = boxplotGrowthParameters(datafile,statistic,varargin) % boxplotGrowthParameters - Generates a box plots of the average growth % parameters in each concentration/level of a specific condition % % boxplotGrowthParameters(input,statistic) % boxplotGrowthParameters(input,statistic,levels,strains,...
function sperling_burdett RE = 6378; muC = 398600.44; rt0 = [RE 0 0]'; vt0 = [-0.1 1.0*sqrt(muC/RE) 0.01]'; tspan0 = [0 1e6]; % Step 1 s = 0; r0 = norm(rt0); a = r0 b = rt0'*vt0; tau = t0; alpha = rt0; beta = r0*vt0; ...
%Joint angles of Wearable Jacket connected with Kinect clear all; close all; clc; telapsed = 0; i = 1; flag = 0; cd('F:\github\wearable-jacket\matlab\kinect+imudata\'); cd('F:\github\wearable-jacket\matlab\kinect+imudata\'); tt = 0; lkinef = 0; % strfile = sprintf('wearable+kinecttesting_%s.txt', datestr(now,'mm-dd-y...
clearvars; clc; H = 5; dtc = 1; Strategy = {'HorizonOne','LongHorizon','Move_To_Closest_Target','Random'}; current_strategy = Strategy{2}; Time = 100; MC_Results.est = cell(Time,1); MC_Results.meas = cell(Time,1); MC_Results.model = []; MC_Results.truth = []; for i=1:10:100 j = i + 9; disp(num2str(i)); ...
function [X,d,out,handles] = plotDesign(ons,rt,TR,varargin) % [X,d,out,handles] = plotDesign(ons,rt,TR,varargin) % % simple function to plot a design % plots regressors and color-coded onset times as little sticks, with RT represented as height of the stick % % Inputs: % ------------------------------------------------...
function [residual, evec_n, eval] = modal_residuals_split(vec, mics, order, winsize, alpha) % modal residuals - find residuals from modal decomposition with regularization, "split" across each filter channel % performs a regularized linear regression and computes residual vectors decomposed along modal basis % [r...
function im=generate_face_from_weights(weights_of_face,eignfaces_blk) im=zeros(450,300); for i=1:1:100 im=im+weights_of_face(i).*eignfaces_blk(:,:,i); end im=uint8(im);
close all; clear all; clc; %{ Options.Resize=false; ObjectDetection('Images/1.jpg', ... 'HaarCascades/haarcascade_frontalface_alt.mat', ... Options); %} sets = 40; picsPerSet = 6; % image sets that feature a female subject females = [8, 12, 14, 15, 22, 30, 35]; Options.Resize=false; for i=1:sets for j=...
clc, clear all, close all %% Titik dan Garis xz = [4 5 4.3 5]; xa = xz(1); xb = xz(2); za = xz(3); zb = xz(4); tic [pilih_sel,titik,d]=rayline(xa,za,xb,zb) t1=toc; % tic % [Coords]=brlinexya(xa,za,xb,zb); % t2=toc; garis = [xa za xb zb] %% Gambar if xa>xb buffer_xa=xa; xa=xb; xb=bu...
%{ 2017.05.20 BDP Assignment_5 %} function main import_data = importdata('trainingset.txt'); data = import_data.data(:, [1 2 3]); %plot(data(:, 1), data(:, 2),'.'); %hold on; test_data = importdata('testset.txt'); dataT = test_data.data(:, [1 2 3]); tic; [w1, w2] = Perceptron(data); %Perceptron Algorithm toc; %...
classdef NoTransform < ATransform % No transformation properties (SetAccess=protected) end methods function obj = NoTransform() % Constructor for no transform end function init(obj,varargin) % Initialization of no transform ...
%% Stelling 17 % % De element-wise AND-operator kan ook worden % toegepast op een vector. % Antwoord = NaN; % vul hier het juiste antwoord in 1 (WAAR) of 0 (ONWAAR)
%%%essai function f = fun(x,b,tau_opt) %%%% f= growth_response(x).*frac_max_vectoriel(x,tau_opt,b); %%%% end
function [] = generate_graph3( rating_vs_price ) %Generates thir graph of rating vs price rating_vs_price = cell2mat(rating_vs_price); rating_vs_price = sortrows(rating_vs_price); rating_vs_price(isnan(rating_vs_price)) = 0; %Splits listings based on rating [bincounts,ind] = histc(rating_vs_price(:,1), [0:10:...
%% load in subject % do RT task, and priming % close all;clear all;clc % this is from my z_constants Z_ConstantsStimResponse; subjdir = getenv('SUBJECT_DIR'); DATA_DIR = fullfile(subjdir,'\ConvertedTDTfiles'); sid = SIDS{5}; for s = 2:3 % load in data if (strcmp(sid, 'a1355e')) ...
% TPA_TestMotionClassificationSimpleDNN - Test Motion analysis % using stack of several images. %----------------------------- % Ver Date Who Descr %----------------------------- % 27.01 14.10.17 UD Created . %----------------------------- %% load data [XTrain,YTrain] = digitTrain4DArrayData; %% select small tr...
function output = fillRowState(output, i, searchMatrix, condensedStates, timeData, filenames, selection) %This is the most important (and most general) search function, %which actually calculates all the data which goes into "output" %and then puts it there, one row at a time %called by defaultStateAnal...
function v = rss(A, B) assert(isequal(size(A), size(B))); if size(A,1) == 1 A = A'; B = B'; end v = (A-B)'*(A-B); end
function f_k_ksub = getAlgebraicFunction(obj,k,ksub) f_k_ksub = obj.f{k,ksub}; end
tic; haze_removal('forest.jpg'); % haze_removal('test1.jpeg'); % Landscape small % haze_removal('test2.jpg'); % Dark Forest % haze_removal('test3.jpg'); % Chinese buiding % haze_removal('test4.jpg'); % Aerial town vies % haze_removal('test5.jpg'); %Stadium % haze_removal('test6b.jpg'); %Aerial city without atmos % haz...
clear; clc; [y,Fs] = audioread('my_a_unit.wav'); y_clip = y(10:117000); y_len = size(y_clip,1)/2; y_clip_A = y_clip(1:y_len); y_clip_B = y_clip(y_len+1:end); A_in = y_clip_A.*[1/y_len:1/y_len:1]'; B_out = y_clip_B.*[1:-1/y_len:1/y_len]'; mid = A_in+B_out; result = [y_clip_A;mid;mid;mid;mid;mid;mid;y_clip_B]; % N = 50...
classdef GtPattern %GTPATTERN Object that represents a pattern devised by Gelfand and Tsetlin. % % /m_{1,N} m_{2,N} ... m_{N,N}\ % | m_{1,N-1} ... m_{N-1,N-1} | % M = | ... | % | m_{1,2} m_{2,2} | % \ m_{1,1} ...
function [P,Q] = Proj_inverter(xt, yt, Ux, Sx); theta = atan(sqrt(Sx^2 - Ux^2)/Ux); theta_t = atan(yt/xt); if xt^2 + yt^2 <= Sx^2 && xt <= Ux x2 = xt; y2 = yt; else if abs(theta_t) > theta xx = [xt yt].'*Sx/sqrt((xt^2 + yt^2)); x2 = xx(1); y2 = xx(2); end if ...
function [obj varargout] = variability(varargin) %@variability/variability Constructor function for VARIABILITY object % OBJ = variability(VARARGIN) Args = struct('RedoLevels',0,'SaveLevels',0, ... 'Auto',0,'CellName','','SurrogateFF','framesg', ... 'SurrogateTRE','framesgTRE','FrameBins',10, ... 'LastGr...
function marginal_scores = RBES_compute_marginal_instrument_scores(arch) all = RBES_get_parameter('instrument_list'); %% eval complete arch % [results] = SEL_evaluate_architecture3(arch); [ref_science,~] = PACK_evaluate_architecture3(arch); fprintf('Ref score of arch is %f\n',ref_science); % ref_science = results.scie...
%% PARTICIPANTS f = figure(); load([pwd(),filesep,'data',filesep,'all_data',filesep,'data.mat']); zoodiff_versus_countdown; title('Participant data'); xlabel('Trials'); ylabel('Goal difference'); ax = gca; ax.XTickLabel = ''; ax.YTickLabel = ''; ax.YAxis.Color = [1,1,1]; ax.YTick = []; %% FITS f = figu...
function L = kloren(x, coef) % returns the lorentzian function centered at x0 with full width half % coef =[x0, w, a, y0] % if desired, this can be scaled by a and offset vertically by y0 % % [nplot ncoef] = size (coef); if ncoef<4, y0=repmat(0,nplot,1); else y0=coef(:,4); end; if ncoef<3, a=repmat(1,nplot,1); ...
function [path, parent] = A_star(loc,start_state, goal_state) % f(s) = h(s) + g(s) % g(s): actual cost from start state to state s % h(s): estimated cost of the cheapest path from s to goal_state => % h(s) = norm(pos(s) - pos(goal)) % Actions = {N, S, E, W, NW, NE, SW, SE} |A| = 8 actions = [0 1; 0 -1; 1 0; -1 0; -1 1...
classdef DagGaussJointGaussInfEng < JointGaussInfEng %DAGGAUSSJOINTGAUSSINFENG properties model; end methods function eng = DagGaussJointGaussInfEng(varargin) % end function computeLogPdf(eng,varargin) % notYetImplemented('DagGaussJointGaussInfEng.computeLogPdf()'); end function comp...
classdef ClothoidList < handle %% MATLAB class wrapper for the underlying C++ class properties (SetAccess = private, Hidden = true) objectHandle; % Handle to the underlying C++ class instance end methods % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function self = Clothoi...
function [S, U, EST_COV, TR_V, ERR_V] = ... estimation_with_no_delay_knowledge(Param, Grid, TrueProfiles, Meas, IC) % Implement standard KF on a synthetic loadcase assuming measurements % expressed in polar coordianates and no delay knowledge (which is not % compensated) % given parameters, loadcase, true profiles,...
function [ model ] = updateMu(X,y,model) %UPDATEBETA Summary of this function goes here % Detailed explanation goes here initialMu=model.mu; func4fminunc=@(mu)func2minimize(X,y,model,mu); matrix4constraint=-eye(length(model.mu),length(model.mu)); matrix4constraint(1,1)=0; if length(model.mu) > 1 ...
function g = grad(w, x, y) %g = ((-y.* x) * exp(-y.*(w*x')'))/(exp(-y.*(w*x')')+1); g = (-y.* x) * (1/(exp(y.*(w*x')')+1)); end
%-------------------------------------------------------------------------- % this function is used to use FaceSpace vectors to calculate CIF estimates % for all syndrome groups % % refactored by Christoffer Nellaker 140407 % % % -------------------------------------------------------------------------- if isdeployed...
%% Vehicle Articulated Nonlinear % % <html> % <script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> % </html> % %% Theory % <../theory/vehicleArticulated.pdf Articulated equations of motion> % %% Sintax % |dx = _VehicleModel_.Model(~,estados)| % %% Arguments % The follow...
function [Ktrans, kep, ve, ok, error_msg] = extract_PK_params(PK_Params_Struct, PK_parameterisation, field_suffix) Ktrans = []; kep = []; ve = []; ok = false; error_msg = []; PK_varnames = regexp(PK_parameterisation, ' ', 'split'); for v=1:length(PK_varnames) field_name = strcat(PK_varnames{v}, field_suffix); i...
function [Xpred, sigma_xx, sigma_yy, sigma_tt, NEES, t] = q1_ukf_nonlinear_obs( mu,sigma, xtrue, ztrue, t, g, T, rho_0, k_rho, Q, R) alpha = 0.75; beta = 2; k = 3; n = 3; lambda = (alpha^2)*(n+k) - n; sgma_pts = zeros(n, 2*n+1); w0m = lambda/(n + lambda); w0c = w0m + (1-alpha^2 + beta); wim = 1/(2*(n+lambda)); wic = ...
function dataFiles = findScintFiles_sub(dirInfo) %Load Variace Data dirVAR = dir([dirInfo(1).folder, filesep, dirInfo(1).name, filesep, '*.ASC']); for ii=1:length(dirVAR) VARdate(ii) = datenum(dirVAR(ii).name(1:6), 'yymmdd'); end %Find Unique days [Days, ~, Ind] = unique(VARdate); for ii=1:length(Days) dataFi...
%% Face recognition program clear all; close all; faceDatabase = imageSet('gallery','recursive'); galleryNames = {faceDatabase.Description}; displayFaceGallery(faceDatabase,galleryNames); %% Create HoG training features from database trainingFeatures = zeros(60,10404); featureCount = 1; for i=1:size(faceDatabase,2) ...
clear a = 2+3 b = 2-3 c = 2*3 d = 2/3 e = 2^3 who%查詢目前的工作區內,有哪些變數在使用 whos%同who,但列出詳細資訊 clc %指令通通清光光(clear command window) pi%圓周率 clear e %清除工作區內的變數e h=30 J=sin(30) %三角函數(單位為弳度) J1=sin(pi/3) J2=sind(h)%d表單位為度(degree) k1=asin(J1) %反三角函數(計算結果單位為弳度) pi/3 k2=asind(J2) %反三角函數(計算結果單位為度) k3=asind(J1) k4=asin(J2) clear a0=exp(0...
function mohcaplotf( D, seqpos, ligpos, titl, ticksize, save_path, secstr, pdb, contours, c, c2 ) % Plots 2D maps in MOHCA style % % INPUTS: % D req = matrix of data to be plotted % seqpos opt = x-axis values, RT stop positions (enter '' for default, 1 to length of x-axis data in D) % li...
%-------------------------------------------------------------------------- % Single POINT Positioning (SPP) using pseudorange AND phase observations % ------------------------------------------------------------------------ % Coder : Mohammed Abou-Galala % Date : 13-10-2021 %----------------------------...
clc dataDir='D:\data_main\103018_002'; stimFolder='C:\Users\amoore\akm_matlab\EphysCode\Experiment\Stimuli'; imDir_temp='C:\tmp'; try cd(dataDir); catch; mkdir(dataDir); cd(dataDir); end %% Seal test pulses if 1 bfig=figure; set(bfig,'position',[2190 1190 335 135]) % Wait until start button is...
function [VOI_avg, de_VOI_avg, stim_avg, grand_avg, eff_v] = ... f_Dboldavg_D(subjDir, Runs, iVOI, window_len, th) %function [VOI_avg, de_VOI_avg, stim_avg, grand_avg, eff_v] = ... % f_Dboldavg(subjDir, Runs, iVOI, window_len, th) % modified from f_avg_activation.m to apply to Dagfinn's data % - Heng 06/2004 % ...
function data = activity(data) for i = 1:length(data) data{i}.y_text = strings(length(data{i}.data), 1); end for linha = 1:length(data) for i = 1 : length(data{linha}.y_text) if data{linha}.y(i) == 1 data{linha}.y_text(i) = 'W'; elseif data{linha}...
clear all; close all; clc; %% Faulkner - Skan solution by shooting method % Note that the paramter T in the code is \eta % parameter Y in the code is solution f,dfdeta and d2f/deta2 global U; global nu; global n; U = 1; % U infinity nu = 1e-6; % Kinematic viscosity ...
function gradix=gradientlin(functname,dx,x) format compact n=size(x); N=eye(n(1)); DeltaX=dx.*N*ones(n(1),1)+[0;0]; xtemp=x; for i=1:n; x=xtemp; D=[0;0]; D(i)=DeltaX(i); w1=feval(functname,x+D)-feval(functname,x-D); w2=2*DeltaX(i); gradix(i)=w1/w2; end
function magnitude = sobelEdgeDetection( img_ori ) maskX = [-1 0 1 ; -2 0 2; -1 0 1]; maskY = [-1 -2 -1 ; 0 0 0 ; 1 2 1] ; resX = conv2(img_ori, maskX); resY = conv2(img_ori, maskY); magnitude = sqrt(resX.^2 + resY.^2); % L2-norm thresh = magnitude < 101/255; % hard coding magnitude(thres...
function SmoothSubPlot(SID,fignum,lfe,lbd,lelbfe,lelbfe1,lie,rfe,rbd,relbfe,relbfe1,rie) Row = find(lfe(:,3)<10); lfe(Row,:) = []; Row = find(lbd(:,3)<10); lbd(Row,:) = []; Row = find(lelbfe(:,3)<10); lelbfe(Row,:) = []; Row = find(lelbfe1(:,3)<10); lelbfe1(Row,:) = []; Row = find(lie(:,3)<10); lie(Row,:) = []; R...
function movieData = convertChannelsToMovie(chData,En,varargin) %convertChannelsToMovie converts a ChxSamples matrix to %HeightXWidthXnFrames movie matrix according to En channel map % varargins: % BGVal (1x1 double) % Value of pixels with no channels assigned to them (Usually % corners). Default value i...
% TLABELS ウェーブレットパケットツリーのノード用のラベル付け % % LABELS = TLABELS(T,TYPE,N) は、ツリー T のノード N に対するラベルを % 出力します。 % TYPE で設定できる内容は以下のとおりです: % 'i' または 1 --> インデックス % 'p' または 2 --> 深さ-位置 % 'e' または 3 --> エントロピー % 'eo' または 4 --> 最適なエントロピー % 's' または 5 --> サイズ % 'n' または 6 --> なし % 't' または ...
clear all; clc TIME_SLOT = 96; % load('2016speedandcounts_correct.mat'); % load('SANTANDER_NETWORK_INFO_AIMSUN.mat'); %% This is for data loading % % ========================================================================= % Initialization % ========================================================================= % -...
function [ freqlisto, spo, err, errmsg ] = spmodifydc( freqlisti, spi, dcvalue, ftol ) %% spmodifydc: modify an existing DC point in S-parameter element. % If the freqlisti does NOT contain a DC point, an error will be returned % % input variables: % freqlisti (double): list of frequencies in Hz. Col...
function [training_data] = construct_training_data(~) filename = 'aps_failure_training_set_processed_8bit.csv'; training_data = csvread(filename,1);
%% load .mats conf = dsp2.config.load(); date_dir = datestr( now, 'mmddyy' ); epoch = 'reward'; basepl = conf.PATHS.analyses; baseps = conf.PATHS.plots; load_path = fullfile( basepl, date_dir, 'signals', 'shuffled_coherence', epoch ); save_path_l = fullfile( baseps, date_dir, 'lines', 'shuffled_coherence' ); save_p...
function y= SoundMaker(noteletter,dur) t=0:1/8000:dur-(1/8000); rest=1; %(rest=0) when a rest note gets passed in to create an empty array note=0; switch noteletter %switch case to assign a numerical value to each note based on the case"e" %equation for frequency generation note=-5; %spec...
function estimated_norm = estimate_norm(denominator_ind, image_buffer, opt) % produce initial norm estimation for each pixel in the image set % image pixels are models as p(N.L) light_denominator = opt.light_vec(denominator_ind, :); light_ratio = [opt.light_vec(1:denominator_ind-1, :); opt.light_vec(denominator_in...
function saveToFile(em, fname) % saveToFile(eng_map object, filename) % % saves the eng_map data in ascii format to the file of your choice % the variables fc_map_spd, fc_map_trq, and fc_fuel_map are defined with comments % this is compatible with ADVISOR format fid=fopen(fname,'w'); fprintf(fid, 'fc_map_spd = ['); fo...
%% The LC3B Tandem Puncta Quantification %Code requires bioformats MATLAB Toolbox and MATLAB version R2021a or %higher %% Creator % Created by: Joaquin Quintana(last modified: 2021-05-06) % Emial: Joaquin.Quintana@Colorado.edu %% Details % The script is designed to quantify Biofilm volumes. The biof...
%% Definitions clc;clear; path='c:\data2'; fileinfo = dir(fullfile(path,'*.au')); filesnumber=size(fileinfo); for i = 1 : filesnumber(1,1) [signal{i} fs{i}] = audioread(fullfile(path,fileinfo(i).name)); disp(['Loading Sound No : ' num2str(i) ]); end; win = 0.050; step = 0.050; %% Time domain features...