text
stringlengths
8
6.12M
function result = snap_images(suffix) colorDevice = imaq.VideoDevice('kinect',1); depthDevice = imaq.VideoDevice('kinect',2); % Initialize the camera. step(colorDevice); step(depthDevice); % Load one frame from the device. colorImage = step(colorDevice); depthImage = step(depthDevice)...
function [F] = LikelihoodDart(yi,yj) global data; global likelihoodRecord global etchRecord %change this back to unknown noise parameter eventually lh = normpdf(yi,yj); F = lh;
function [elevations, times, normlift, normdrag, normlinetension] = kite(length, V, m, S, rho, elevation0, AoKdeg, n, duree,omega0) % Cette fonction d�termine l'angle entre la ligne du kite et le sol en fonction du temps -> trajectoire du kite % Cette fonction a pour param�tres d'entr�e : % length : longueur de li...
%Find spindles with Peaks. Not YASA. %% Find location close all clear variables dname=uigetdir([],'Select folder with Matlab data of trial'); cd(dname) %% %Band pass filter design: fn=1000; % New sampling frequency. % Wn1=[100/(fn/2) 300/(fn/2)]; % Cutoff=100-300 Hz % [b1,a1] = butter(3,Wn1,'bandpass'); %Filter coef...
function [cloud] = readl2std_cloud(fn,iatrack,ixtrack); % function [cloud] = readl2std_cloud(fn,iatrack,ixtrack); % % Reads an AIRS level 2 Standard retrieval granule file and returns % a structure containing the full 3x3 two cloud retrieval info for % each specified AMSU FOV. % % Input: % fn = (string) Name of an...
function [center_by_min] = find_center_by_minimum(x,y,z,pseudo2_matrix,xr_plot,yr_plot,zr_plot) % calculate the center point of pseudo potential matrix by finding minimum %% calculate a new matrix by interpration [xq,yq,zq]=meshgrid(linspace(xr_plot(1),xr_plot(2),xr_plot(3)+1),linspace(yr_plot(1),yr_plot(2),yr_plo...
function ff = profile_(snd) croped_data1 end
load may30/lcmlog_2012_05_31_01.mat plotLogsXhat figure(25) clf plot(x,y,'bo'); hold on load may30/lcmlog_2012_05_31_03.mat plotLogsXhat figure(25) plot(x,y,'ro') axis([-1 5 -pi/2 pi/2])
function [Temp_User_1, Temp_User_2, Temp_User_3] = Mutation(User_1, User_2, User_3, Fixed_Devices) Temp_User_1 = mut_process(User_1, Fixed_Devices); Temp_User_2 = mut_process(User_2, Fixed_Devices); Temp_User_3 = mut_process(User_3, Fixed_Devices); function Temp = mut_process(obj, Fixed_Devices) Peak = [8 9 15 19...
%% Stelling 11 % % De input van een functie kan alleen een vector zijn. % Antwoord = NaN; % vul hier het juiste antwoord in 1 (WAAR) of 0 (ONWAAR)
function [ elipllical_sturct ] = ... Cross_sectional_FWHM_SL( input_parameters ) %This is to perfrom the ray casting measurents - the input is in a sturct % as % input_parameters % input_parameters.cross_sectional_image % input_parameters.rays % input_parameters.center % input_parameters...
function JacDotTimesVel = computeRevoluteJacobianDotV(ui, vi, vj, pose, velocity, acceleration) % computeRevoluteJacobianDotV computes numerically \dot{Jacobian} * velocity % Based on the formula: % \dot{f} = J * v, % \ddot{f} = \dot{J} * v + J * \dot{v}, we then have % \dot{J} * v = \ddot{f} - J * \do...
function [J_cost_all, J_const_all, param] = calc_inverse_gradients(feature_opt, c_gen, param) % pull out knots from the traj, then generate a spline-based traj from that q_opt_knot = feature_opt.q(:, param.intermed_ind); % param.spline_fit = calc_inverse_spline(y_opt_knot, param); % these spline calc includes +\- h % ...
%STDP Function %by Jonathan Gornet and DLevenstein %Last update: 4/8/2018 %INPUTS % W Weight Matrix % times Time when cell last spiked % tau "Targetted" spike rate % n Learning rate function [W,L] = STDP(W,x,n) L = []; for ii = 1:length(W(:,1)) Windex = find(W(ii,:) ~= 0); W(Win...
% Test Cases: % fourEverAlone('brian.png'); % fourEverAlone_soln('brian.png'); match1 = checkImage('brian_Alone.png','brian_Alone_soln.png'); % Output image(s) should be identical to that produced by solution file % % fourEverAlone('pepe.png'); % fourEverAlone_soln('pepe.png'); match2 = checkImage('pepe_Alone.png','...
classdef waitAtTheBar %waitAtTheBar A tiny wrapper around waitbar in class form. % % MIT License % % Copyright (c) 2018 Michael Breuer % % Permission is hereby granted, free of charge, to any person obtaining a copy % of this software and associated documentation files (the "Software"), to deal % in the Software withou...
function [ air, shum, level, grid ] = narr_import( date ) %NARR_LOAD Loads NARR Reanalysis date, downloads if not available locally % Read in netCDF date from Reanalysis % Using NARR Reanalysis 3-hour date: http://www.esrl.noaa.gov/psd/date/gridded/date.narr.html % ftp://ftp.cdc.noaa.gov/datesets/NARR/pressure/ %...
function shrinkedToolPaths = shrinkToolPaths(self, toolPath, shrinkLength) alighedToolPath = self.alighToolPaths(toolPath); for i = 1:size(alighedToolPath, 1) currentPaths = alighedToolPath{i, 1}; currentPaths = shrinkTop(currentPaths, shrinkLength); currentPaths = shrinkEnd(currentP...
%% See page 364 of % Higham, D. J. (2008). Modeling and simulating chemical reactions. % SIAM review, 50(2), 347-368. % ODE15s solution the Reaction Rate Equation for % the Michaelis-Menten system. % % Parameters from Chapter 7 of % Stochastic Modelling for Systems Biology, % by Darren J. Wilkinson, Chapman & Ha...
% Muestra las gráficas de los distintos pesos utilizados. Es necesario % cambiar las primeras líneas de código para elegir la tabla de datos a % graficar load Peso1.txt load Peso2.txt load Peso3.txt load Peso4.txt Fs=20000; Biceps=Peso1(:,1); %Se modifica "Peso1" por cualquier .txt Triceps=Peso1(:,2); %Se modifica "P...
function [RFRadius, nSpikesLog] = findRFRadius(dio, RF, stimScreen, stimWin, WHICHRIG) %Procedure to find the receptive field size after finding the x and y %midline locations. Procedure described in supplemental materials in %Bollinger and Gollisch, 2011 (Neuron) % Eric Trautmann - etraut@stanford.edu...
function [ hfig ] = plot_delta_tau_mix( pricer , tau ) %PLOT_DELTA_TAU 画delta~tau的图 % --------------------- % 沈杰,20160124 % 吴云峰,20160301,使用Copy的结果进行作图 % 吴云峰,20160316,按照刚哥的center取点的方法进行计算和hFig的输出判断方法 %% 预处理 % TODO: 相关预处理 % 在copy上面进行研究 copy = pricer.getCopy(); %% 作图程序 % 横轴tau默认值 if ~exist( 'tau' , 'var' ) longend...
function x = perform_saturation(x,tau,use_mad) % perform_saturation - saturate a vector for better contrast % % x = perform_saturation(x,tau,use_mad); % % tau (around 1) is the saturation factor % % copyright (c) 2007 Gabriel Peyre if nargin<2 tau = 1; end if nargin<3 use_mad = 1; end tau = 2; x = x-me...
function rectangle = points2rect(points) if (min(size(points)) == 1) x = points(1:2:end); y = points(2:2:end); else x = points(1, :); y = points(2, :); end; x1 = min(x); y1 = min(y); x2 = max(x); y2 = max(y); rectangle = [x1, y1, x2 - x1, y2 - y1];
clear;clc x=7; y=8; [a,b,c]=ML_ch08_func10(x); %輸入引數只有一個,就讓a2=0 disp(a) %x+y disp(b) %x-y disp(c) %(x+y)/2
% Aproksimirati funkciju f(x) = x^2*sin(x) polinomom 3. stepena na intervalu [-pi, pi]. f = @(x) x.^2 .* sin(x); a = -pi; b = pi; % Odabrati i nacrtati potreban broj tacaka funkcije f(x) za aproksimaciju polinomom 3. stepena. x = linspace(a, b, 4); fX = f(x); scatter(x, fX); hold on % Lagran�ovom interpolacij...
function out = fnta(X, r, opt) % % function out = fnta(X, r, opt) % Solve 3D nonnegative tensor decomposition. % % X -- Input tensor. 'ktensor' for 3D Nonnegative PARAFAC, % 'ttensor' for 3D Nonnegative Tucker. % r -- Rank of the approximation. r \in R for 3DNPARAFAC, % ...
function [tex] = TransformCh(obj,img) %TrandformCh Summary of this function goes here % Detailed explanation goes here dir = img(obj.mask1) * obj.alpha_pi; dir2 = 2*dir; nx = cos(dir); ny = sin(dir); nx2 = cos(dir2); ny2 = sin(dir2); tex = [nx + 1j*ny;nx2 + 1j*ny2] / (2*obj.n_face_pixels1).^(1/2)...
%% This function performs window match by means of Census transform. % The aggregation is performed by means of integral to calculate the sum of % rectangular area.The window size is adaptive % The cost function is based on hamming distance and a penalty on small window. function [D1,D2,C1] = Census_WM_adp(I1, I2, ws,...
function [vsigg, marrow, msiggloc] = sss2gradSM(data,h,pixpar,ess,sig2,alpha,idatyp) % SSSGRAD, Function for SSS2, this gets arrow matrix for significant gradient % First does 1st partials of Gaussian convolution smoothing % Then does test of significance % Finally gets info for plotting arrows % Steve M...
function [Qfp, x_stencil, y_stencil, c1, c2, c2b] = Interpolate_Fluid_To_Particle(N0, N5, M0, M5, NV, Index,... Order, Xp, Yp, dx, dy, x, y, Q) [x0, x1, y0, y1, cx, cy] = ENO_Interpolation_Setup(N0, N5, M0, M5, Order,... x, y, dx, dy); [c1 c2 c2b] = Divided_Differences(N0, N5, M0, M5, x, y, Q, Inde...
function [vals, xbar_vals] = process_lr_image(img_file, xbar_vals, ytick_vals, rotang, showfig) % Set defaults if ~exist('rotang','var'), rotang = 0; end; if ~exist('showfig','var'), showfig = false; end; % Read image [img,orig_img] = scrub_image(img_file, rotang); pixfact = size(orig_img,...
function setActivePoints(source,~) h = guidata(source); gui = guidata(h.guifig); time = gui.ctrl.slider.Value; frnum = floor(time*gui.data.annoFR)+1; gui.data.tracking.active(frnum:end) = {1:str2num(source.String)}; gui.data.tracking.inactive(frnum:end) = {str2num(source.String)+1:1e3}; %gonna... assume you...
clc; load GAF_Energy.mat EnergyPerRound; A1=EnergyPerRound; load GBP_Energy.mat EnergyPerRound; A2=EnergyPerRound; load BCDCP_Energy.mat EnergyPerRound; A3=EnergyPerRound; load GAF_LiveNode.mat AliveNodesPerRound; DT_C=AliveNodesPerRound; load GBP_LiveNode.mat AliveNodesPerRound; GEAR_CC=AliveNodesPerRound;...
function PR = radon(IMG, THETA) %% This MATLAB function takes an image matrix and vector of angles and then %% finds the 1D projection (Radon transform) at each of the angles. It returns %% a matrix whose columns are the projections at each angle. %% %% Written by : Justin K. Romberg % pad the image with zeros so we...
function RSS = AMIGO_RSS( sim_data,exp_data,iexps) %RSS = AMIGO_computeRSS( sim_data,exp_data,...) Computes the residuals sum of squares. % % RSS = AMIGO_computeRSS( sim_data,exp_data,iexp) % sim_data: matrix or cell array of matrices containing the simulated % data. sim_data{iexp} contains the data f...
function dt = logistic(t,n) r = 0.1; k = 100; dt(1) = r*n*(1-n/k); end
function [T_ow] = PositionObject() %PositionObject %Defines a 4x4 homogenous transformation that places an object %in space at a random location in world coorinates and at a %random orientation. T_ow means T:O->W i.e. the transformation % of Points in object coordinates into Points in World Coordinates. T_ow = zero...
// Belyi maps downloaded from the LMFDB on 03 August 2020. // Magma code for Belyi map with label 6T1-6_6_1.1.1.1.1.1-a // Group theoretic data d := 6; i := 1; G := TransitiveGroup(d,i); sigmas := [[Sym(6) | [2, 3, 4, 5, 6, 1], [6, 1, 2, 3, 4, 5], [1, 2, 3, 4, 5, 6]]]; embeddings := [ComplexField(15)![1.0, 0.0]]; ...
clc; clear all; img = imread("C:\Users\DELL\Desktop\Important\DIP\Lab_exp\cameraman.jpg"); img = rgb2gray(img); imshow(img); title("Home sweet home"); %sobel operator z=edge(img,'sobel'); figure; subplot(1,2,1); imshow(z); y= edge(z,'sobel',0.2); subplot(1,2,2); imshow(y); title('Sobel filtered image');...
function [PER, PEB, v_gray, pred_R, pred_B, cost_RB] = getPEs(Gray, img) warning off; % % addpath images\; % img=imread('lena.png'); R = double(img(:, :, 1)); B = double(img(:, :, 3)); % % G=double(img(:,:,2)); [ht, wd] = size(Gray); temp_dif_R = zeros(1, round(ht * wd / 2)); temp_di...
function x = chebyshev_zeros ( n ) %*****************************************************************************80 % %% CHEBYSHEV_ZEROS returns zeroes of the Chebyshev polynomial T(N)(X). % % Discussion: % % We produce the Chebyshev zeros in ascending order. % % Licensing: % % This code is distributed under t...
function [count] = GetRgbHist(filename) %GetRgbHist---获取图像直方图 %filename-----图像文件名或图像绝对路径 %count--------图像直方图 % info = imfinfo(filename); % I = imread(filename); [N1,N2] = size(filename); %info.BitDepth=24时计算的是RGB图像,否则是灰度图。 % if info.BitDepth == 24 [count1,x] = imhist(filename(:,:,1)); %计算R通道的直方图 [count2,x] ...
function data_process_nii_2_mat(filePath, savepath) % data processing normalization and histgromatching % % filePath = '/media/liangqiong/Data/liangqiong/Research/DeepLearning/Demo/Dataset/Orig_15/3T7T-Data/' % savepath = '/media/liangqiong/Data/liangqiong/Research/DeepLearning/Demo/WATNet/matlab/demo/data_processing/...
lis = [10, 12, 18, 21, 22, 29, 33, 37, 41, 42, 43]; PatientsData = ModelFeatures(lis); for i = 1:length(lis) PatientsData(i).brain_pos = ModelData(lis(i)).brain_pos; PatientsData(i).brain_neg = ModelData(lis(i)).brain_pos; PatientsData(i).pos_idx = ModelData(lis(i)).pos_idx; PatientsData(i).neg_idx = Mo...
clear; clc; close all; data = readtable('iris.txt'); data.Properties.VariableNames{1} = 'sepal_length'; data.Properties.VariableNames{2} = 'sepal_width'; data.Properties.VariableNames{3} = 'petal_length'; data.Properties.VariableNames{4} = 'petal_width'; data.Properties.VariableNames{5} = 'species'; x1 = t...
function [ SavedW ] = eulrig( I_in, W_in ) %RIGID2 Simulates rigid body motion % displays plot showing the location of the angular velocity vector % in a frame fixed in the rotating body I1 =I_in(1); I2 = I_in(2); I3 = I_in(3); I = [I1; I2; I3;]; % we only need diagonal terms % set up initial conditions W = W_in; ...
function [shift_y shift_x] = overlapBF(image_label,start_frame,end_frame,exclude_y_top,exclude_y_bot,exclude_x_left,exclude_x_right,show_plots,saveplot) % % Isabel Llorente-Garcia: August 2011. % If you use this code please acknowledge Isabel Llorente-Garcia in your % publications. % % For Bright Field Images, to find...
%% Q3.a) % Read audio file .wav [x,Fs] = audioread('hw1_echo.wav'); sound(x,Fs); % Compute autocorrelation sequence [acorrX,lagX] = xcorr(x(:,1),x(:,1)); % Plot autocorrelation function figure(1) plot(lagX,acorrX,'LineWidth',2.5) xlabel('Lag'); ylabel('Sample Autocorrelation'); title('Autocorrelation fu...
clear; A = [1 2; 3 4; 5 6]; B = [1 2 3; 4 5 6]; A = magic(4) A(:,1:2) A = magic(10) x = [1; 2; 3; 1; 2; 3; 1; 2; 3; 1] v = zeros(10, 1); for i = 1:10 for j = 1:10 v(i) = v(i) + A(i, j) * x(j); end end % v = A * x is correct v = [1 2 3 4 5 6 7] % column vector w = [11 12 13 14 15 16 17] % column vector z ...
function [J, grad] = costNN(params_rn, num_attribs, nodos_ocultos, num_etiquetas, X, y, lambda) % Capturar las matrices de pesos originales Theta1 = reshape (params_rn(1:nodos_ocultos * (num_attribs + 1)), nodos_ocultos, (num_attribs + 1)); Theta2 = reshape (params_rn((1 + (nodos_ocultos * (num_attribs + 1))):end...
% snesim : runs snesim with parameter file or snesim structure % % Call : % snesim('snesim.par'); % % S=read_snesim('snesim.par'); % S.nsim=10; % snesim(S) % % S=snesim_init; % S.nsim=10; % snesim(S) % % %% % S=snesim(S,1:1:10,1:1:10,1); % % % Source code for SNESIM can be downloaded here: % https:/...
function eta = funcFit_Arrhenius(parasNum, T, constNum) % funcFit: Arrhenius % temperature - degC eta_0 = constNum(1); T_0 = constNum(2); eta = eta_0 * exp(parasNum(1)/8.314*(1./(273.15+T) - 1/(273.15+T_0))); end
function ShowBandLU(A,p,q) % function ShowBandLU(A,p,q) % Illustrates band LU of a matrix A that has an LU factorization and % lower bandwidth p and upper bandwidth q. % A call of the form ShowBandLU() generates a random 7x7 example % with lower bandwidth 2 and upper bandwidth 3. if nargin==0 p = 2; q...
% $Id$ wtf = 0; if wtf fid = fopen( 'gksvd.log', 'w' ); else fid = 1; end; tol = 1e-10; fprintf( fid, 'TEST GKSVD\n' ); fprintf( fid, 'We compute singular values of a test matrix using the MATLAB svd(),\nand then using our implementation of' ); fprintf( fid, 'the Golub-Kahan SVD algorithm,\nand display the...
%% Frequency-Bessel Method r0 = 50; dz0 = 2.5; inum = 50; x = r0+dz0:dz0:r0+dz0*inum; x = x * 1000; v = linspace(3.5,5.5,100); v = v * 1000; tmax = 140; t = Uz(:,1); data = Uz(:,2:end); r0 = zeros(1,2048); [I,f] = freq_bessel_trans(data,x,t,v,r0);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright 2018 Crypto4a Technologies Inc. % % Permission is hereby granted, free of charge, to any person obtaining a % copy of this software and associated documentation files (the "Software"), % to deal in the Software without restriction,...
% 计算lambda % 需要已知 u v w p q r v_1 v_2 delta_l,u u_H1B1 = u+z_H1*q - y_H1*r; v_H1B1 = v+x_H1*r - z_H1*p; w_H1B1 = w+y_H1*p - x_H1*q; u_H2B2 = u+z_H2*q - y_H2*r; v_H2B2 = v+x_H2*r - z_H2*p; w_H2B2 = w+y_H2*p - x_H2*q; V_H1B1 = [u_H1B1;v_H1B1;w_H1B1]; V_H2B2 = [u_H2B2;v_H2B2;w_H2B2]; V_H1H1 = L_H1B1 * V_...
clear; tic; d = 50; % In km lambda_l = 10; % Density of point process along the axes that gnnerates lines lambda_c = 0.5; % Density of points points/km (1 per km) num_iterations = 100000; % INITIALIZING VARIABLES min_dist_d1(num_iterations) = 0; min_dist_d2(num_iterations) = 0; min_dist_x1(num_iterat...
function [inds]=getpoints(linenum,pointlist,except) if~(exist('except','var')) except=0; end inds=[]; len=length(pointlist); for i=1:len if( (~isempty(find(pointlist(i).lines==linenum, 1)))&& ... (isempty(find(pointlist(i).lines==except, 1)))) inds=[inds i]; end end end
%% Execute this to perform the experiments shown in %% Bradley, Hülse, LaRowe, Arndt (2022, NatComms) %% plot boundary conditions plot_BC_MS %% Run global analysis and create summary output folders % default values for porosity and sedimentation rate SA_value = 1.0; [res, BE_depth, Flux_depth, Total_burial_depth, T...
function [im1, gt1, prev_mask1, bg1, im2, gt2, prev_mask2, Flow_B, Flow_F]= lucid_dream(img,gt,consequent_frames,bg) % Input: % img - image % gt - ground truth segmentation mask % Output: % im* - synthesized image (im1, im2) % gt* - synthesized mask (gt1, gt2) % prev_mask* - synthesized previous ...
function this = redate(this, oldDate, newDate) % redate Change time dimension of time series. % % Syntax % ======= % % X = redate(X, oldDate, newDate) % % Input arguments % ================ % % * `X` [ tseries ] - Input time series. % % * `OldDate` [ numeric ] - Base date that will be converted to a n...
%% Calculate daily GPP using MODIS algorithm; Plot comparison between MODIS GPP (algorithm & satellite) vs. EC GPP % MOD17a1 % GPP (g C m-2) = LUE_max * 1e3 * Rshort * 86400 * 1e-6 * 0.45 * fAPAR * Tmin_SCALAR * VPD_SCALAR clear all load('HF_2013_GPP.mat','gpp_day'); %GPP Data from MODIS %Integrate 8-day GPP EC data...
%% global mSerial1; mSerial1 = serial('COM4'); set(mSerial1, 'BaudRate', 9600); mSerial1.BytesAvailableFcn = @(handles, eventdata)update_ft(hObject, ... eventdata); mSerial1.BytesAvailableFcnCount = 57; mSerial1.BytesAvailableFcnMode = 'byte'; %% fprintf(mSerial1, '%s', 'QS\r'); %% function update_ft(hObject, ...
%Problem2b clear clc dt = 0.01; et = 2; x = 0:dt:et; y = x.^0.5; plot(x,y,'g');
function [c,ceq] = pdfcon(x) N = length(x); vec = 1:N; c = -[sum(x.*vec.^2) - sum(x.*vec)^2 ]/N + 0.75; %%%% -x <=0 ceq = sum(x) - 1; return;
function phi = compute_phi(n,g_prime,t0) % Computes the exact solution of the time-domain boundary integral equation % S\phi=g on the unit sphere and for special right-hand sides g. % % Input arguments: % n: For n=0 we have g(x,t)=g(t) a purely time-dependent right-hand side. % For n=1 we have g(x,t)=g(t)Y_1...
function varargout = statsGUI(varargin) % STATSGUI M-file for statsGUI.fig % STATSGUI, by itself, creates a new STATSGUI or raises the existing % singleton*. % % H = STATSGUI returns the handle to a new STATSGUI or the handle to % the existing singleton*. % % STATSGUI('CALLBACK',hObject,eventDa...
function [output] = acyclic(graph) % Summary of this function goes here % Detailed explanation goes here output = True; end
classdef Solver %SOLVER Solver class % Solves a specific control problem, given objects of both the CTRL_Prob and the GP_Prob classes. % Supports: mixedHinfsyn % TODO: conversion of mimo to MISO or SIMO properties method = 'none'; % Solver to use: mixedHinfsyn, compute_...
function c = calculateCentroid(beta) % Compute the centroid (center of mass) of a continuous curve beta. The % formula for center of mass is c = (1/L) * \int_0^1 \beta(t)|\dot{\beta}(t)|dt, % where L = \int_0^1 |\dot{\beta}(t)|dt is the length of the curve. % % Inputs: % beta - n x p matrix, i.e., an n-tuple...
function [multiplier, inputs] = visualsubtraction(x1, y1, x2, y2, multiplier, varargin) if nargin == 6 % extra argument gives prompt message prompt = varargin{1}; else prompt = 'Do Something: '; end inputs = cell(length(multiplier), 1); i = 1; if ~ishold figure...
%% Script to build graph from segmented images function [Area,normal,GrainBondSets,CCbonds]=GraphBuild2(bonds,CCgrains,labelgrn) % [Graph,u,v,CCbonds,From,To,Area,normal,GrainBondSets]=GraphBuild2(bonds,CCgrains,labelgrn) %% Identify and label Discrete grains and bonds. Commented out b/c this is now done externally Si...
function img_blue = seleciona_cor(path_img_original, cor) %{ * Script que troca a escala de uma imagem de RBG para Gray. path_img_original: string - caminho para a imagem a ser transformada img_cinza: uint8 - versao, em escala de cinza da imagem %} % leitura da imagem img_original = imread(path_img_original); ...
classdef plots methods(Static) function slider(src, event) ax = get(src,'userdata'); c = caxis(ax); v = get(src,'value'); t = get(src,'tag'); switch t case 'min' assert(v<c(2),'Image caxis min must be l...
function p=resamplevs0(dt) %this function resamples vs zero by taking 2/3 of the distribution and %testing vs zero 1000 times, returning the probability that the %distribution has the same sign as the mean vs zero %% if mean(dt)==0, error('distribution has 0 mean','distribution has 0 mean'), end gt0=mean(dt)...
clear all; close all; % Finding data L = 50; p = linspace(0.5,0.65,80); PI = zeros(length(p),1); experiments = 100; for i=1:length(p) i for k=1:experiments r = rand(L,L); z = r<p(i); [lw,num] = bwlabel(z,4); img = label2rgb(lw,'jet','k','shuffle'); s = regionprops(lw...
function [sparse_point,sparse_weight] = test_sgmga(type,dim_num,itest,level_max,plotyn) tol = sqrt(eps); % spatial dimensions % dim_num = 2; % itest = [1;1]; % level_max = 2; % anisotropy (see description in sgmga_importance_to_aniso.m) importance = zeros(dim_num,1); for dim = 1 : dim_num importance(di...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Symmetry Based Analysis of Facial Expressions Partially Occluded Due to Head Motions % Version : 1.0 % Date : 01.2.2017 % Author : Mehdi Ghayoumi %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
plot(Uout(1:80),Rout(2:81),Uout(1:80),Sout(2:81)) legend ('Bacterias resistentes','Bacterias sensibles') ylabel('Salida adimensional') xlabel('Entrada(u_1)') title('Curva de linealidad')
function [modeleChoisi, statsADF, statsPP] = TestStationnarite(y) %% Mise en place y_diff = diff(y); n = size(y,1) - 1; x1 = lagmatrix(y,1); x1_diff = lagmatrix(y_diff,1); y = y(3:end,:); x1 = x1(3:end,:); y_diff = y_diff(2:end,:); x1_diff = x1_diff(2:end,:); %% ...
function [xe, xo, n] = evenodd(x,n) % real signal decomposition into even and odd parts % ------------------------------------------------- % [xe, xo, n] = evenodd(x,n) % if any(imag(x)~=0) error('x is not real sequence') end m = -fliplr(n); m1 = min([m,n]); m2 = max([m,n]); m = m1:m2; nm = n(1)-m(1); n1 = 1:length(...
function [ var ] = LoadVar( pathitem, filename, varname ) %LOADVAR Load a varable from a MAT-File located in the same folder of %pathitem % Detailed explanation goes here if nargin==2 [~, varname, ~] = fileparts(filename); end path = fileparts(which(pathitem)); filepath = fullfile(path,[filename,'.mat']); if e...
function [meanResp, calciumResp] = ComputeBLModelResponse(stimArray, p, f) %UNTITLED Summary of this function goes here % Detailed explanation goes here %% Compute photoreceptor responses % Blur the filter in space (assumes periodic boundary conditions) if p.useSpatialFilter blurArray = fftshift(ifft(fft(f.spat...
function [res_I, res_E] = trex_converter2(handles, hplot) [I_tc, E_tc]=LiTrack_prepXtcavData('TREX-Sample-2015-04-01-144547.mat'); Extcav=E_tc(2,:); Ex_tc=E_tc(1,:); Ixtcav=I_tc(2,:); Ix_tc=I_tc(1,:); [I_lt,E_lt]=LiTrack_prepData(handles); Elitrack=E_lt(2,:); Ex_lt=E_lt(1,:); Ilitrack=I_lt(2,:); Ix_lt=I_lt(1,:); le...
%function newEvent = findDinDuration(event) %This function finds runs of consectutive events and codes their durations function newEvent = findEventDuration(event) nEvents = length(event) newEvent = event; eventNames = unique({event.value}); curEventIdx = 0; for iEventType=1:length(eventNames), thi...
function outHex = ScaledDownAESInvSBox(inHex) % outHex = ScaledDownAESInvSBox(inHex) % Input: inHex = a single hex character (a nibble) % Output: outHex = the corresponding single hex character representing the % output of the scaled down AES INVERSE S-box of Table 11.2 %First we create a 4 by 4 matrix of Table 11...
function sweep() hold all; calories = linspace(0, 5000, 50); pf = linspace(0,1,50); for j = 1:length(pf) for i = 1:length(calories) M = IbuprofenTimeSeries3(pf(j),calories(i)); Q(j,i) = max(M(:,5)); end end plot(Q) ...
function [y_plot,z_plot,potential_plot] = Plot_YZ_static_way2(plot_switch,plot_density,xr_plot,yr_plot,zr_plot,x_want,x,y,z,static_matrix,title_txt) %calculate and plot the pseudo_potential's YZ plane [xq,yq,zq]=meshgrid(linspace(xr_plot(1),xr_plot(2),xr_plot(3)+1),linspace(yr_plot(1),yr_plot(2),yr_plot(3)+1),li...
[H,r,c] = harris_corner_detector('./person_toy/00000001.jpg', 0.01);
function saveasAvi_1component(matFilesPath, matFilesPrefix, aviFilesPath, aviFilesPrefix, ... radius, nSides, quadrantCut, component) %% combining output from multiple .mat output files and saving a video. close all; files = dir([matFilesPath filesep matFilesPrefix '*.mat']); nTimePoints = numel(files); %nTimePoi...
filefolder = 'C:\Users\praveen\Desktop\imgp\4\Input Images\'; imagefiles = dir(fullfile(filefolder,'*.*')); nfiles = length(imagefiles); for i=[4] filename = imagefiles(i).name; fullfilename = fullfile(filefolder,filename); im2 = imread(fullfilename); [row column depth] = si...
function [muE0, Phi, Theta, Kappa, Pi] = impactFunctions(... materialNames, ... materialsDir, ... E0, ... Emin, ... Emax, ... modelEdge, ... EKappa, ... epsilonKappa, ... modelPairProduction, ... interactive) % [muE0, Phi, Theta, Kappa, Pi] = impactFunctions(... % materialNames, ... % materialsDir, ... ...
K=10; flagtmp= zeros(K,K,K,K); for xx=1:K for yy=1:K for zz=1:K for ww=1:K if two_elec_gauss(xx,yy,zz,ww) ~=0 two_elec_gauss(yy,xx,ww,zz)=two_elec_gauss(xx,yy,zz,ww); two_elec_gauss(ww,zz,yy,xx)=two_elec_gauss(xx,yy,zz,ww); two...
function outparams = FittingWrapper (echotimes, tesla, Smeasured, sig, GT) %noise SD needed for Rician fit %function outparams = FittingWrapper (echotimes, tesla, Smeasured, sig, GT) % Description: Fitting 'wrapper' implements standard Gaussian, Rician and % complex fitting and generates outputs for each % % Input: % ...
function [y,tc] = FreqTransform(x,fs) % y=rfft(x); [y,tc]=melcepst(x,fs); end
function [r,az,el,x,y,z,vects] = data_check() opts = {['*','*'],['1','*'],['2','*'],['*','1'],['*','2']} opts_labels = {'all: NH session 1','all: NH session 2', ... 'all: Tin session 1','all: Tin session 2' ... 'all:run 1','all: run 2',... 'NH session 1','NH session 2',...
function g = sigmoidGradient(z) % Computes the gradient of the sigmoid function for input z % Input: z - input vector or scalar % Output: g - output vector or scalar % % Written by Arnold Yeung % Date: June 29, 2013 % arnoldyeung.com g = zeros(size(z)); g = sigmoid(z).*(1-sigmoid(z));
%% Uppgift1 r = 4; A = pi * r^2; %% Uppgift2 x = 0:0.1:pi*4; f = sin(x) + 0.3 * sin(5 * x); plot(x,f) %% Uppgift3 s = 0; for i=1:5 s = s + i^2; end %% Uppgift4 x = linspace(-10, 10); y = my_func(x); plot(x,y) fzero(@my_func,1) function y=my_func(x) y = x.^2 - cos(x); end %% Uppgi...