text stringlengths 8 6.12M |
|---|
function img = projectImage(im, dist)
% Projects image into cylindrical coordinates.
% Assuming that the images for the mosaic are taken from the same camera.
im = double(im);
if(size(im,3) == 3)
im = cat(3, im, ones(size(im(:,:,1))));% add alpha channel
end
imsize = size(im);
[X,Y] = meshgrid(0:imsize(2)-1, 0:... |
function [ir,wold]=impulse(A,CI,ndet,p,nsteps)
n=size(A,1);
A=varcompanion(A,ndet,n,p); %A is without deterministic variables
J=[eye(n) zeros(n,(p-1)*n)];
ir=[];
wold=[];
for h=0:nsteps
wold=cat(3,wold,(J*(A^h)*J'));
ir=cat(3,ir,(J*(A^h)*J')*CI); %cat concatenates arrays: cat(dimension,A,B)
end
... |
function [ result ] = TSwriteoutfunctions(ScriptName)
% Reads the script (.m) or text (.txt) file SCRIPTNAME containing TSlib
% functions, reads each function, and writes it into a file with the name
% of that function. The file name passed in (ScriptName) must have either
% the .m or the .txt extension included.
res... |
function new_adj_qual_mat=Find_High_Qual_Pts(adj_qual_mat)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Find_High_Qual_Pts function finds those point pairs that have high
% ellipse fitting quality
% Params:
% adj_qual_mat is the quality matrix of adjacent point pairs
... |
%%% Configuration File for main
%%% Permits various adjustments to parameters of the Visual Odometry Algorithm
%% Path to the directories containing images
path1 = '../data/DataSet1/image_00/data/';
path2 = '../data/DataSet1/image_01/data/';
% Number of images in the dataset
Files = dir(strcat(path1,'*.png'));
NumDat... |
function x = laplacernd(mu,b,sz)
%LAPLACERND Generate Laplacian random variables
%
% x = LAPLACERND(mu,b,sz) generates random variables from a Laplace
% distribution having parameters mu and b. sz stands for the size of the
% returned random variables. See [1] for Laplace distribution.
%
% [1] http://en.wikipedi... |
function [ gamma ] = getOptimalGamma_KKT_NodesNum( lambda, t_tilde, T_tilde, P_tilde, z, relay_idx, sensor_flag )
%GETOPTIMALGAMMA Summary of this function goes here
% Detailed explanation goes here
% T_tilde is of size 1*36
% P_tilde is of size 1*17
% B is of size 17*1
global T_frame B S_num R_num x_s alpha_in... |
classdef RobotObj < handle
%wrapper of robot object
% under development
% Yu Zhao, Aug04, 2017
% public properties
properties
ModelName; % model name of of robot
end
% hidden but public properties
properties (Hidden)
r; % struct contains robot parameters
rtb... |
v = zeros(10,1)
for i = 1:10,
v(i) = 2^i;
end;
fprintf('Program paused, press enter key to conitnue. \n');
pause;
v
indeces = 1:10;
for i = indeces,
disp(i);
end;
i = 1;
while i <= 5,
v(i) =100;
i = i + 1;
end;
i = 1;
while true,
v(i) = 999;
i = i + 1;
if i == 6,
break;
end;
end;
disp(v);
v(1) =... |
% https://www.mathworks.com/matlabcentral/answers/36430-plotting-the-frequency-spectrum
% selecteer de data
area = dailyArea(:, 4);
% Fourier-transformatie
X = fft(area);
% Time specifications
Fs = length(X); % samples per second
dt = 1/Fs; % seconds per sample
StopTime = 1; ... |
function [m]=MyFunction(x,y)
%Evaluates the function F(x,y)=3*y^(4/3) at inputed point (x,y)
m=3*(y.^4).^(1/3);
end |
clearvars -except m
close all;
clc;
%% デバイスの設定
if exist('m','var')
discardlogs(m)
else
m = mobiledev;
end
%% 初期設定
% 加速度(Acceleration):[m/s^2]
% 角速度(AngularVelocity):[rad/s]
% 磁場(Magnetic):[μT]
% 方向(Orientation):[方位、傾斜、回転 deg]
m.SampleRate = 'high';
m.AccelerationSensorEnabled = 1;
m.Angula... |
s=0;
n=input('Enter how many number: ');
for i=1:n
x=input('Enter a number: ');
s=s+x;
end
if n>0
avg=s/n;
disp(avg);
else
disp('No data');
end |
function r = funceval(f, varargin)
%FUNCEVAL calculates the value of the function f at the face variable phi
% f must be able to accept matrices
% f: function handle
% phi: input to the function f
% r: output of the function f
% f can handle 3 input phi variables, but they should all be of the same
% class
%
% SYNOPSIS... |
/**/
/////////////////////////////////////////////////////
// useful functions for the otehr packages
// Stefano Marseglia, Utrecht University, s.marseglia@uu.nl
// http://www.staff.science.uu.nl/~marse004/
/////////////////////////////////////////////////////
/*
LIST of functions
AllPossibilities := function(S)
*/
... |
function [ objectIndex ] = getScenario_concentricRing(varargin)
% This function designs a typical three agent, three waypoint collision
% scenario.
% The scenario consists of the following:
% - 3x agent_vectorSharing_interval agents.
% - 3x waypoints
% The agents are positioned in a ring, with the waypoints at the app... |
function [hf]=figuremax(varargin)
% function [fig]=figuremax(Cbg,Cdef)
% ------------------------------------------------------------------------
%
% This function opens a maximized figure window using the color settings
% specified.
%
%
%
% Kevin Mattheus Moerman
% gibbon.toolbox@gmail.com
%
% 30/09/20... |
function spikes = ss_energy(spikes)
% UltraMegaSort2000 by Hill DN, Mehta SB, & Kleinfeld D - 07/12/2010
%
% ss_energy - Interface energy based cluster similarity computation.
%
% Usage:
% spikes = ss_energy(spikes)
%
% Description:
% SPIKES = SS_ENERGY(SPIKES) adds an interface energy matrix to a
% spi... |
function copygraph(listname,conntype,randomise)
loadpaths
loadsubj
if ~exist('randomise','var') || isempty(randomise)
randomise = false;
end
subjlist = eval(listname);
if randomise
savename = sprintf('%s%s\\graphdata_%s_rand_%s.mat',filepath,conntype,listname,conntype);
else
savename = sprintf('%s%s\\gr... |
clear;close all;clc;
eegFS = 2000;
nyq = eegFS / 2;
attenHz = 4; %attenuation bandwidth (between Fstop1 and Fpass1)
attendB = 40;
%define bands
bandWidth = 20;
bandCenters = 20:2:180;
bandST = bandCenters-bandWidth/2;
bandED = bandCenters+bandWidth/2;
bands = [bandST; bandED]';
fn = 'filtersGamma_fs2000_40dB_4H... |
% MXLDWTC.M
% Sets text for dwell (in microseconds)
% Called by MXLXM
% Sets mxldwell (in mmgdwelr incr)
mxldwell = str2num(get(mxluidwt, 'String')) ;
if isempty(mxldwell);
set(mxluidwt, 'String','ERR', ...
'BackGroundColor', 'red')
else ;
if mxldwell < 0 ; % less than min
set(mxluidwt, 'String','ERR', ...
'... |
function [im, clim] = nantowhite(cvals, clim, cmap)
% Get the default color map.
if(nargin < 3); cmap = get(0,'DefaultFigureColormap');
elseif(ischar(cmap)); cmap = feval(cmap,64);
end
ncolors = size(cmap,1);
% Determine the range of the color values provided.
finites = isfinite(cvals(:));
if(~any(finites))
cvalm... |
function M = createPolynomialFeatures(Raw_M)
Raw_MX = Raw_M(:,1:end-1);
CDR_Y = Raw_M(:,end);
%% Create correlation vector for each feature with CDR vector
%% Final columns : (1) M/F (2) Age (3) EDUC (4) SES (5) MMSE (6) eTIV (7) nWBV (8) ASF
cols = size(Raw_MX,2);
for i = 1:cols
corr_vec(i,1) = corr(... |
d_results = dir('./results');
bounds = zeros(length(d_results)-2, 6);
j = 0;
for i = 1:(length(d_results)-2)
fout = fopen('./passedSizeTest.txt', 'a');
file = fopen(strcat('./results/', d_results(i+2).name), 'r');
%fscanf(file, '%[##Only one Component]');
bound = fscanf(file, '%f', [1,6]);
... |
clear all
close all
t=cputime;
%Version 1.1
%Calculates the approximate solution of a known test function
%Uses numerical integration instead of symbolic integration
%The length of the testing regions can be varied
%The number of intervals can be varied
%The starting point of the testing region can be varied
%Input t... |
%GM_PHD_Estimate
%Last modified 27th August 2013
%Matlab code by Bryan Clarke b.clarke@acfr.usyd.edu.au
%This file estimates the positions of targets tracked by the PHD filter.
%We need to extract the likely target positions from the PHD (i.e. we need to find the peaks of the PHD).
%This is actually fairly tric... |
function [success description] = testscript()
% do something
success = 1;
description = sprintf(['This being a precise ' ...
'error description for %s.'], ...
mfilename);
|
%% IIR coefficient quantization example
clear, clc, close all
%addpath('D:\Jose\Dropbox\research\codes\f')
addpath('C:\Users\Joe\Dropbox\research\codes\f')
b = [0.010046712776130
-0.049403687598540
0.150473361914200
-0.319871360898680
0.533358728622120
-0.711330379244980
0.784624125948800
-0.711330379244980
0.5333587... |
% plot_genotype_frequency.m
%
% Plot the 580Y and plasmepsim double copy frequency at a national level.
% Much of this is the same as plot_frequency_treatmentfailures and could be
% refactored.
% Generate plots based upon the summary input files
function [] = plot_genotype_frequency(directory, startDate)
files = ... |
%% Esempi di errore
figure(1)
img_nprocs = imread('errore_nprocs.png');
image(img_nprocs)
title('Errore: numero di thread non positivo');
figure(2)
img_dim_neg = imread('errore_num_intervalli_non_intero.png');
image(img_dim_neg)
title('Errore: numero di intervalli non è un intero');
figure(3)
img_dim_neg = imread('e... |
%%%%%%%%%%%%%%%%%%%%%%%%%
%%% MASTER_behavior.m %%%
%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Generates Figure 1b in Carey & van der Meer (2015) and associated stats
%
% NOTE: getTmazeDataPath() will need to be configured correctly for your
% machine. This is the function that needs to know where your data files
% are.
%% get ses... |
function [ radius_c ] = orbit_convert(radius, elem)
%%Simple function to convert from orbit reference frame to body reference
%%frame
%% Sin and Cos terms
% Precomputing sin and cosine terms to make the rotation table easier to
% read. W = angle to line of nodes, i = incliniation angle, w = angle to line of
% a... |
% facedist_rsa_plots_meanslopes(figdir,res,groupres,predictors,varargin)
function facedist_rsa_plots_meanslopes(figdir,res,groupres,predictors,varargin)
nroi = numel(res.cols_roi);
mkdirifneeded(figdir);
glmmode = false;
if ~any(strcmp(res.rows_contrast,'face01'))
% get the customfits (gives us x values)
cust... |
clc;
clear all;
close all;
C=zeros(1,400);
for i=1:1000
f=uint8(randi([0,255],20,20));
g=Hist_Equalization(CorrectLight(f));
g(1,1:4)=0;g(1,17:20)=0;
g(2,1:3)=0;g(2,18:20)=0;
g(3,1:2)=0;g(3,19:20)=0;
g(4,1)=0;g(4,20)=0;
g(17,1)=0;g(17,20)=0;
g(18,1:2)=0;g(18,1... |
function [start_x, start_y, height, width] = findBoxFromSiftFrames(frames)
% (start_x, start_y) is the upper left corner of the box
x = frames(1,:)
y = frames(2,:)
Xs = sort(x,'ascend');
Ys = sort(y,'ascend');
length(x);
x_min = Xs(20);
x_max = Xs(length(Xs) - 20);
y_m... |
function result = result_function(centers, targets, coefs, division_coef, nb_iteration, pt)
%% Applies the forward transformation given as [centers, targets, coefs, division_coef, nb_iteration]
% to the points in pt
[dim,l] = size(pt);
if numel(division_coef) == 1
division_coef = repmat(division_coef,1,nb_iteratio... |
function NXTLineFeedback(maxpower, distance)
% Parameters: r=5.6cm, l = 5.8cm, kp = 3, ka = 8, kb = -1.5, dt=0.1
MoveWithFeedBack(distance, 0, 0, maxpower, 5.6, 5.8, 3, 8, -1.5, 0.1);
|
% *************************** Disclaimer **************************************
% This program is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
% or FITNESS FOR A PARTICULAR PURPOSE. Feel free to use this code for academic
% purpose... |
n= -5:1:5;
x1=[zeros(1,5) 1 zeros(1,5)];
x2=5*[zeros(1,5) 1 zeros(1,5)];
y1=sin((pi/2)*x1);
y2=sin((pi/2)*x2);
subplot(3,1,1);
stem(n,x1);
title('1.4 (d)-1');
xlabel('n');
ylabel('x_1[n]');
subplot(3,1,2);
stem(n,x2);
title('1.4 (d)-2');
xlabel('n');
ylabel('x_2[n]');
subplot(3,1,3);
stem(n,y1,'b--s');
hold on;
stem... |
% Order the Giant Monster into different grips
clear all
cd('/Users/jolandefooken/Dropbox/TermProjectSenMo/Analysis/logs/AllData')
load('/Users/jolandefooken/Dropbox/termprojectsenmo/Analysis/logs/AllData/NormalizedMonster.mat')
load('/Users/jolandefooken/Dropbox/termprojectsenmo/Analysis/logs/AllData/PredictedVector... |
function pose = getLast3Dpose(values, marginals)
%getAll3Dposes get the 3Dpose location and covariance from the result
% poses.cord{i} saves the coordinate of the ith point
% poses.cov{i} saves the covariance of the ith point
import gtsam.*
keys = KeyVector(values.keys);
% Plot points and covariance matric... |
% Represent the model for the tumor, hunting and resting cell interaction
syms r1 r2 k1 k2 a1 a2 b d1 d2
assume ([r1 r2 k1 k2 a1 a2 b d1 d2], {'real','positive'})
syms M N Z
assume ([M,N,Z], {'real','positive'})
g = k2*(r2-d2)/r2;
t = num2cell(zeros(9,1));
[m0,m2,m4,n0,n1,n2,n3,z0,z1] = deal(t{:});
t1 = num2cell([... |
function varargout = LIBSLogicTree(varargin)
%#ok<*INUSD>
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @LIBSLogicTree_OpeningFcn, ...
'gui_OutputFcn', @LIBSLogicTree_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callb... |
function x=idd2(Y)
%IDD2 Single-level inverse discrete 2-D wavelet transform.
% IDD2 performs a single-level inverse 2-D wavelet reconstruction
% using Daubechies wavelet with four coefficients
%
% Y = IDD2(X) computes the original signal from the approximation
% coefficients matrix LL and details coeffic... |
classdef StudyDirector
%% STUDYDIRECTOR is a high-level, study-level director for other directors and builders in the package.
% $Revision$
% was created 28-Sep-2017 22:19:06 by jjlee,
% last modified $LastChangedDate$ and placed into repository /Users/jjlee/Local/src/mlcvl/mlraichle/src/+mlraichle.
%% It w... |
function [a0,a,b,coef_c,phase,fxt] = s2f(x, T0, N, astate)
% 's2f' Plots you function 'x(t)', its fourier series representation and
% Mag/Phase Plots
%
% Formating s2f(x, T0, N- astate)
%
% Input:
% x = symbolic function (WRT t)
% T0 = Your function x(t)'s Period
% N = Number of samples to t... |
function plot_descriptor(V,F,f,string)
% Copyright (c) 2014.03.30 Shuhua Li
for i=1:size(f,2)
figure('name',string); set(gcf,'color','white');
options.face_vertex_color=f(:,i);
h = plot_mesh(V, F, options); view3d rot;
set(h, 'edgecolor', 'none'); %set(h, 'FaceAlpha', 1);
axis off; axis eq... |
% assignOpts Assign values for optional agruments to the workspace.
%
% optsCellOut = assignOpts(optsCellIn) assigns variable-value pairs to the
% workspace, returning any unassigned variables.
%
% It will accept a cell as input. It is expected the length of this cell
% will be even and will consist of pairs of entri... |
function [comments, treeIdx, nodeIdx] = getAllComments( skel, treeIndices )
%GETALLCOMMENTS Get the comment strings for the specified trees.
% INPUT treeIndices: [Nx1] int or [Nx1] logical
% Linear or logical indices for the trees of interest.
% (Default: all trees)
% OUTPUT comments: [Nx1] cell
% ... |
function [Qcalc] = Qcalc(Wsoll, Qstart, DH)
%Definieren der Gelenkwinkel als Variabeln
syms q1 q2 q3 q4 q5 q6 real
q = [q1 q2 q3 q4 q5 q6].';
%Erstellen der Transformationsmatrixen in Abhängigkeit der Gelenkwinkel
for i = 1:6
T(:,:,i) = [
[cos(q(i)) ... |
function wdisp = disp_dft_kun4D_lint(qh,qk,ql,en,varargin)
% interpolate and expand numerical DFT data over whole q-dE space using
% Matlab's 3D-scattered interpolant.
%
% Use this function as model for Tobyfit or sqw_eval or func_eval
% algorithms.
% Accepts one or two input parameters:
% Two (or one) elements Array A... |
function [mApprox] = genBlockmodelApproxGraph(mAdj, mMembership, mImage)
%
% Generates a blockmodel approximated graph.
%
% find the image matrix according to mAdj and mMembership
posNum = size(mMembership,2);
cvMembership = cell(1, posNum);
for p = 1 : posNum
cvMembership{p} = find(mMembership(... |
function S_setupdata = setup_loadParameters(cav_dir,num)
load([cav_dir '/TD_init_parameters'],'S_setupdata');
load([cav_dir '/TD_init_parameters'],'S_pumpdata');
if nargin > 1
S_setupdata = S_setupdata(num);
end
[S_setupdata.pump_type] = deal(S_pumpdata.type);
end |
opts.bufferSec = 0.01; % trim the start and end of each fixation period
opts.smoothness = 20; % smoothing eye trace using smooth()
opts.vThresh = 0.03; % velocity thresholds to detect saccades
opts.neighborThresh = 0.005; % de-noising saccade periods
opts.invSampleHz = 1/3000; % sampled at 3kHz
opts.ylim = [-40 40]; % ... |
function [a,b,alpha,beta,fun,tlocs,pks,resnorm]=calc_fd_spring(measurement)
A = measurement.data;
% A is now a nice circular arc with radius r and center in (0,r).
x = A(:,3);
y = A(:,4);
z = A(:,5);
t = A(:,2);
m = measurement.mkg;
k = measurement.k;
[pks, tlocs] = findpeaks(z... |
%% TD1
% Problem 4
%% Antoine MERLET, Condorcet
clc; % Clear command window.
clear; % Delete all variables.
close all; % Close all figure windows except those created byimtool.
imtool close all; % Close all figure windows created by imtool.
workspace; % Make sure the workspace panel is showing.
%% Problem... |
%% pconn_behav_dfa.m
% all_behav_dfa
% last update: 30-09-2015
clear
restoredefaultpath
% --------------------------------------------------------
% VERSION 1
% --------------------------------------------------------
v = 1;
SUBJLIST = [4 5 6 7 8 9 10 11 12 13 15 16 19 20 21 22 23 24 25 26 27 28 29 30 31 3... |
function runHw6(varargin)
% runHw6 is the "main" interface that lets you execute all the challenges
% in homework 6. It lists a set of functions corresponding to the problems
% that need to be solved.
%
% Note that this file also serves as the specifications for the functions
% you are asked to implement. In some cases... |
% Check material
%
% written by T.Y. Yang on 09/15/2009
% clean start
clear all; close all; clc;
% forcing function
Time = 0.01:0.01:10;
V = 1*sin(Time);
%V = [0.01:0.01:2,2.1,2.1, 1.5:0.01:2.2];
% material property
%Element{1} = 'Hardening';
%Element{1} = 'BiLinearHysteric';
Element{1} = 'NLElastic';... |
clc;
clearvars;
close all;
I = imread('rice.png');
figure;
subplot(1,2,1);
imshow(I);
subplot(1,2,2);
imhist(I);
[H, x] = imhist(I);
Ib = im2bw(I, 95/255);
figure;
imshow(Ib);
I2 = imread('figura.png');
figure;
subplot(4,2,1);
imshow(I2);
subplot(4,2,2);
imhist(I2);
I3 = imread('figura2.png');
I4 = imread('figu... |
function test_suite = test_orientedBox3d
%TEST_ORIENTEDBOX3D Test case for the file orientedBox3d
%
% Test case for the file orientedBox3d
%
% Example
% test_orientedBox3d
%
% See also
% orientedBox3d
%
% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% Created: 2018-07-26, using Matlab 9.... |
function y = calcular_b(k,T,W0)
a1 = 1;
F = @(T0) (((T0<a1)&(T0>-a1))*(sin(T0*k*W0)));
%F = @(T0) (sin(T0))*(sin(T0*k*W0)));
y = 2/T * quad(F,-pi,pi);
endfunction
|
function y = VitEnc(G, x);
%
% VitEnc Viterbi Encoder function - performs Viterbi Encoder according to
% genration polynom
%
% Inputs: x - input data (binary form)
% G = [g1; g2; ...; gN] - matrix of generation polynomials
% Walsh - Used row of Walsh matrix
% ... |
function n = show(s)
%modelo de documentacao a partir de:
%http://www.engin.umd.umich.edu/CIS/course.des/cis400/matlab/oop.html
%SIMULATOR simulator class constructor.
% s = Simulator(m) creates a simulator object from the mesh object
%Name: show
%Location: <path>/@Simulator
%Purpose: show the velocity, pressure a... |
load('demo2-noisy.mat');
%seed = rng;
rng(seed)
noise_ratio = 0.4;
d = 6;
num_sample = 20000;
TT = randn(d);
[TT,~,~] = svd(TT);
A = TT;
x = zeros(d,num_sample);
for i = 1:d
x(i,:) = bpsk(num_sample,0,i);
end
mu = zeros(d,1);
sigmahalf = randn(d);
sigma = sigmahalf*sigmahalf';
eps = generateGaussianNoise(num_sa... |
% %% create Gabor filter weights
% rfSize = 12;
% numOrient = 8;
% order = 2;
% sigma = 1;
% aspectratio = 3;
% integral = 0.01;
% numChan = 3;
%
% W = zeros(rfSize,rfSize,numChan,1,1,numChan*numOrient);
% Wtmp = zeros(rfSize,rfSize,1,1,1,numOrient);
% orientations=(0:numOrient-1)*pi/numOrient;
% for k=1:length(orient... |
function varargout=DriftPass(varargin)
% DriftPass - Integrator for Drift spaces
%
% The transformation performed is:
%
% x1 = L/(1+d0) * x0' + x0
% x1' = x0'
% y1 = L/(1+d0) * y0' + y0
% y1' = y0'
% d1 = d0
% ct1 = L/(1+d0)^2 * (x0'^2 + y0'^2)/2 + ct0
%
% The list of actions performed is:
% - transl... |
function LorenzRuntimeComparison
AhnertCPUv2.x = [254 507 1013 2039 4034 8121 16351 32634 64578 128895 257267 517946 1024907 2081296 4154152];
AhnertCPUv2.y = [0.00209 0.00420 0.00827 0.01678 0.03304 0.06638 0.13604 0.26260 0.53284 1.07044 2.12911 4.27722 8.50749 17.09075 33.99354];
%CPU_Lorenz_odeint_vcl.cpp
odeint_... |
function num = numTrue(array)
%NUMTRUE Number of true elements in a boolean array.
% NUM = NUMTRUE(ARRAY) returns the number of non-zero/true elements in
% the array ARRAY.
%
% See also: XOR, ANY.
num = numel(find(array));
end
|
%% all variations of the SGD algorithm
function [W, s, r, gradHist, Whistory, m, v] = SGDvariation(t, x, y, W, eta, activation, ...
algo, s, r, gradHist, Whistory, m, v)
beta = 0.9;
epsilon = 1e-8;
gr = getSGD(x, y, W, activation);
if(strcmp(algo,'Canonical'))
W = W-eta*gr;
e... |
function process_videos_func_left(obj, event, himage, videoObj)
% this is called each time the camera makes a new frame available.
% the input arguments are passed automatically. You can add others if you need
% them, but they also have to be included where this function is created (above)
% do all you... |
function set_cluster_table(handles)
set(handles.uitable2,'visible','on')
set(handles.uitable2,'Position',[0.62 0.1 0.35 0.18])
clust_rate_table = [{'N/A'}];
% potentla rates to cluster
cimatrix = handles.table_spec.user_table1(15:24,2:11);
for i=1:10
for j=1:10
if ~isempty(cimatrix{i,j})
... |
function Tout_C = throttling_temperature(Pin_bar, Tin_C, Pout_bar, refrigName)
% Computation of the output temperature of an isenthalpic throttling using
% the CoolProp library.
% Franco Ferrucci
% ferruccifranco@gmail.com
% Dec 2017
%% Constants
Tk = 273.15;
bar_to_Pa = 1e+5;
%%
if Pin_bar < Pout_bar
... |
function [] = modelspace(currentStimI,currentStimD,nFrames,maxRepeat)
imageSize = 240;
% ------ PRE-ALLOCATED TRANSIENT LAYERS ------
t0TLact = -10;
TLbaseline = -10;
noiseTermTL = 0.005;
% time Constants
taoSlow = 60;
taoFast = 30;
% varying time scale wrt frame duratio... |
function y=Discontinuities_Average_R(x)
format long
temp=Discontinuities_R(x);
y=Average_R(temp);
end
|
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
%
%
% problem 11 - Computes the linear convolution of two sequences
% b)
x1=1:4;
x2=7:-1:1;
y=linconv(x1,x2)
% c)
y=conv(x1,x2)
|
clear;
caffe_path='/home/scw4750/github/caffe/matlab';
addpath(genpath('/home/scw4750/github/global_tool'));
% % for lightencnn
% prototxt='/home/scw4750/github/IJCB2017/lightencnn_deploy.prototxt';
% caffemodel='/home/scw4750/github/IJCB2017/final_LightenedCNN_C.caffemodel';
% data_key='image';
% feature_key='eltwise... |
%minimum energy
function RunBVP6C
clc,tol=1e-10;
options = bvpset('stats','on','abstol',tol,'reltol',tol,'Nmax',1000);
solinit = bvpinit(linspace(0,6,3),5*ones(3,1));
sol = bvp6c(@odes,@bcs,solinit,options);
figure(1);plot(sol.x,sol.y);axis tight;
%% Main----------------------------------------------------------... |
function windowedvalues = cwindow(kvalues, windowtype, param);
%WINDOWNAMES = Rectangular Hamming Hanning Triangular Bartlett
% Gaussian Blackman Kaiser Chebyshev
if (windowtype == 2);
windowedvalues = kvalues.*hamming(size(kvalues,2))';
elseif (windowtype == 3)
windowedvalues = kvalues.*hanning(size(kvalues,2))'... |
function [foreground] = userFire(foreground, aiBoard, userBoard)
code = spriteCode();
close(figure(1));
clc;
fprintf('Your turn to fire');
scene = simpleGameEngine('Battleship.png',84,84);
background = [code.water_sprite * ones(10,11), userBoard];
drawScene(scene,background, foreground);
... |
% considering only co-passing particles for the moment
load('initialG_alphas_vA1_pre_collapse.mat')
load('initialG_alphas_vA1_precession_stats')
alphas_Ekin=real(alphas_Ekin);
alphas_mm=max(alphas_mm,0);
PART_POP_TAE=find((alphas_psi>=0.9*pTAE_inf).*(alphas_psi<=1.1*pTAE_sup).*CO_PASSING_POP.*(abs(alphas_vpll)<1e7)... |
function rules(nx,ny,nz,alpha)
ssz=get(0,'ScreenSize');
hf=figure;
x0=ssz(3)/2;
y0=ssz(4)/2;
kfsz=0.9;
fpos=[x0-kfsz*ssz(3)/2 y0-kfsz*ssz(4)/2 kfsz*ssz(3) kfsz*ssz(4)];
set(hf,'MenuBar','none','Color',[1 1 1],'name','rules','NumberTitle','off','units','pixels','position',fpos);
ha = axes('parent',hf);
se... |
function Stitch(class,IMAGES,name)
%% Load a list of images (Change file name if you want to use other images)
imgList = find(class);
num = length(imgList);
% imgList = dir('./data/2016-01-12 12.52.*.jpg');
saveFileName = ['./result/',int2str(name),'.jpg'];
%% Add path
for i = 1 : num
%% Resize to m... |
function out = badroute(route,wrongroutes)
out=0;
N=size(wrongroutes,2);
for i=1:size(wrongroutes,1),
if wrongroutes(i,:)==[route,zeros(1,N-length(route))],
out=1;
end;
end;
|
function [A,b]=Abmat(n)
%Vandana Anand
%CS4032 Project Krylov
%Finds the nxn A matrix and nx1 column vector b with 1's along diagonal,
%and -0.5 in upper and lower diagonal above and below the center with zeroes
%everywhere else
%input: n - size of matrix
%output: solution vector of size nx1
A = zeros(n,n);
b = zer... |
function [] = RecipEntropyCultures(culture,Ningred_used,Nsubsamp)
% Fits a maxent model to recipes from a specified culture, using the
% Ningred_used most common ingredients and obtaining error bars by
% subsampling the data Nsubsamp times
%
% Written by: DJ Strouse
% Last updated: Aug 9, 2013 by DJ Strouse
%
% INPUTS
... |
function [ eps_ksi ] = check_ksi_continuity(s_coord,kpll,theta,mtheta, m_adjust )
% for optimization of poloidal profile according to parallel wave number
M_theta=(mtheta+m_adjust)*theta-kpll.*s_coord;
% M_theta=(qTAE*(nTAE)+m_adjust)*theta;
mod_M_theta=mod(M_theta,2*pi);
% if abs(m_adjust-m_guess)<0.5
% eps_ksi=... |
%% COMPUTE DMD
% step 0
YD1 = YDAT(:,1:end-1);
YD2 = YDAT(:,2:end);
% step 1
[U,S,V] = svd(YD1,0);
% step 2
r=10; % for two mode and K=5
Sinv = S(1:r,1:r)^(-1);
Atilde = U(:,1:r)'*YD2*V(:,1:r)*Sinv(1:r,1:r);
% step 3
[W,D] = eig(Atilde);
% step 4
PhiY = YD2*V(:,1:r)*Sinv*W;
PhiXr = XD2*V(:,1:r)*Sinv*W; % reconstructed... |
function [TimeOption] = StablishTime(DateOption)
% DateOption .TypeMission: FOR EVERY CASE, THE FIRST POSSIBLE DATE OF DEPARTURE .date_d_min
% MUST BE ADDED FOR COMPUTING THE INCREMENTS.
%
% - if .TypeMission is 1 it me... |
% Save mat files for data of a given user trial
% Inputs:
% dataFolder - folder data is saved in (will save mat files here)
% expOrgan - cell list with labels of organs to process
% expName - cell array with names of experiments to process
% arteryExperiments - array of which ablation experiments to process
% palpation... |
function [out1,out2] = postprocess(img,iter,medianSize,method,enableWLS,lambda,alpha)
%POSTPROCESS Summary of this function goes here
% https://de.mathworks.com/matlabcentral/fileexchange/4551-inpaint_nans
% img: input image 3 channel MxNx3
% medianIter: number of median iterations
% medianSize: Scalar for... |
%% We appreciate it if you use this matlab code and cite our papers.
% The BibTeX files are as follows,
%{
1- TCSVT19 --->
@article{peng2019active,
title={Active Transfer Learning},
author={Peng, Zhihao and Zhang, Wei and Han, Na and Fang, Xiaozhao and Kang, Peipei and Teng, Luyao},
journal={IEEE Transacti... |
function atm2html(varargin)
%MAKEDOC_HTML - Generate new MML, SOLEIL and AT HTML help files
% makedoc_html
%
% HOWTO
% 1. Make sure to update and run toolboxUpdateHeader.m
% 2. Update history.txt appropriately, including w current version
% 3. Update overview.html file with the version/date/link to zip:
% edit... |
% Input face_data with dimension N_faces x j and surface structure with
% fields surface.faces and surface.vertices
% outputs vertex_data which contains data points for every vertex
function vertex_data = getVertexCData(face_data,surface,cell_origins)
numVertices = size(surface.vertices,1);
vertices = surface.... |
function gazes = dsp__get_gaze_frequency( looks, within )
if ( nargin < 2 )
within = {'days', 'outcomes', 'trialtypes', 'looks_to', 'look_period'};
end
assert( looks.contains('count'), 'The object is missing a ''counts'' label.' );
gazes = looks.only( 'count' );
% make into frequency
gazes.data = double( gazes.da... |
function DPXD=lkDpxTuningExpPopAnalysis(DPXD,varargin)
% The DXPD input to this function is created by lkDpxTuningExpAnalysis
% Looks like this (2016-03-14)
% DPXD
% motType: {1x1306 cell}
% dirDeg: {1x1306 cell}
% allDFoF: {1x1306 cell}
% meanDFoF: {1x1306 cell}
... |
function [end_point] = exp_map_se3(start_point, direction)
direction = direction(:);
w = direction(1:3);
v = direction(4:6);
theta = norm(w);
if (theta)
R = vrrotvec2mat([w/theta; theta]);
skewmat = [ 0, -w(3), w(2);
w(3), 0, -w(1);
... |
%% GENERIC OBSTACLE CLASS (obstacle.m) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This class is designed to define a generic obstacle and import its variables
% into the simulation space for the purpose of multi-vehicle control simulation.
% Author: James A. Douthwaite 20/05/2016
classdef obstacle < objectDefinition
%%%... |
function plotEIT(data, data_bg, data_narrow, data_bg_narrow, h_f,shft)
% plot EIT results
% h_f: handle of the figure
% shft: amount of shift, percentage of the y data range
%
% WTJ, 20181203
if nargin < 5
h_f = figure;
end
figure(h_f);
tmpdata = data{1};
tmpy = 180*(unwrap(angle(tmpdata.z))-unwrap(angle(data_bg.z... |
function [beta, offFree, geomag, data_scaled] = caliFreescale(data)
Y = zeros(length(data),1);
cnt = 1;
for r = data'
t = 0;
for c = r'
t = t+c^2;
end
Y(cnt) = t;
cnt = cnt+1;
end
% disp(size(Y));
X = [data ones(length(data),1)];
% disp(size(X));
beta = ((X'*X)^-1)*X'*Y;
offFree = [0.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.