text
stringlengths
8
6.12M
%find the largest LST for each RNDDI %rnddi=int16(crop_rnddi*1000); % [r1,c1]=size(crop_lst); bins = max(max(rnddi)); maxLST = zeros(1,bins)-500; minLST = zeros(1,bins)+500; for i=1:r1, for j=1:c1, %do x=crop_rnddi(i,j); if((x>0)&&(x<bins)) if(crop_lst(i,j)>maxLST(x))...
% $Header: svn://.../trunk/AMIGO2R2016/Postprocessor/Post_Plot/AMIGO_plot_clouds.m 2203 2015-09-24 07:11:27Z evabalsa $ % AMIGO_plot_clouds: plots clouds by pairs of parameters in the Robust identifiability % analysis % %****************************************************************************** %...
function plotdata=plotAperture(lindata,ring,dpp,varargin) %#ok<INUSD> %function plotdata=plotAperture(lindata,ring,dpp,varargin) %#ok<INUSD> % % Plots x and y aperture. % % use with atplot(atlattice,@plotAperture); % apind=findcells(ring,'Limits'); xm=getcellstruct(ring,'Limits',apind,1); ym=getcellstruct(ring,'Limi...
%% Nozzle shape equation thN = 22; thE = 0; th1 = linspace(-135,-90); th2 = linspace(-90,(thN-90)); Rt = 0.25; xin = 1.5*Rt*cosd(th1); yin = 1.5*Rt*sind(th1)+Rt*1.5+Rt; plot(xin,yin) th3 = linspace(45,90); xinp = 1.5*Rt*cosd(th3)+0.25*xin(1); yinp = 1.5*Rt*sind(th3)+yin(1); xinp = 1.5*Rt*cosd(th3)+0.25*...
% MRIanalysis % analyze T2 maps over ROIs, fit relaxation time (exponential decay) % % REQUIREMENTS % image processing toolbox % statistical toolbox % NIFTItools % % % Reworked version by E. Bakstein, based on MRIanalysis_3May2018.m % EDITS 2018-05-15: % - Settings: all code parameters editable...
function [W,b]=dnn(nh,eta,training_inputs,training_results) mini_batch_size =10; % mini bacth size sparsityParam = 0.07; % desired average activation of the hidden units. % (This was denoted by the Greek alphabet rho, which looks like a lower-case "p", ...
% Test Cases: [out1] = forecast('I dislike cold weather.', 'dislike', 'enjoy') [out1_soln] = forecast_soln('I dislike cold weather.', 'dislike', 'enjoy'); % out1 => I enjoy cold weather. % Output variable(s) should be identical to that produced by the solution file % [out2] = forecast('CS1371 homework is the worst...
function readbt1files() clear global instfile='c:\ZnMn2O4\5Kznm001.inst'; gsasfile='c:\ZnMn2O4\5kznm001.gsas'; gsasfile2='c:\ZnMn2O4\5kznm002.gsas'; %if exist([instfile]) % fid=fopen([instfile],'r');%thedata=fscanf(fid,'%f %f %f',[3 inf])';fclose(fid); %end %while 1 % l...
function outString = fullcommand(varargin) % outString = fullcommand(str1, str2, ...) % % Correctly concatenate string inputs so that they form a valid % command-line string command for working with the Android adb. Kind of % like the built-in fullfile() function, but more can add path parts and % other command parts c...
% Ex3 % b) R = 25000; lambda = (5000*10+2500*25)/24; p = 30; alfa = 0.1; fname = 'movies.txt'; S = 1000; for n=76:76 for W=10000:70100 % Init matrixes blocking_hd = zeros(1,10); blocking_4k = zeros(1,10); % Run simulator2 10 times for i=1:10 ...
function h = points(x,y,z,c) % h = points(x,y,z,c) % Plot the points specified by (x,y) with % a (uniform) color specified by the RGB triple c, % with an intensity given by z (one intensity/point) % z must be in the range [0 1]. newplot if (size(z,1) == 1) z = z'; end if (size(c,2) == 1) c = c'; end % Have to trick m...
function [] = plot_psychometric(parsed, clevs) % psychometric function for mouse hitZeroContrast = mean(parsed.hitRate(:,clevs.Zero),2); hitLowContrast = mean(parsed.hitRate(:,clevs.Low),2); hitMidContrast = mean(parsed.hitRate(:,clevs.Mid),2); hitHighContrast = mean(parsed.hitRate(:,clevs.High),2); hitHundredContras...
function plot_ERPAC_aud_resp(subj,block,condition,elecs) %condition = 0 or 1 or 2 %0: to plot the three stimuli %1: to plot the three values that change over blocks %-1: to plot no condition if ~iscell(block) get_subj_globals(subj,block) block = {block}; else get_subj_globals(subj,block{1}) figdir = [...
function h = setSliderVal(source) % this function lets the user click and drag the slider. gui = guidata(source); h = gui.ctrl.slider; p = get(0,'PointerLocation'); % absolute location of the click figPos = getpixelposition(source); % absolute location of the figure boxPos = getpixelpo...
clear; %% gm/ID gmoverid=load("gmoverid.mat").gmoverid; currents=load("currents.mat").currents; figure hold on plot(1e6*currents, gmoverid) label = plot(0.13, 20, 'o'); xlabel("Drain current (\muA)") ylabel("g_m/I_d") plot_paper %% leakage leakcurrent = 1e12*load("leakcurrent.mat").leakcurrent; times = load("times....
Matlab kan een zelfgeschreven functie altijd vinden.
function [xdatafit fit] =fun_bat2(xdata,t,y) [xdatafit] = fmincon(@batfun, xdata, [],[],[],[],[0 0 0 0],[10 10 10 10],[],optimset('MaxFunEvals',100000,'MaxIter',100000,'TolX', 1e-8 )); [SSE fit] = batfun(xdatafit); function [sse, x]=batfun(xdata) x=xdata(2).*(t-xdata(1)).^...
% Sandesh Thapa % Homework 1 % MAE 5010 Flight Controls % Problem 3 clc; close all; clear all; %% Part a syms x real solx = solve (0.3739*x^4 + 1.3343*x^3+ 0.5280*x^2+ 0.0381*x -0.0235 ==0,x); r = roots([0.3739 1.3343 0.5280 0.0381 -0.0235]) %% Inner Loop num1 = [0.0602 4.4326 0.2008 0.31...
%clear %close all % Pacejka magic formula F = @(x,D,C,B,E) D*sin(C*atan(E*atan(B*x)+(1-E)*B*x)); %% Longitudinal force lambda = -1:0.01:1; % [-] delta_mux_notch=0.1; %[-] additive value due to notch setting Clambda = [0,100000,250000,400000,500000]; % [N] Fzx = [...
function [] = util_disp_hyperlink( text, varargin ) %UTIL_DISP_HYPERLINK 工具函数:在命令窗口显示蓝色的超链接文字 % text = 要显示的文字 % 可选:links = 链接位置 % % 蒲江波 - 2009年6月27日 pvpmod(varargin); if ~exist('links', 'var') links = ''; end disp(['<a href="' links '">' text '</a>']); end
if any(strcmp('rgbVision', fieldnames(sensor))) && sensor.demoCue imwrite(sensor.rgbVision, [aux.path, '/demoImages/', num2str(sn), '.png']); sn = sn + 1; end
function list = visitNode(node, Data) errors = 0; list = []; len = length(Data); for row = 1:len(1) curNode = node; while curNode.value-'1'>0 i = str2num(curNode.value); if Data(row,i-1) curNode = curNode.right1; else ...
% PI measurement % gateWindow = [60 90]; % [gIX, stSamp, enSamp] = gateOnTime(tAIX, gateWindow); % calcFcn = @fcnOccupancy; % [perGateMeas, measIX] = calcFcnOnGate(tA, tAIX, gIX, stSamp, enSamp, calcFcn); % decPI measurement (avg. occupancy on mid-zone exit) % gatePosition = [-5 5]; % firstOnly = false; timeEntries ...
%{ This code creates stochastic and deterministic time series, nullclines, and power spectra plots for the native strain (full model, high molecule number). %} global xvals yvals alpha_k alpha_s beta_k beta_s k_k k_s p h delta lambda_k lambda_s Gamma_k Gamma_s %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
% IMPORTANT - This script requires the Matlab symbolic toolbox % The code is the implementations of Double-Stage Kalman. % Author: Xinzhe Gui % Email: lwft@qq.com %% environment config clear all; reset(symengine); load('./Mat/StatePrediction.mat'); addpath(genpath(pwd)); %% derive equations for fusion of true acc meas...
function [f] = drawManip(Transformations, ax) %DRAWMANIP Summary of this function goes here % Detailed explanation goes here [l,m,n] = size(Transformations); trans = 1; if n > 1 trans = 1; else trans = 0; n = m; end f = gcf; rotate3d on grid on xlabel('X'); ylabel('Y'); zlabel('Z'); R1 = [1 0 0; 0 1...
%设置定时函数h,s,t n=0;%初始化计数变量 connector on m=mobiledev h=timer('TimerFcn','n=0;','Period',3,'ExecutionMode','fixedDelay','TasksToExecute',2); %清除计数变量n并且设置延迟函数 s=timer('TimerFcn','n=n+1;g(n)=norm(m.Acceleration)','Period',0.5,'ExecutionMode','fixedRate','TasksToExecute',10,'StopFcn','gra(3)=sum(g(1:10))/10,start(h)','Star...
function mx = nanmean(x) %NANMEAN Mean of available data, ignoring NaNs. % % NANMEAN(X) returns the mean of the available data in X, treating % NaNs as missing values. For vectors, NANMEAN(X) is the mean value % of the non-NaN elements in X. For matrices, NANMEAN(X) is a row % vector containing the mean v...
classdef List % List: a class for singly linked lists % % List - (NIL) the empty list, encoded as List( [] , [] ) % List( x , L ) - (CONS) implements the constructor properties head % the data item tail % the rest of the list end methods % Constructor: %...
function [thermRegData] = updateRegistrationPointsColonyFolder(wd) cd(wd); %Load metadata metadatafile = dir('*metadata*'); load(metadatafile(1).name); % Load image registration data imregfile = dir('*imageRegistration*'); load(imregfile(1).name); %% Generate thermal background pic; filelist = dir('**/*TC.mj2'); n...
function archs = PACK_generate_random_archs(narc) global params ninstr = length(params.packaging_instrument_list); max_sats = get_max_nsats(); if max_sats == 0 max_sats = ninstr; end rand_integers = randi(max_sats ,[narc ninstr]); % pack_fix archs = PACK_fix_archs(rand_integers); archs = unique(archs,'rows'); end...
imageFiles = dir('*.bmp'); % for j = 1:length(imageFiles) % Fractal Dimension % log_e(N) = -D = log(N)/log(e) % Where N is the number of segments (cubes) % e is the fraction x = 1:20; % fraction squareN = x.^2; % squares % create a matrix of binary values for "contains star" (1) and "d...
%% Iterative optimal thresholding segregateAndShow('cuphead.jpg'); segregateAndShow('castle.jpg'); segregateAndShow('seagull.jpg'); %% Thresholding clear; compareThresholds('ean.jpg', 0.8); compareThresholds('page.jpg', 0.3); compareThresholds('cameraman.jpg', 0.4); % Conclusion: % With 'ean.jpg', mode thresholding ...
tic clear; clc; %import data opts = detectImportOptions('shuflenoise.csv','NumHeaderLines',1); ctg_smoted_noise = readtable('shuflenoise.csv',opts); ctg_smoted_noise.Properties.VariableNames([1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27]) = {'A','LB','AC','FM','UC','DL','DS','DP','A...
function ChangementEtatVisible(obj,event) Liste_Fichier=getappdata(gcbf,'liste_fichier'); Nb_Fichier_Charger=getappdata(gcbf,'nb_fichier_charger'); for j=1:Nb_Fichier_Charger for i=1:length(Liste_Fichier(j,1).Liste_Marqueur) if strcmp(get(Liste_Fichier(j,1).Menu_Affiche_Mq(i),'Checked'),'on') L...
%% Redes Neurais Artificiais - Tarefa 01 utilizando Eq. Normal % Descrição % ------------ % % Este arquivo contém o código para solução do comando da tarefa01 % utilizando o método de Regressão Linear com Eq. Normal. % Autor: Felipe Rodrigues Veludo Gouveia % Data: 29-10-2017 % % Comando da Questão: % --------...
function [] = trace_comparaison_mode(u,Nt,Nx,uexacte) % trace la solution obtenu numériquement et la solution exacte %% Variable globale global L T %% Parametre a calculer deltax = L/(Nx-1); deltat = T/(Nt-1); x = (0:deltax:L).'; t = 0:deltat:T; matsolexacte = uexacte(x,t); %% Video video_sol = VideoWriter('video....
function obj = getSchema persistent schemaObject if isempty(schemaObject) schemaObject = dj.Schema(dj.conn, 'virus', 'common_virus'); end obj = schemaObject; end
% Returns weighted adjacency matrix of a directed graph, where each row % represents the ingoing edge weights to the corresponding node. function A = weighted_adjacency(G) A = zeros(G.numnodes); s = G.findnode(G.Edges.EndNodes(:, 1)); t = G.findnode(G.Edges.EndNodes(:, 2)); A(sub2ind(size(A),...
for simcool=1:10 clear M1 M2 E dR RE E2 RE2 max_iter=10; noise_values=0+(0.05:0.05:1.5); j=10; nodes=64; nel=nodes*(nodes-1)/2; degree_target=5; [bm1] = BAgraph_dir(nodes,degree_target,degree_target); bm1=bm1+bm1.'; bm1=bm1>0; [W1, We1]=ls_bin2wei(bm1,noise_values(j),0); modules=4; [bm2 , mods] = random_modular_grap...
function tellFinnee(finneeStc) %% DESCRIPTION % 1. INTRODUCTION % TELLFINNEE gives informations about the input finneeStc. % % 2. PARAMETERS: % .required. TELLFINNEE requires at least 1 parameter % finneeStc % is the finnee structure that contain information about the run % and link...
function distances = prmi_compute_pairwise_distance(X,Y,d) % PRMI_COMPUTE_PAIRWISE_DISTANCE computes the euclidean pairwise distances. % % distances = PRMI_COMPUTE_PAIRWISE_DISTANCE(X): Euclidean distance between (X,X) % 'X' is DxP matrix, one column per feature. % 'distances' is PxP matrix...
function [pos_x,pos_y,pos_z] = get_pos(x,y,intensity,imagesize) halfsize = imagesize/2; theta = 90 * (x - halfsize)/halfsize ; % turn to rad theta = theta * pi/180; phi = atan((halfsize-y)/(x-halfsize)); pos_x = sin(theta) * cos(phi) * intensity; pos_y = sin(theta) * sin(phi) * intensity; pos_z = cos(theta) * int...
function Ah = assembleMat(nh, h) Ah = zeros(nh * nh, nh * nh); Ah(1:nh, 1:nh) = buildT(nh); Ah(1:nh, nh+1: nh + nh) = - eye(nh, nh); Ah((nh -1) * nh + 1: nh * nh, (nh - 1) * nh + 1 : nh * nh) = buildT(nh); Ah((nh -1) * nh + 1: nh * nh, (nh - 2) * nh + 1 : (nh - 1) * nh) = - eye(nh, nh); for i = 2 : nh...
function c = redblue % redblue gives a colormap within [cl(1) cl(2)] from % Blue [0 0 1] to White [0 0 0] to Red [1 0 0] m = size(get(gcf,'colormap'),1); % Get size of colormap cl = caxis; % Get colormap limits m1 = round(-m*cl(1)/diff(cl)); % Get ratio o...
function [shape] = L2Shape(obj,l) %L2Shape Summary of this function goes here % Detailed explanation goes here shape = obj.pca.Coeff2Data(obj.pose_mu,obj.pose_pc(:,1:obj.n_l),l); end
function [ pointset ] = makePointSet( v, n, u, c ) %[ pointset ] = makePointSet( v, n, u ) % initialize pointset data structure from vertex/normal/uv-arrays % % pointset.v = Nx3 list of vertices % pointset.n = Nx3 list of vertex normals % pointset.u = Nx2 list of vertex uv's % pointset.vidx = Nx1 list of vertex ...
function [us] = MeasureData(t) %------------------------------------------------------------------ % Purpose: % Returns the state of the unknown DPS for all nodes % % Sinopsys: % us = MeasureData(t) % % Variable description: % t - current simulation time % %--------------------------------------------------------------...
% Spike Spike=[]; for i = 1 : 56 Spik = sum(sum(AllData{i,3})); Spike = [Spike; Spik]; end % Smooth firing rate Fire=[]; for i = 1 : 56 Fir = sum(sum(AllData{i,5})); Fire = [Fire; Fir]; end
function para = getRouteParams(routename) switch routename case 'SingleRing'; para.flyerpara.d = 0.3/2; para.flyerpara.r = 0.3/4; para.viewangle.az = -33.5; para.viewangle.el = 40; para.titletxt = 'SingleRing Trajecoty Tracking'; case 'Hover'; para...
function entrust_amounts = equal_allocation_amount(obj, volume) % 数量平均分配的函数 %输入:委托的数量 volume %输出:平均分摊的数量 entrust_amounts % 吴云峰 20161124 % 1,判断数量 nCount = obj.optstraddletrading_multi.Count; if nCount == 0 entrust_amounts = nan; return; end % 2,进行数量的分配 entrust_amounts = zeros(1, nCount); avg_amount = v...
function [F, volume, allSlices] = rotateAndDip(image, theta, makeVideo) if nargin < 3 makeVideo = 0; end volume = zeros(1, length(theta)); allSlices = []; for i = 1:length(theta) [rotatedImage, slices] = calculateSlices(image, theta(i)); %slices = alignFirstNonZero(slic...
function J = computeCost(X, y, theta) %COMPUTECOST Compute cost for linear regression % J = COMPUTECOST(X, y, theta) computes the cost of using theta as the % parameter for linear regression to fit the data points in X and y % Initialize some useful values m = length(y); % number of training examples % You need t...
function available_data=NDBC_available_data(parameter,options) %%%%%%%%%%%%%%%%%%%% % For a given parameter this will return a structure of years, % station IDs and file names that contain that parameter data. % % % Parameters % ------------ % parameter : string % 'swden' : 'Raw Spectra...
%% % File: LMI_tricks_logdet.m % Directory: 2_demonstrations/egyeb/Matlab_tricks % Author: Peter Polcz (ppolcz@gmail.com) % % Created on 2023. April 05. (2022b) % n = 3; P = sdpvar(n) Obj = det(P)^(1/n); Obj = log(geomean(P)); % Obj = -logdet(P); % Obj = log(det(P)); A = magic(n); B = A(:,1); K = lqr(A,B,e...
function mna2 % ipr1(); % ipr2(); % kr1(); % kr2(); end % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % function kr1() syms x lb = -1; ub = 1; n = 2; A = sym('a',[1,n]); baseFunc0 = '0'; p=0; b = 1; c = 1; q=-1 f=-x...
function random_fields=f_read_random_field(file_folder, file_name) display(['---> Reading Random Field file: ' file_folder '/' file_name]) fid = fopen([file_folder '/' file_name]); rf_header=regexp(strrep(fgetl(fid),' ',''),',','split'); rf_field=textscan(fid, '%s\n', 'CommentStyle', '%', 'bufsize',4956000); fclose(fi...
classdef (Sealed = true) rect_cos < qes.waveform.waveform % Rectangular pulse with cosine shaped rise/fall edges and % drawback/overshoot calibration before/after edges % Copyright 2016 Yulin Wu, USTC % mail4ywu@gmail.com/mail4ywu@icloud.com properties amp = 1 rise_time = 1 beta =...
function [ zero ] = gfsk_channel_zeros(channel) load gfsk_Parameters.mat a = size(channel) for i=1:a(1) for j=1:a(2) coeffs = polyfit([1:length(channel(i,j,:))].',unwrap(squeeze(angle(channel(i,j,:)))),1); slp = coeffs(1); yint = coeffs(2); zero(i,j) = exp(1i*mod(yint+slp*(length...
function [C, sigma] = dataset3Params(X, y, Xval, yval) %DATASET3PARAMS returns your choice of C and sigma for Part 3 of the exercise %where you select the optimal (C, sigma) learning parameters to use for SVM %with RBF kernel % [C, sigma] = DATASET3PARAMS(X, y, Xval, yval) returns your choice of C and % sigma. You...
function [MI, MIshuff] = measureMI(grandMetrics, grandIX, nBins) ix = find(isnan(grandMetrics)); grandMetrics(ix) = 0; classIX = uniqueTypes(grandIX); for metricN1 = 1:size(grandMetrics,2) metricN1 for metricN2 = metricN1:size(grandMetrics,2) metricN2 n...
function [reduced_dam] = damage1(matrix, p, n, r) % matrix=cycle data % p = number of days % n = number of steps % r = recovery %Define variables a=0.9711; beta=3.0126; b=1; UTS=3.9;%MPa % sf=0.45*UTS; %Fatigue Limit sf=0; M0=14.7358;%MPa % a=0.9711; % beta=3.0216; % b=0.9; % UTS=3.9;%MPa % % sf=0.45*UTS; %Fatigue Lim...
function inhibitorRegion = findRegionWithHighInhibitorActivtorRatio(Ia_ratio_all, threshold) %% returns the region where inhibitor/activator > threshold for at least 10 consecutive timepoints. % ----- Inputs: % 1) Ia_ratio_all = ratio of inhibitor/activator levels for a set of timepoints % 2) threshold = inhibitor/act...
function [lma_data] = lma_import(date) %%LMA_IMPORT(date) imports an LMA file from the CHUVA campaign. Date can be given as a %%date vector [yyyy,mm,dd] or a datenum, or as a filename % 11/30/11 - Michael Hutchins lma_path='/Volumes/Data/LMA/'; if strmatch(class(date),'double') if length(date)==3 fileP...
Setup %%% START %%% % Brandon Fong % CES 400 Final Project % Due Date: Wednesday, 12/2/2020 % Name & ID : Brandon Fong (007808236) % email: fong.m.brandon97@gmail.com & fongb@sonoma.edu % Link to Report: NA % Link to Git: NA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Part 1: W...
% This function obtains a plot of the load cycle for a given interval. % The demand interval and the load must be defined by the variable data % in a three-column matrix. The first two columns are the demand % interval and the third column is the load value. The demand interval % may be minutes, hours, or month in...
clear all; close all; clc; x_offset = [1,2,3,4,5,6]; y_offset = [2,5,1,5,3,3]; y_diff_offset = [1,1]; n = length(x_offset); spline_coeff = zeros(n+2,1); spline_matrix = zeros(n+2,n+2); %The matrix that is used for calculate the spline coefficient, H in the word power = [0,1,2,3]; x_matirx = zeros(n,4); for i = 1:n ...
function [X, Y] = RandomWalk(n, h) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here X=zeros(1,n) Y=zeros(1,n) i=2 while i<=n angle=2*pi*rand x_0=X(i-1) y_0=Y(i-1) x=h*cos(angle)+x_0 y=h*sin(angle)+y_0 if (x>0) && (x<1) && (y>0) && (y<1) ...
% ADVISOR data file: CYC_L60MPH.m % % Data source: Steve Burch, NREL % % Data confirmation: % % Notes: % 60 mph for 1 hour % % Created on: 22-Jul-1998 % By: SB of NREL % % Revision history at end of file. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
% PTF_CUT_NOMINPH % % Function PTF_CUT_NOMINPH modifies signal for easier identification by % Strejc % % yn = ptf_cut_nominph(yo) % % where % yo is original signal of step response and % yn is returned modified signal % Copyright is with the following author(s): % % (c) 2012 Juraj Oravec, Slovak University...
function obj = adjspikessync(varargin) %@adjspikessync Constructor function for adjspikessync class % OBJ = adjspikessync('auto') attempts to create a adjspikessync % object by ... % % When the Sliding option is used, these are how the data fields are used: % numSets = 0; corresponds to number in nptdata %...
function [traceEventAlign, timeEventAlign, nvalidtrs, traceEventAlign_wheelRev,... timeEventAlign_wheelRev, nvalidtrs_wheel] = avetrialAlign_noTrGroup(eventTime, traces, alldata, frameLength, trs2rmv, alignWheel, printsize, doplots, doNpreNpost) % eventTime = time1stCenterLick; timeInitTone; % 'beg'; timeStimOn...
function [Qp] = SecondOrderForwDiff(mu,dL,Pan) s_p2 = 1/2*dL(Pan(3)) + 1/2*dL(Pan(2)); s_p1 = 1/2*dL(Pan(2)) + 1/2*dL(Pan(1)); mu_p2 = mu(Pan(3)); mu_p1 = mu(Pan(2)); mu_0 = mu(Pan(1)); % Second-order backward difference A = [ (s_p1 + s_p2) 1/2*(s_p1 + s_p2)^2;... (s_p1) 1/2*(s_p1)^2]; b = [mu_p2 ...
function uri = getStorageUri(obj) % GETSTORAGEURI Returns the list of URIs for all locations % Copyright 2019 The MathWorks, Inc. uri = azure.storage.StorageUri(obj.Handle.getStorageUri); end
function plotHotspotOverTime(pointscanCellArray) % This function creates a plot of the size of a hotspot over time. It takes % input of a pointscanCellArray created by batchImportPointScans.m % The function assumes that points are spaced 0.5um apart % Written by Perry Spratt 2015-07-07 % Go through each pointscan in...
function [latent_parameter, latent_index] = sage_maximization(latent_signal, latent_parameter, latent_index, sage_const) % SAGE_MAXMIZATION: Maximization step of SAGE. % LATENT_SIGNAL: T x F x A x AoD matrix % CURRENT_PARAMETER: 1 x 5 vector: tof, aoa, doppler, amplitude T = size(latent_signal, 1); F...
clear; close all; dataDir='~/Data/Audiovisual_motion/200309FRA_CAS.loc/exp_logs'; % %% congruent vs. incongruent % cd(dataDir); % TR=3.3; % stim1File=dir('*run1.mat'); % stim1=load(stim1File.name); % stim1_congruenttime_dis2TR=stim1.stimLog.stimCongruentBegnTime-TR*2; % dlmwrite('stimCongruent_dis2TR.txt',st...
function alPlots % % The data are organized as % % 1 2 3 4 5 6 7 8 9 10 11 % Cp rho T U L Lf Xf lenf D Df Wf % A Af V Vf Cxf Cyf M Mom KE IE TE % L/D Lf/L Xf/L lenf/L Df/D Wf/D Af/A Vf/V % load AlGust.dat load AlHouse.dat load...
function [points, obst_points, home, coord_area, coord_obst] = waypoints2meters(waypointsfile, obstaclesfile) fid = fopen(waypointsfile); str = fgetl(fid); % read line from file str = fgetl(fid); % reads data from string str, converts it according to the format, % and returns the r...
function varargout = guiPlot(varargin) % GUIPLOT MATLAB code for guiPlot.fig % GUIPLOT, by itself, creates a new GUIPLOT or raises the existing % singleton*. % % H = GUIPLOT returns the handle to a new GUIPLOT or the handle to % the existing singleton*. % % GUIPLOT('CALLBACK',hObject,eventData,...
N=11; n=(0:N-1)'; w=window(@rectwin,N); stem(n,w,'linewidth',2); xlabel('n'); ylabel('R_N(n)'); ylim([0 1.5]);
clear all; close all; clc; % AÇIKLAMA: [RGB]out 3x1 lik matrisi gerçek rgb değerlerimiz "orjinal_RGB_degerleri.m" % kodunda bilinen değerlerim.[RGB]in 3x1 lik matrisi ise benim bozuk çıkan % resmimdeki renk değerleridir.Hedefimiz;[RGB]out = T*[RGB]in formulünden T matrisini % bulmaktır.Elde edilen dokuz bilinmeyen denk...
%Matlab codes for Finite Element Analysis clc; clear all; elementNodes = [1 2;2 3;2 4]; numberElements = size(elementNodes,1); numberNodes = 4; displacements = zeros(numberNodes,1); force = zeros(numberNodes,1); stiffness = zeros(numberNodes); force(2) = 10.0; for e = 1:numberElements elementDof = elementNodes(...
function [cmz_hist,mzaligned, Spaligned, machedindeces] = dp(mzTest, SpTest) %% dynamic programming alignment opts.estimationMethod = 'histogram'; opts.mzRes = 0.001; opts.display = 0; opts.cmz=[]; opts.correctionMethod = 'shortest-path'; opts.maxPeakshift = 2.5; opts.gapPenalty=5; opts.intThr = 0; counter=1; for i=1...
function [ Y ] = eigenbasis( T ) %GORKA ERAŅA ROBLES - This function computes the eigenbases of a real Schur %form matrix T. % The implementation follows the computations developed in section 5.6 of % the dissertation. [n,~] = size(T); j = n; Y = zeros(n); while ( j ~= 0 ) if ( j == 1 ) %...
function nm = name(self) % NAME - user-specified phase name. nm = phase_get(thermo_hndl(self), 42);
function h = progressBar(varargin) % PROGRESSBAR generates and/or updates a GUI with a single or multiple % simultaneous progress bars. Also has the ablility to pause and/or % cancel a process. % % % SYNTAX % % H = PROGRESSBAR(message, Name) % PROGRESSBAR(H) % PROGRESSBAR(H, 'PropertyName', PropertyValue, ...) ...
classdef GDparams %GDPARAMS Hold parameters controlling learning algorithm properties n_batch eta n_epochs end methods function obj = GDparams(x,y,z) obj.n_batch = x; obj.eta = y; obj.n_epochs = z; end end end
function calculate_displacement() global mouse; global ax_vec; global vx_vec; global ax_sum; global ay_vec; global n; global ii; global d_count; displacement = sum(vx_vec);%trapz(vx_vec); vx_vec = []; stem(d_count,displacement); d_count = d_count + 1; fprintf('Displacement is: %0.2f\n', displacement); ...
%% The in plane Kittel equation function [y] = IPKittelEquation(x,gamma,Ms) % The in plane Kittel equation. Y is FMR field, x is FMR frequency y = (-Ms + sqrt((Ms).^2 + 4.*x.^2./gamma^2))./2; end
function [Ensemble,D,FLIPFLOP,model,update_number,discard_number,STAR]=FindDistancesortupdate(Ensemble,model,Threshold1,Threshold2,update_number,discard_number,lastData,nmix) D=cell(1,max(size(Ensemble.models,2),size(model,2))); %D=zeros(1,max(size(Ensemble.models,2),size(model,2))); FLIPFLOP=zeros(1,max(size(Ensemb...
function [R_tf, V_tf, y_1, y_2, y_3, t_1, t_2, t_3] = simulation_trajectoire(theta_0, theta, m_e, m_s, M, Mi, mu, c_x, R_terre, H_c, R_c, v_e, alpha) %%%---------------------- CONDITIONS INITIALES -------------------------%%% % temps t_0 = 0; % position R_0 = [R_terre; 0]; % vitesse V_0 = 100 * [cosd(theta_0...
function [obj] = PreCompute(obj,i) %PreCompute Summary of this function goes here % Detailed explanation goes here dWduvi = obj.w{i}.Compute_dWduvi(); obj.dWdp{i} = obj.sm{i}.Compute_dWdp(dWduvi); % [obj.VxA,obj.VyA] = obj.tm{i}.Compute_VA(); end
function [ d ] = msd( v,V ) %UNTITLED9 Summary of this function goes here % Detailed explanation goes here [m n] = size(v); x = v - V; x = double(x); x = power(x,2); x = sum(x); x = sum(x); n = m*n; d = x/n; end
function solutions = simple_experiment_trial(solvers, scene, ranks) % solvers % - find_cameras % - find_cameras_with_K % - find_structure % - find_structure_with_K num_ranks = numel(ranks); num_cameras_sans = numel(solvers.find_cameras); num_cameras_with = numel(solvers.find_cameras_with_K); num_stru...
function [ LSD ] = calc_LSD( mag1, mag2 ) %TEST_LSD Summary of this function goes here %calculate log spectral distortion (LSD) between mag1 and mag2 LSD = mean(sqrt(mean(10*(log(mag1)-log(mag2))).^2)); end
clc;clear; %% script folder dot = '/Users/brandomiranda/home_simulation_research/overparametrized_experiments/'; cd(dot); %% Get perturbation errors for natural label experiment path_random_label='/pytorch_experiments/test_runs_flatness/flatness_29_March_label_corrupt_prob_0.0_exptlabel_pert_retrained_Random_Label_on_N...
k=0; for j = 1:100 hidstate=reshape(double(im2bw(reconst_4to3(:,j),0.9)),[373248/288 288])'; for i = 1:288 temp=hidstate(i,:); if sum(temp(:))>0.1*sum(hidstate(:)) temp(:)=0; k=k+1; end hidstate_sim(i,:)=temp; end hidstate_sim_f(:,j)=hidstate_sim(:...
function printToEPS(myHandle,name) % printToEPS - Save the figure to EPS format in the folder "Plots". % Syntax: printToEPS(myHandle,name) % % Input: % myHandle - The handle to the figure which is to be saved % name - A string containing the file name % % Output: % A file 'name.eps' in the folder 'Plots' with ...
reconsize = 256; params.Dsource2centr = 5; params.Dsource2detec = 10; params.NumofView = 720; params.NumofBin = 512; % number of detector bins params.pixelsize = 2/256; params.binsize = 0.008; params.binshift = 0; % detector shift, mm params.proj = idealSiProj(:,:,1); iminit = zeros(reconsize); it...