text stringlengths 8 6.12M |
|---|
%====================================================================
%
% DDI_20KEYS - Define the structure that describes the data
% description indices for .DATA files that have
% 20 attribute values per data description line.
%
% OUTPUT
%
% ddi (structure) Data ... |
clear;
pkg load image;
% % input
img = imread('pics/impact51.jpg');
level = 5;
scale = 1024;
subplot(2,3,1);
imshow(img);
title('Original');
% % image pre-process
%R = rgb2gray(img);
R = img(:, :, 1);
% R = histeq(R);
subplot(2,3,2);
imshow(R);
title('Equalized');
[h,w] = size(R);
R = double(imresize(R,[scale scale... |
function [mpg, E]=evalVehAdv(cyc, aeroC, keC, peC, rrC, accPwr, ptEffFunc, accPwr, fuelVolHV)
% function [mpg, E]=evalVehAdv(cyc, aeroC, keC, peC, rrC, accPwr, ptEffFunc, accPwr, fuelVolHV)
% Estimates the fuel economy of a vehicle using the given statistics. Assumes that all of the input coefficients can vary with tim... |
function [ theta,phy ] = deviation( x,y,z,delta_x,delta_y )
%DEVIATION Summary of this function goes here
% Calcul de la déviation que le plan S doit appliquer au rayon pour que
% sa position finale respecte la distortion imposée.
%Angle de chaque composante
theta = atan(delta_x./z + x) - atan(x);
phy = atan(delta... |
function [ apriori_out, tanstruct_out ] = scale_apriori( apriori_in, tanstruct_in, altitude_or_pressure, limits )
%A function to scale an a priori vmr profile to approximate the input data
%profiles, and add the scaled data to areas outside the pressure limits of
%the input data.
% *INPUT*
% tanstruct_in: ST... |
function [] = Testdata_Preconditions_G(sys,m1,tar)
% Preconditions layer transform
TestdataBlock = [tar '/TestData 1/'];
Testdata_block = [tar '/TestData 1'];
%VFsBlock = 'LCTC_vTD8_Transformation4_TC/Validation Functions/';
VFsBlock = [tar '/Validation Functions/'];
Precon = find_system([sys '/' m1], 'SearchDepth',2... |
% proje , 21.12.2016
% halit temel yalova üniversitesi
% geceden sonra izinli olmalı doktorlar. kısıt 1
% haftanın gunlerinde en az gece 1 doktor, gunduz 1 dktor olması
clear all;clc;
%Degişkenler
nufus_buy = 50; %50 nufus buyuklugu belirledik
calisan_sayisi=6;... |
function [H p2] = getHomography(calibration_circles)
%The real world cenroids of the calibration circles are defined in p1 in Cartesian coordinates. Units are in mm. Please not that these are in a
% particular order based on the order of blue_calibration_circles obtained earlier.
p1= [20,20;20,200;20,380;200,20;200,38... |
function rel_path = relativepath( tgt_path, act_path )
%RELATIVEPATH returns the relative path from an actual path to the target path.
% Both arguments must be strings with absolute paths.
% The actual path is optional, if omitted the current dir is used instead.
% In case the volume drive letters don't match, ... |
function h=subaxis(varargin)
%SUBAXIS Create axes in tiled positions. (just like subplot)
% Usage:
% h=subaxis(rows,cols,cellno[,settings])
% h=subaxis(rows,cols,cellx,celly[,settings])
% h=subaxis(rows,cols,cellx,celly,spanx,spany[,settings])
%
% SETTINGS: Spacing,SpacingHoriz,SpacingVert
% ... |
%edge detect
IMG = imread('teapot.png');
scale = 1280/sum(size(IMG));
IMG = imresize(IMG,scale);
BW = edge(IMG(:,:,1),'Canny');
outlinetarget = find(BW == 1);
IMG(outlinetarget) = 255;
imwrite(IMG,'edgeoutput.png'); |
dE_E_tol = 1E-3; % calculate jitter tolerance based on (e.g.) 1E-3 dE/E jitter
dIpk_Ipk_tol = 0.10; % calculate jitter tolerance based on (e.g.) 10% dIpk/Ipk jitter
seed = 1; % random seed used
c = 2.99792458E8;
fn = input('Litrack file name (e.g. lcls): ','s');
fnf = [fn '_lit'];
if exis... |
% Find the greatest product of five consecutive digits in the 1000-digit
% number.
fid = fopen('prob_008.data');
str = textscan(fid, '%s');
fclose(fid);
str = char(str{1});
products = zeros(numel(str)-4, 1);
for i = 1:numel(str)-4
products(i) = prod( str2num( regexprep(str(i:i+4), '(.)', '$1 ') ) );
end
[val, i... |
function f = reconstruct_fft_from_coeffs_and_gd_fn(c_DC, c_AC, c_nyq, gd, fbas, Ls, phasemode, gpu_idx)
assert(ndims(c_AC) == 2 || ndims(c_AC) == 3);
if ndims(c_AC) == 2
num_chs = 1;
else
num_chs = size(c_AC, 3);
assert(num_chs >= 2);
end
assert(ismatrix(c_DC) && size(c_DC, ... |
function [P, mdl] = csfAbsorptions(contrasts,params)
% CSFABSORPTIONS - SVM discriminability of harmonic and uniform using absorptions
%
% The harmonic has a frequency and a contrast. We compare that with a 0
% contrast stimulus.
%
% HJ/BW, ISETBIO TEAM, 2016
%
% See also vaAbsorptions
%% Generate image basis
% If a... |
%% run simulation.
% specify number of components in parameter file.
clear global userParam
clearvars;
paramfile = 'setUserParameter_simpleAI';
global userParam
eval(paramfile);
nSides = userParam.nSides(1);
radius = userParam.colonyRadius(1);
kappa = userParam.kappa;
fhandle = userParam.fhandle;
saveInPath = ['... |
LineW = 2;
StopTime = 1;
% Parameters for screw-nut
threadHalfAngle_vec = 15;%[10, 12, 14.5, 16, 20, 25]; % 14.5 = std
Lead_vec = [6e-3];
dm = (12- 0.5*3)*10^(-3);% 25mm mean diameter
LeadAngle_vec = atand(Lead_vec./(pi*dm));
%%
out = sim('leadscrewStepper','StopTime',num2str(StopTime));
figure(1)
plot(out.force.Time... |
function [ mean_result ] = SVM_after_NN_T1( task, KernelSVM, List_of_subject, nn, Size_of_feat, fast, channel_type)
%SVM_AFTER_NN_T1 analyse data after NN
%==========================================
%Author: Uladzislau Barayeu
%Github: @UladzislauBarayeu
%Email: uladzislau.barayeu@ist.ac.at
%===========================... |
function plot_all(folder)
fs= gethpath();
thresholds=[ 138 120 138 110 124 115 105 105 105 108 165 110 228 190 176 172 142 206 260 175 140 110 130 140 187 150 ];
out=[ones(12,1)*5 ;4.5; 4.5; 4; ones(5,1)*4.5; ones(6,1)*5 ];
str2=cell(26,1);
str2{1,1}='/home/raleman/Documents/internship/Lisa_files/data/PT1';
str2{2,1... |
function y = bdry(x, y)
y = exp(x * y);
end |
function N = numerizeLabels(S)
% converts the segmentation image S from true-color
% to ordered integer labels
%
N = zeros(size(S,1),size(S,2),'uint16');
col2n = zeros(256,256,256);
totcol = 0;
for x = 1:size(S,2)
for y = 1:size(S,1)
p = reshape(S(y,x,:),1,3)+1;
cix = col2n(p(1),p(2),p(3));
... |
% FRETCellSegmenter - GUI cell outline segmenter with ratiometric output
% View and edit parameters for tracking of vesicles in two-channel
% images with comparison of particle number over time and cross-channel
% nearest-neighbor distances between detected particles.
%
%
% Requires:
% Vector2Colormap
% freezeColors
%... |
% This script defines several simple polyhedra.
% A polyhedron with N faces is represented as a cellular array of size N.
% Each element of the array represents one face.
% A face with K vertices is represented as a K x 3 array, where each
% columns of the array is contains the coordinates of the vertices.
% The colum... |
clear
clc
f = imread('rice.png');
figure
subplot(221)
imshow(f)
subplot(222)
imhist(f);
I = imadjust(f,[0,1],[1,0]);
subplot(223)
imshow(I);
S = imadjust(f,[0.5,0.75],[0,1]);
subplot(224)
imshow(S)
% subplot(122)
% imshow(S) |
i = imread('image.jpg');
imshow(i);
imwrite(i,'s.jpg'); |
% by Itthinat Jongsuebchoke
% This is a 1D FDTD simulation with pulse
% It displays a "movie" of the signal
% Size of the FDTD space
clear all;
close all;
ke=50;
% Position of the source
ks=ke/2;
% Number of time steps
nsteps=50;
% Cell size and time stepping
c0=3.e8;
dx=0.01;
% Use Courant condition
... |
function drawFig2(source,callbackdata,mid_outParsed_ref,compiledResults,simTime_ref,sampleTime_ref)
if isnumeric(source) && ~isempty(source)
toDoF = source;
elseif ~isempty(source)
toDoF = source.Value;
if strcmp(source.String,'next')
toDoF = toDoF + 1;
else
toDoF = toDoF - 1;
end
e... |
function [ FSMC ] = FSMC_chain( control, SNR,nr_states)
%This function creates an object containing all the information required
%to describe a Markov chain. The Markov chain captures the behaviour of the
%passed in SNR values
% INPUT: m x 1 SNR: vector containing the SNR values
% 1 x 1 nr_state... |
function Locs = parseLocationData(importedValue)
Locs = zeros(size(importedValue, 1), 11);
Locs(:, 1) = vertcat(importedValue.ID);
Locs(:, 2) = vertcat(importedValue.ParentID);
Locs(:, 3) = vertcat(importedValue.VolumeX);
Locs(:, 4) = vertcat(importedValue.VolumeY);
Locs(:, 5)... |
function [ allReturns ] = calc_returns(ModelReturns, IndexReturns, bestModelIndex, testStartWindow, windowSize, nWeeks, plotIsOn)
%UNTITLED9 Summary of this function goes here
% Detailed explanation goes here
% Push returns to 1 for in-loop multiplication
fullModelReturns = 1 + ModelReturns;
fullIndexReturns = 1 + I... |
function phaliwglon(varargin);
% phaliwglon( [...] );
% IWG1 Lon
h = timeplot({'Lon'}, ...
'IWG1 Lon', ...
'Lon', ...
{'Lon'}, ...
varargin{:} );
|
clear all;
syms a c er ep x y;
a=15;
c=15;
ep= 1: 1: 100;
er= ep:1:100;
[x,y]= meshgrid(er, ep);
for ep= 1:100
for er=ep:100
if er >= (a*c/4) && ep >= (a*c/4)
z( er, ep)=1;
elseif er >= ((a*c* ep)^(1/2) -ep) && ep <= (a*c/4)
z( er, ep)=(((a*c/ep)^(1/2)) -1 );
else
z( er , ep)=er/ep;
end
end
... |
function lost_particle_position(lost)
%% 接收lost.plt的数据, 画出粒子最终分布的统计图
thet = lost(:,2);
thet = rem(thet,2*pi);
zet = lost(:,3);
zet = rem(zet,2*pi);
x=lost(:,4);
z=lost(:,5);
en=lost(:,6);
ptch=lost(:,7);
pz=lost(:,8);
type=lost(:,13);
subplot(2,2,1)
histogram(thet)
xlabel('$\theta$','interpreter','latex')
ylabel('$N$'... |
function Etsch = IntSch(original_signal,Norm_signal)
% ...
% [E] = IntSch(original_signal,Norm_signal)::Funcion que aproxima un impulso a una señal mas adecuada, a traves de la
% transformada de Schroeder
% Funcion con elementos de entrada:
% original_signal = Respuesta al impul... |
function [Cluster, Codebook] = func_kmeans(X, k, init_cluster, distFunc)
if ~exist('distFunc', 'var') || isempty(distFunc)
distFunc = @func_Eucdist;
end
[D N] = size(X);
if k > N
error('k must be less than or equal to the number of vectors N');
end
% Initial centroids
Codebook = init_cluster;
distortion = I... |
function [ output_args ] = contours_line( line_img )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
img=imread(line_img);
W = size(img,1);
H = size(img,2);
M = H / 2;
ca = zeros(W);
cb = zeros(W);
for (x=1:W)
ca(x) = 0;
cb(x) ... |
function [ ww ] = OWAweight( A )
%UNTITLED2 此处显示有关此函数的摘要
% 此处显示详细说明
len = length(A(1,:));
syms w1 n a;
X='w1*(((n-1)*a+1-n*w1)^n)=(((n-1)*a)^(n-1))*(((n-1)*a-n)*w1+1)';
n=len;
a=0.1;
X=subs(X);
%solve('w1*(((n-1)*a+1-n*w1)^n)-(((n-1)*a)^(n-1))*(((n-1)*a-n)*w1+1)=0',w1);
A=solve(X,w1);
len=length(A);
for... |
[pth] = fileparts(which('vwi'));
home_dir = char(textread([pth '\home_dir.txt'],'%s'));
%% Prompt for Directory to process and define all subdirectories.
uiwait(msgbox('Please select directory you would like to analyze.','VWI'));
proc_dir = uigetdir(home_dir, 'Select directory you would like to analyze..');
dir_proc =... |
function [val] = MM2_compare(xk)
%function counting root with given precision using MM2
iter = 0;
val = zeros(2,15);
while iter < 15
xk = MM2_single(xk);
iter = iter + 1;
val(1, iter) = polyVal(xk);
val(2, iter) = xk;
end
end
|
function [ Filter_Output, DC_Output ] = DC_Remove( Input, StepSize )
%DC Removal based on LMS Algorithm
% [ Filter_Output, DC_Output ] = DC_Remove( Input, StepSize )
DC_Source = ones(size(Input));
Weight = 0;
for n = 1:length(Input)
DC_Output(n) = Weight(n) * DC_Source(n);
Filter_Output(n) = Input(n)-DC_Out... |
close all
clear all
clc
%%
Ts = 0.005; %Tuned based on discrete and continuous step response
Vx = 20; %mps
time = 20; %motion for 20 sec
N = time/Ts;
%% Inputs
u1 = ones(N)*10*pi/180; %steering input
u2 = ones(N)*10*pi/180; %psi_dot_desired
%% State space model
[sys] = state_space(Vx);
[sys_dis,B1,B... |
global allV
hist(allV,10)
|
fid = fopen('/home/cesar/Code/C++/PowerSystem/Chart/Setup1/k140Line2/Linear/LinePower.txt','rt');
LinearData = textscan(fid,'%f%f%f%f%f%f%f%f%f','HeaderLines',2,'CollectOutput',1);
LinearData = cell2mat(LinearData);
fclose(fid);
fid = fopen('/home/cesar/Code/C++/PowerSystem/Chart/Setup1/k140Line2/nonLinear/LinePower.... |
%% Declaration des parametre globaux
global L T wx alpha
L=1
T=1
alpha=1
coefferr=0
wx= ; %depend de la partie 1
%% Declaration des autres variables
c= ;
Nx= ;
Nt= ;
theta= ;
f=0;
u0=@(x) ;
utilde=@(x)sin(wx*x);
%% Faire appel a la fonction
[ , ] = resout_eq_onde(, , , , , ,); |
%% Runs an ICW (Iterated Curency war)
% Countries with different strategies iteratedtly face each others and decide
% to be proteccionist or having free trade policies.
% Strategies have menory and based in the past behavior
fprintf('\nStart the tournament...\n');
R=200; % number of trading days
%% PLAYE... |
classdef Softmax < handle & Classifier & NetworkLayer
%softmax classifier, can be used in Deep network or independent (logistic regression) classifier
%WARNING: just changed the initialization, need update to use NN
properties
weights; %feadim*numclass
bias; %numclass*1
... |
function y=Af(A,f,dt)
[nd,~,np]=size(A);
y=eye(nd);
for tp=1:np
y=y+A(:,:,tp)*exp(-2*pi*1i*tp*f*dt);
end
end |
function [Operators] = dualObjectiveFunction()
Operators.evaluate=@(dual,dataMng)evaluate(dual,dataMng);
Operators.gradient=@(dual,primal,dataMng)gradient(dual,primal,dataMng);
end
% Evaluate dual objective function
function [output,primal] = evaluate(dual,dataMng)
% compute trial primal based on current dual value
[p... |
% The Breast Ultrasound Analysis Toolbox (BUSAT) contains 70 functions (m-files)
% to perfom image analysis including: preprocessing, segmentation, morphological
% and texture features, and binary classification (for two classes). This
% toolbox was developed with MATLAB R2014a.
%
% Developed by Wilfrido Gomez Flores ... |
function [ number_of_echos ] = get_number_of_echos( ex )
%UNTITLED6 Summary of this function goes here
% Detailed explanation goes here
if(isfield(ex.method,'PVM_NEchoImages'))
number_of_echos=ex.method.PVM_NEchoImages;
else
number_of_echos=1;
end
end
|
function [yCoeff, D5, D6, D7] = getCoefficients(FAR,FARstoich,HCratio,OCratio)
% Compute h(x) and y(x) for given fuel-to-air ratio x
% h(x): Exhaust air molar ratio for an element of charge
% y(x): Concentration of compound in an element of exhaust
% y1: CO - (rich), y2: CO2 (rich)
% y3: CO2 ... |
function runVibrotactileTest (nrStimulators, nrSweeps, nrFingers, stimTime, blankTime , VTSOptions)
% Runs a simple tactile experiment
%
% runVibrotactileTest (nrStimulators, nrSweeps, [nrFingers] , [stimTime], [VTSOptions])
%
% Required Input:
%
% nrStimulators : Number of stumulators
% nrSweeps : Numbe... |
function B = Beta(x, grad, M)
B = (M*x - grad)./M;
end
|
clear all; close all; clc;
pathToCamera = fileparts(which('camera_store.py'))
if count(py.sys.path, pathToCamera) == 0
insert(py.sys.path, int32(0), pathToCamera);
end
% set(gcf,'Color','w');
% set(gca, 'FontName', 'Times New Roman');
global showFigures;
showFigures = 0;
sliceRange = [0 2];
% Camera faces to... |
%% This skript solves a 2D heat equation with the ofem.v.2
% Model is a steel rod with a set temperature at each end and neuman at the
% sides
close all;
clear all;
%% Creating the geometry
file = 'D:\GitHub\oFEM_rework\geometry\planarCapacitor3D';
%file = 'HeatExample2D';
mesh= Geometry();
mesh.load_from_msh(fi... |
function [x,sval,sval_ratio] = lsq(A)
%LSQ returns the least squares solution of the given matrix.
%
% x = lsq(A)
% [x,sval] = lsq(A)
% [x,sval,sval_ratio] - lsq(A)
% returns the vector, x, that corresponds to the smallest singular value of
% matrix A. That is, the function returns the vector, x, that minim... |
% Dylan Balata
% CS 151-005
% Assignment 6 First
% Determines line portion
function line = cs151sp15assn6first(pt1,pt2,startxdomain,endxdomain)
slope = (pt2(2)-pt1(2))/(pt2(1)-pt1(1)); % Slope of the lines
int = pt1(2)-pt1(1)*slope; % Y intercept
x = [startxdomain:.1:endxdomain]; % x values of line
y = slope... |
function keep = keepFile(meta, freq, location_str, loc_logic)
% Filter out this file
% Author: Rick Candell
% Organization: National Institute of Standards and Technology
% Email: rick.candell@nist.gov
if nargin < 4
loc_logic = true;
end
if nargin < 3
location_str = NaN;
end
if nargin < 2
error 'frequenc... |
function controlData = getControlData()
%%%% Controller Parameters, Identical to real robot: %%%%%%%%%%%%%%%%%%%%%%
controlData.walk.hip_kp = 25;
controlData.walk.hip_kd = 3;
controlData.walk.ank_push_kp = 20;
controlData.walk.ank_push_kd = 2;
controlData.walk.ank_stance_kp = 15;
controlData.walk.ank_stance_kd = 1;
co... |
function elogarithm = elog(x)
if(x == 0)
elogarithm =nan;
else
elogarithm = log(x);
end
end |
% CMPHESSIAN class to wrap around the CMP Hessian Affine detector implementation
%
% obj = affineDetectors.cmpHessian('Option','OptionValue',...);
% frames = obj.detectPoints(img)
%
% This class implements the genericDetector interface and wraps around the
% cmp implementation of Hessian Affine detectors availa... |
N=length(x);
m= ;
tau= ;
P=N-(m-1)*tau;
for ii=1:m
for jj=1:P
data(jj,ii)=x(jj+(ii-1)*tau);
end
end
y1=data(:,1);
y2=data(:,2);
y3=data(:,3);
figure(1);
plot3(y1,y2,y3);
view(2)
xlabel('x'),ylabel('y');
title('LorenzÍě╣╣╬ŘĎřÎË═╝'); |
clear all
clc
folder='G:\MATLAB Runtime\v85\dcase2016\fold1dcase16\';
%folder = 'E:\User-Files\Documents\MATLAB Runtime\v85\ieeeaasp dataset\fold1\train test 1\';
files = dir(strcat(folder,'*.wav'));
for i = 1:length(files)
%for i=1:2
fname = strcat(folder,files(i,1).name);
[d sr] = audioread(fname);
... |
function [ output_args ] = myRadonTrans()
%MYRADON Summary of this function goes here
% Detailed explanation goes here
%%% PART 1b
imageXY = phantom(128);
radonTrans1 = zeros(37, 36);
radonTrans2 = zeros(37, 36);
radonTrans3 = zeros(37, 36);
theta1 = 0:5:175;
t1 = -90:5:90;
ds = 0.5;
for t = -90:5:90,
... |
theta1=-80; %from -100 to 90 degrees
theta2=90; %from 0 to 180 degrees
theta3=-90; %from 0 to -170 degrees
theta4=-180; %from -180 to 0 degrees
theta5=50; %from 0 to 180 degrees
x1 = theta1*pi/180;
x2 = theta2*pi/180;
x3 = theta3*pi/180;
x4 = theta4*pi/180;
x5 = theta5*pi/180;
d1... |
function C = ScaledDownDESDecrypt(P,Key)
% C = ScaledDownDESDecrypt(P,Key)
% Inputs: P = 8 bit (ciphertext) string, Key = a 12 bit string
% that serves as an admissible DES key.
% Output: C = the 8 bit (plaintext) string that corresponds to the
% output of the Scaled-down DES encryption algorithm (Algorithm 7.1). ... |
% Numerical Optimization by "Hill-climbing"
% Created by: Atif Shoukat Ali
% Email: atif@atifali.ca
%The specified following input / outputs are:
%f : a function handle with 2 inputs, representing some mathematical function of two variables
%lap : a positive number for the time duration to follow the gradient vector f... |
function val = opperEvalIntegral( f, sigma2 )
%OPPEREVALINTEGRAL Evaluate 1D integrals for Opper's method
% IT was like this before but has numerical errors
val = integral(f,-Inf,Inf);
%sigma = sqrt(sigma2);
%val = integral(f,-10*sigma,10*sigma);
return;
|
function [J grad] = nnCostFunction(nn_params, ...
input_layer_size, ...
hidden_layer_size, ...
num_labels, ...
X, y, lambda)
%NNCOSTFUNCTION Implements the neural network cost func... |
% Matheus Pereira dos Santos
% Lab 07
clc; clear all; close all;
%% Atividade 1
vetorSNRdB = -2:10; %vetor de Eb/No
vetorSNRw = 10.^(vetorSNRdB/10); %conversão para watts
vetorProbEr = qfunc(sqrt(2*vetorSNRw)); %vetor de probabilidade de erro
figure
semilogy(vetorSNRdB, vetorProbEr, 'k-');
legend('Não Co... |
% Removes last values of the specified matrices.
function [varargout] = removeLastFromMatrix(varargin)
for i = 1:length(varargin)
mat = varargin{i};
s = size(mat);
% Determines size of matrix
if s(1) < s(2)
varargout{i} = mat(:,1:end-1);
else
varargout{i} = mat(1:end-1,:)... |
/Users/bbue/Research/src/matlab/util/sumnorm.m |
commonLoadPath = '';
commonSavePath = '';
filesFeatureA = dir(fullfile(commonLoadPath,'*.'));
filesFeatureB = dir(fullfile(commonLoadPath,'*.'));
for k = 1:length(filesFeatureA)
pathFeatureA = filesFeatureA(k).name;
dataFeatureA = load([commonLoadPath,pathFeatureA]);
pathFeatureB = filesFeatureB(k).name;
dataFea... |
% This script load the epochs data, making the referencing and the main/heavy analysis
% clear all;
fprintf(' Processing Ref and Main Analysis .......\n');
load ecogPrePros.mat;
load ecogGlobal.mat;
printElc = 0;
%% Re-reference (bi-polar referencing of the 60 electrodes of the 1st grid)
if(useCh_1_60)
... |
function [fm, bm, gamma, log_like, marg_epsilon] = hmm_inference(p_obs, T, ...
varargin)
% Infer forward and backward probability of chunks
% and the smoothed estimates
% Inputs:
% p_obs : probability of observations
% T : transition probability from i to j
% fm0 : initial distribution on chunks (option... |
function [TIidx, TJidx, TKidx] = tregion_indices(RIidx, RJidx, RKidx, padsize)
%
% [TIidx, TJidx, TKidx] = tregion_indices(RIidx, RJidx, RKidx, padsize);
%
% This is needed in variantTransposeMultiply.m
%
% Input:
% RIidx \
% RJidx - indices coming from region_indices.m
% RKidx /
%... |
function compute_box_counting_dimension(analysis_dir, Scan_IDs, EV_maps_filename)
% Check we have correct number of input arguments
if nargin < 2
disp(sprintf('Usage: %s(analysis_dir, Scan_IDs, {EV_maps_filename});', mfilename));
return;
end
if nargin < 3
EV_maps_filename = 'EV_maps.mat';
end
% Get Scan IDs if ... |
% Lecture 2.3 : Round off errors and Iterative Methods
% To calculate numerical derivative of atan(1) | tan-1(a)
a = 1;
h = 0.01;
trueVal = 1/(1+a^2); % D'(tan-1(a)) = 1/(1+a^2)
approxVal= (atan(a+h)-atan(a))/ h; % f'(x) = lim f(x+h) -f(x) / h
% h-> 0
err1 ... |
%{
Use this file to build a codebook using HOG features for :
1) 3 for hairline
2) 5 for face boundary
3) 2 for eyes
4) 1 for nose
5) 1 for mouth
%}
function build_codebook()
array_filenames = {'trainingImages/1.jpg';...
'trainingImages/3.jpg';...
'trainingImages/4.jpg'... |
classdef TrialNbackPrac < WBTrial
methods
function start(this)
this.design.loadScene('SINGLE-NBACK')
this.design.startAllTasks();
end
function update(this)
if (GetSecs - this.startTime > 29.5)
% practiced for 20 seconds, go to the next... |
% 保存图片,便于观察generator生成的images_fake
function save_images1(images, count, path)
n = size(images, 1);
row = count(1);
col = count(2);
I = zeros(row*28, col*28);
for i = 1:row
for j = 1:col
r_s = (i-1)*28+1;
c_s = (j-1)*28+1;
index = (i-1)*col + j;
... |
function [V,lamda] = vxishu(k,N,M,t,d)
%VXISHU 此处显示有关此函数的摘要
% 此处显示详细说明
for m=1:M
for n=1:N
%第N个V基函数是第n组的第i类的第j个V基 其中n=log2(N/(k+1))+1向上取整, i=N-(k+1)*2^(n-2)除2^(n-2)的商向上取整,取余为j
if n<=k+1
group=1;
i=n;
j=1;
else
group=ceil(log2(n/(k+1))+1);
... |
prob_offset_off{j} =importdata([fileSave filesep 'prob_offset_beta_temp_off.mat']);
prob_offset_on{j} = importdata([fileSave filesep 'prob_offset_beta_temp_on.mat']);
prob_offset_ada{j} = importdata([fileSave filesep 'prob_offset_beta_temp_ada.mat']);
classifier_offset_off{j} =importdata([fileSave filesep 'classifier_... |
function [S,G] = generate_billiards(r,N,dim)
if dim ~= 2
S = [];
G = [];
return
end
S = zeros(N,dim);
G = zeros(N,dim);
d_s = 5*sqrt(2)*r;
num_cols = round(sqrt(N));
x_spacing = (1:num_cols)*d_s;
x_spacing = x_spacing-x_spacing(1)-(x_spacing(end)-x_spacing(1))/2;
num_rows = num_cols + ceil((N-1-num_cols^... |
close all; clear all; clc;
X = 1;
Y = 2;
Z = 3;
NumBirds = 1;
NumTimeSteps = 2000;
posOverTime = zeros(3, NumBirds, NumTimeSteps);
velOverTime = zeros(3, NumBirds, NumTimeSteps);
bankingOverTime = zeros(NumBirds, NumTimeSteps);
loadConstants;
epsilon = 1e-12;
%% - Initial Conditions
posOverTime(:, 1, 1) = [0;0;10... |
function [ hfig ] = plot_px_theta_tau( pricer )
%PLOT_DELTA_S 画delta~S的图
% ---------------------
% 沈杰,20160124
% 吴云峰,20160129,增加了不改变原有值的方法
% cg,20160302,修改了默认横轴的值, 加画当前点,略改标题
%% 预处理
% TODO: 相关预处理
% 将旧的变量进行保存
copy = pricer.getCopy();
% 横轴tau默认值
if ~exist( 'tau' , 'var' )
longend = ceil( pricer.tau * 10 ) / 10;
... |
function [p,x,exitflag] = forward_kin_tensegrity(robot)
%Structure robot
%robot.k - array of spring stiffness
%robot.d - array of rod lengths
%robot.l - array of spring lengths
%robot.x0 - array of init positions
%robot.m - array of rod mass
%robot.f - external force
%robot.end_eff.rod - number of end effector rod
... |
function [ J_3C_3 ] = point3ToCameraGeometricJacobian(q, params)
% Inputs:
% q: a 3x1 vector of generalized coordinates
% params: a struct of parameters
% Output:
% J_3C_3: geometric Jacobian from point O_3 to point C, expressed in
% frame {3}
theta = params.theta;
l31 = params.l31;
... |
function features = get_features(data, header_data,Used_leads) %get_ECGLeads_features
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Purpose: Extract features from ECG signals of every lead
% Inputs:
% 1. ECG data from available leads (data)
% 2. Header files including the number of leads (head... |
function [data, hdr] = read_img2(hdr, name)
% [image_data, hdr] = read_img2([hdr,] name)
%
% Luis hernandez
% last edit 2-23-2007
%
% Loads the data from a file 'name' containing mutislice image data
% hdr: is a header structure (use read_hdr()). Not necessary by,
% left there to make compatible with old code.
% ... |
clear;
close all;
fileList = dir('LX_*.txt');
NUM_CH = 32;
for i=1:size(fileList,1)
channelName = fileList(i).name;
if (channelName(20) == 'D')
chNumber(i) = str2double(channelName(21:22));
channel = load(channelName);
channels(:,i) = channel(1:end);
end
if (channelName(20) == '... |
function [P]=SinusoidalDecayNoTilt(Coefficients,t)
% Sinusoidal Decay
%
% Yulin Wu, SC5,IoP,CAS. wuyulin@ssc.iphy.ac.cn/mail4ywu@gmail.com
% $Revision: 1.0 $ $Date: 2012/03/28 $
B = Coefficients(1);
C = Coefficients(2);
D = Coefficients(3);
freq = Coefficients(4);
td = Coefficients(5);
P = B*(exp(-(t/td)).*(sin(2*pi*... |
% Test 3D histograms and Fern classifier
% Try to use 3D data for 3D histograms
% addpath(genpath('C:\Uri\Projects\Technion\Maria\TwoPhotonJanelia'));
% addpath(genpath('C:\Uri\Code\Matlab\ImageProcessing\People\piotr_toolbox_V3.25'));
%addpath(genpath('C:\LabUsers\Uri\Projects\Maria\DendritesTwoPhoton\TwoPhotonAnalys... |
function [obs truth] = consensus_simulation_boundary_model(num_raters, ...
num_slices, length_im, shiftiness);
% CONSENSUS_SIMULATION_BOUNDARY_MODEL - observe using a boundary only model
% - This is mainly meant to be used to compare the STAPLE and COLLATE models
%
% [obs truth] ... |
clear all
close all
clc
figure
for index = 1:8
subplot(4,2,index);
% draw samples from standard normal distribution
x = [randn(1000,1); index-1+randn(500,1)];
[n binCenters] = hist(x);
h = bar(binCenters, n);
title(['Plot ' num2str(index)]);
disp(['Plot ' num2str(index)]);
f1 = ... |
function str = dtmfdecode(s,fs)
s=[s; zeros(1-mod(length(s),2))];
fT = 30;%22
keyMap = containers.Map();
keyMap('1') = [697 1209];
keyMap('2') = [697 1336];
keyMap('3') = [697 1477];
keyMap('4') = [770 1209];
keyMap('5') = [770 1336];
keyMap('6') = [770 1477];
keyMap('7') = [852 ... |
% Stabilitetsprøving
clear all
close all
f = @(x) cos(x/16) .* (1 + sin(x/16));
L = 32*pi;
M = 2^7;
h = L/(M);
x = 0:h:L-h;
N = 500;
k = 0.01;
T = k*N;
U = zeros(M,N);
error = zeros(M,N);
U(:,1) = f(x);
V = U;
rho1 = @(x) -L/2*tanh(L/2*(x-L/2)/2);
rho2 = @(x) x;
W = U;
e = ones(M,1);
diagVecA = [-M+1 -M+2 -2:2 ... |
function f= ps_ccal(a, b)
if (a == b || a + b == 0)
f = (251*pi)/512 + (sin(2*pi*b)/4 - sin((5*pi*b)/128)/4)/b;
% f = (63*pi)/128 + (sin(2*pi*b)/4 - sin((pi*b)/32)/4)/b;
% f = (251*pi)/512 + (sin(2*pi*b)/4 - sin((5*pi*b)/128)/4)/b;
% f = (123*pi)/256 + (sin(2*pi*b)/4 - sin((5*pi*b)/64)/4)/b;
% ... |
function d = derv(this, mode, wrt, isSimplify)
% derv [Not a public function] Compute first derivatives wrt specified variables.
%
% Backend IRIS function.
% No help provided.
% -IRIS Macroeconomic Modeling Toolbox.
% -Copyright (c) 2007-2017 IRIS Solutions Team.
try, isSimplify; catch, isSimplify = true; e... |
function [L, U] = zgaxpylu(A)
%calculate LU decomposition based on Gaxpy operation
%the same way as zlu.m but differnt approach
[m, n] = size(A);
if m ~= n
error('current support square matrix only')
end
L = eye(n);
U = zeros(n);
for k = 1:n
v = zeros(n, 1);
if k == 1
v(k:end) = A(k:end, k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.