text stringlengths 8 6.12M |
|---|
% experiment_hall_no_noise.m
% Executes the background subtraction experiment on the hall video,
% without the addition of noise.
%
% Georgios Papamakarios
% Imperial College London
% Aug 2014
clear;
warning('off', 'MATLAB:MKDIR:DirectoryExists');
% directory where to write
rootdir = '/vol/bitbucket/mb2215/experiment... |
classdef TimeSeriesConverter < ether.process.Converter
%TIMESERIESCONVERTER Summary of this class goes here
% Detailed explanation goes here
properties(SetAccess=protected)
initialCount = 3;
end
methods
end
end
|
function [H] = gen_random_normal_mat(N,M)
H = sqrt(1/2).*crandn(N,M);
end |
function S = computeS(X, F)
%computeS Compute the S representation for X given a F matrix assuming that F is column orthogonal
% Description:
% This function computes a multi-graph cluster relationship matrix S for
% a multi-graph symmetric matrix X using a cluster membership matrix F
% with n objects... |
function [R,A] = RadialMean(S)
size2 = size(S)
R = zeros(1,round(sqrt(size2(2))));
A = zeros(1,round(sqrt(size2(2))));
ns = 1;
nl = 1;
i = 1;
while (ns <= size2(2))
ne = min(ns+nl-1, size2(2));
R(1,i) = mean(S(1,ns:ne));
A(1,i) = var(S(1,ns:ne)) / R(1,i)^2;
i = i+1;
ns = ns+nl;
nl = nl+2;
en... |
function writeVector(vec, filename)
fid = fopen( filename, 'w' );
[r c] = size(vec);
if r == 1 % row vector
vec = vec.';
end
if isreal(vec) % vector is real
fprintf(fid, '{ AR %i \n', length(vec));
fprintf(fid, ' %18.16e\n', vec);
else
fprintf(fid, '{ AC %i \n', length(vec));
fprintf(fi... |
close all
clear
%clc
%filePath = 'C:\Users\Mikkel\ABE_Master_thesis\PythonFiles\thinLinc\Mag\CNN\wavPredsForMultiPESQ\';
%addpath 'C:\Users\Mikkel\ABE_Master_thesis\PythonFiles\thinLinc\Mag\CNN\wavPredsForMultiPESQ\';
%filePath = 'C:\Users\Mikkel\ABE_Master_thesis\PythonFiles\thinLinc\Mag\CNN\wavPredictionFiles\';
%a... |
function [desired_state] = diamond(t, qn)
% DIAMOND trajectory generator for a diamond
% =================== Your code goes here ===================
% You have to set the pos, vel, acc, yaw and yawdot variables
pos = [0; 0; 0];
vel = [0; 0; 0];
acc = [0; 0; 0];
yaw = 0;
yawdot = 0;
syms t1
if qn == 1
pos = [t1/(2... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% Author: Enio GJERGA %
% Date: 07/05/2015 ... |
function f_medida = rna_f_medida(base_treino, base_teste, camada_interna, lambda)
% Testa a base com o modelo rna
% input:
% base_treino: base que sera utilizada para treinamento
% base_teste: base que sera utilizada para teste
% camada_interna: camada_interna usado no modelo
% output:
% f_medida:... |
function obj = configureActuator(obj, dofs, actuators)
% Configure the actuator information of the actuated joints
%
% Parameters:
% dofs: an object array or name cellstr of actuated joints
% @type cell
% actuators: a structure array of actuator configuration @type struct
%
% Th... |
% Stiffness Matrix
i = 1;
s = zeros(ndof, ndof);
while i <= ndof
j = 1;
while j <= ndof
s(i,j) = 0;
j = j + 1;
end
i = i + 1;
end
im = 1;
while im <= nm
jb = mprp(im,1);
je = mprp(im,2);
i = mprp(im,3);
e = em(i)
i = mprp(im,4);
a = cp(i)
xb = coord(jb,1);
... |
clear all ;
clc ;
N=120 ;
[D,x]=cheb(N);
I=eye(N+1);
M=2;
L=20 ;
m=0.2;
z=0.1;
y=L*(x+1)/2;
sc=2/L;
D1=sc*D ;
D2=D1^2 ;
D3=D1*D2 ;
gr=exp(-y);%gr=y.*exp(-y) ;
fr = 1 - exp(-y);%fr=2-exp(-y)-y.*exp(-y) ;
gr1 = exp(-y) ;
wr = exp(-y);
its=30 ;
%%%%%%%%%%%%%%%%%%%%%%%
for r=1:its
% A=D ;
%R1 = gr ;
A = D2 + di... |
%% ==================== BLIJF VAN DE VOLGENDE CODE AF! ====================
% |ab47f00b219278fdb076624c9f828064|
% exam_171010_1132
%
% LEES EN BEGRIJP DE VOLGENDE REGELS:
%
% 1 - De volgende DOOR ONS AANGEMAAKTE zaken mag je NIET aanpassen!:
% ... |
function cifti_write_wHDR_MSC(data,ciftitemplatefile,outnamestem,workbenchdir,giftitemplatepath,varargin)
%% Write out input GIFTI data from separate hemispheres into a CIFTI file containing both hemispheres
%
% This function takes an input concatenated GIFTI dataset
% (numvertices x timepoints), changes the h... |
testCr = AcidBase();
testGlu = AcidBase();
%
pH = [1:0.1:14];
pK_Cr = 11.02;
pK_Glu = 9.67;
%
% Calculate scaled rate constant
label1 = { 'H_2O', 'OH^-', 'H_2PO_4^-', 'HPO_4^{2-}', 'PO_4^{3-}' };
krate_H2O_Cr = testCr.rateReactionPerCatalyst(pK_Cr, 'H2O', pH);
krate_OH_Cr = testCr.rateReactionPerCatalyst(pK_Cr, 'OH... |
T=[10,3,4];
R_inv=[0,1/4,1/3;1/4,0,1/2;1/3,1/2,0];
CalcHeatFlux(T,R_inv)
|
function run_netprobe(N,id_proc,N_proc,rndinit)
% WRAPPER LAUNCH script for netfit package-wrapper NETFIT_main
if(nargin<1) N=10; end%selection of N
if(nargin<2) id_proc=1; end %processor to execute
if(nargin<3) N_proc=1; end % # of processors to use
if(nargin<4) rndinit=3711; end%random initialization
fprintf('In ru... |
function [segments, segmentTable, nodeIDs, startNode] = dendriteSegmentation(neuron, varargin)
% DENDRITESEGMENTATION
%
% Description:
% Split neuron into non-branching segments
%
% Syntax:
% [segments, table, nodeIDs] = dendriteSegmentation(neuron,...
% 'startNode', 1, 'visu... |
im = vuOpenImage('Brain4.dat');
clear e
kSpace = fftshift(fft2(im));
kStart = 127;
kStop = size(kSpace,2);
count = 1;
for t = -0.1:0.01:0.1
e(count) = EntropyMetric(t,kSpace,kStart,kStop,1,size(kSpace,2),2);
count = count +1;
end
figure,plot(e,'.')
%%
clear e
clear x
im = load('Brain4.dat');
fft_im = fft2(im);... |
close all
clear all
%% adjustable parameters
row= 64; % image reshape dimension
col = row;
b=8; %number of bit for quantization
noisepower = .005;
noisepower = .05;
% noisepower = .25;
modfun = 'halfsine'; % pulse shaping function {'halfsine', 'SRRC'}
K = 6; ... |
function [best_sigmas, best_sigma_dists, best_views] = geneticAlgorithm(eval_view,numIteration,N,nv,numROIs,representative_tensor,NumFeatures,crossover_type,spd_type,generation_type)
%0. initialization of the variables
%N = LH_train_N;
%nv = LH_train_nv;
%numROIs = LH_train_numROIs;
%eval_view = LH_eval_view;
%repres... |
function [W, Cw, cont] = pre_pg_ures(ts, V, B, quant1,u_res)
% pre_pg: pre(V) under (quant1, forall) while remaining in B using progress groups
%
% Returns a sorted set
Vlist = cell(1e4,1);
Klist = cell(1e4,1);
counter = 1;
W = uint32(V);
Vlist{1} = V;
Cw = [];
Klist{1} = Controller(W, container... |
function [float_data, sampleRecord] = openRawSampleRecord(filename)
disp(sprintf('Processing filed %s',filename));
fid_dat = fopen(sprintf('%s.dat', filename));
fid_raw = fopen(sprintf('%s.raw', filename));
if fid_dat == -1
disp(sprintf('Unable to open %s... |
data = load('dataset/FlujoVehicular2019.dat');
# mapeo nombres - columnas del dataset
mes = 1;
diames = 2;
hora = 3;
diasemana = 4;
estacion = 5;
sentido = 6;
tipovehiculo = 7;
formapago = 8;
cantidadpasos = 9;
cantidad_de_filas = rows(data);
# PUNTO D
# IDENTIFICAR LAS DOS FRANJAS DE TRES HORAS ... |
## Copyright (C) 2023 Gabriel Zalles
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distri... |
function ASET_ExportXlsFile(vars)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This function creates the EXCEL Files and export the file.
%
% by Dominguez Ruben, L. FICH-UNL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Read data
guiparams = getappdata(0... |
function testPLL()
% Test the phaseLockedLoop function
%Carrier frequency of 10 kHz
fC = 10*10^3;
%We sample at four times the carrier frequency
fS = 4*fC;
%Create a sample signal spanning a thousand periods
t = [0:1/fS:1000/fC];
%Signal amplitude
A = 5;
%PLL Cons... |
function make_testhorner(varargin)
defs = {'-DUNROLLHORNER' ... % (1)
'-DUNROLLLEVEL=1' ... % (2)
'-DSSE2INTRINSIC' ... % (3)
'-DUNROLLHORNEROLD' ...% (4)
'-DCROSSORDER' ... % (5)
'-DFULLCROSSORDER'}; % (6)
% path, include and link path, source
s = pwd;
include = ['-I'... |
function [wpt] = search_dynamic_path(SCAN_RANGE,SCAN_THETA,HLI_vel,HLI_max_dyaw,dt,OBS_NUM,OBS_VRT,vrt,points,angle)
% Initial
wpt = [points(1,1), points(1,2), angle];
p_f = points(2,:);
%%% 해야할 일
%%% scanning 할 때 꼭지점 부분 해결 (대강 해결됨)
%%% 속도가 조건에 따라 변하는 거 적용.
det_tot = 0;
get_first = 0;
landmark_prev = zer... |
function plot_modelsinfolder(folder)
if(~isdeployed)
addpath(genpath('./export_fig'));
addpath(genpath('./tight_subplot'));
end
if strcmp(folder(end),'/') == 0
folder = [folder '/'];
end
dir_list = dir(folder);
file_num = length(dir_list);
ncolumns = 8;
nrows = 4;
plotnum = 0;
clf;
figure('OuterPosition',[0 0 nco... |
clc;
close all;
clear all;
b=input('enter the input bits:');
ln=length(b);
for i=1:ln
if b(i)==0
b(i)=-1;
end
end
k=1;
for i=1:ln
for j=1:8
bb(k)=b(i);
k=k+1;
end
end
len=length(bb);
subplot(2,1,1);
stairs(bb,'linewidth',2); axis([0 len -2 3]);
title('ORIGINAL BIT SEQUENCE b(t)')... |
month = import('enter month ');
switch variable
case {1,2,3}
disp('first')
case {4,5,6}
disp('second');
case {7, 8, 9}
disp()
case{10, 11, 12}
end |
function [area] = integrals(arr1,arr2)
% Given two sets of (x,y) values ordered by their x values, compute the positive area
% between the two curves.
% One set of points is guaranteed to lie entirely above the other, but it may be either
% the first or second input.
% In other words, the y-values of one i... |
function cll = CL(Alpha,Beta)
% Rolling moment
a=[0 0 0 0 0 0 0 0 0 0 0 0
-.001 -.004 -.008 -.012 -.016 -.019 -.020 -.020 -.015 -.008 -.013 -.015
-.003 -.009 -.017 -.024 -.030 -.034 -.040 -.037 -.016 -.002 -.010 -.019
-.001 -.010 -.020 -.030 -.039 -.044 -.050 -.049 -.023 -.006 -.014 -.027
.000 -.010 -.022 -.0... |
function CA_dose_in_mmol_per_kg = compute_CA_dose_in_mmol_per_kg(CA_Dose, CA_Type, Weight, log_file, log_window_handle)
CA_dose_in_mmol_per_kg = [];
switch CA_Type
case {'Prohance', 'Magnevist', 'Omniscan'}
CA_molarity_in_mmol_per_ml = 0.5;
otherwise
output_msg(sprintf('Unknown contrast agent type: %s', CA... |
function [networkFile nodeFile] = AMIGO_network2Cytoscape(inputs,fname,id_params)
% export the network for Cytoscape based on analytic computation of the
% Jacobians.
if nargin <3
id_params = [];
end
% fill the inputs with the default values to avoid non-defined fields
evalc('inputs = AMIGO_Structs_PE(inputs)');
... |
subplot(3,1,1);
plot(tout,yout(:,1),'r','LineWidth',1.5);
xlabel('t, c'); ylabel('I, A');
title('DC motor step response');
grid on;
% hold on;
subplot(3,1,2);
plot(tout,yout(:,2),'b','LineWidth',1.5);
grid on;
xlabel('t, c'); ylabel('w, rps');
subplot(3,1,3);
plot(tout,yout(:,3),'k','LineWidth',1.5);
grid on;
xla... |
% b = risolviSistemaLUpivoting(A,b)
% Risolve il sistema lineare Ax=b fattorizzando LU con pivoting
% parziale la matrice nonsingolare A.
%
% Input:
% -A: matrice nonsingolare dei coefficienti;
% -b: vettore dei termini noti.
% Output:
% -b: vettore delle soluzioni.
%
% Autore: Tommaso Papini,
% Ultima modifica: ... |
function Forecast = updateForecast(varargin)
%Date is the date number, Time is a vector of times (in hours)
global Plant
Date = varargin{1};
if length(varargin)==1 || varargin{2} == false
WYHydroForecast(Date(end));%if october 1st,Run a yearly forecast for hydrology
end
switch Plant.optimoptions.forecast
case '... |
function [fileList, dirList] = GetFileList(dirPath)
%GetFileList 引数で指定したフォルダ直下にあるファイル名・フォルダ名のリストを取得
% 詳細説明をここに記述
temp = dir(dirPath);
temp(1:2) = [];
fileList = {temp([temp.isdir] == 0).name}'; % フォルダ以外のリスト
dirList = {temp([temp.isdir] == 1).name}'; % フォルダのリスト
end
|
function imgbHist = img2binary(img, mode)
% Q2. Output the binary image
%% Use mean of each pixel thresholding
thrAve = mean(img, 'all');
%% Use histogram thresholding
histGray = [];
minIdx = min(img,[],'all') + 1;
maxIdx = max(img,[],'all') + 1;
medIdx = round((minIdx + maxIdx) / 2);
for i = minIdx:maxIdx
histGra... |
% Lo mejor seria que f y f_prima esten en una misma funcion, y la segunda tome
% como segundo parametro el valor de verdadero
function [x, h] = newton(f, f_prima, x0, kmax, tol)
for k = 1 : kmax
x = x0 - f(x0) / f_prima(x0, true);
h(k) = f(x);
if (abs(h(k)) < tol)
disp 'f(x) < tolerancia.';
return;
... |
%costs=[0.01,0.05,0.10,0.20,0.40,0.80,1.60,2.00,2.40,2.80,3.20,6.40,12.80];
costs=[0.01,0.40,0.80,1.60,2.80];
nr_initial_values=24;
continue_previous_run=false;
evaluate_BSARSA=false;
evaluate_full_observation_policy=false;
try_new_initializations=true;
if try_new_initializations
mu0(:,1)=[1;1;1];
mu0(:,2)=[... |
clear all;clc; close all;
%% User Interaction
%please fill out!!!! - !!!!
%which ROI dou you need 1 or 2?
ROIX=2;
%do you want outliers?
outlier_included=false; % 4 "worst (TF-value-outlier)" datasets will be excluded
%do you want plots?
plots=true;
aspdf=true;
%conf... |
function cca_plotcausality(M,nodenames,sfac);
%-----------------------------------------------------------------------
% FUNCTION: cca_plotcausality.m
% PURPOSE: plot causal connectivity given a matrix of Granger causalities
%
% INPUTS: M: log ratio Granger causalities, NaN for nonsig values
% node... |
function movieList = loadMovieList()
%GETMOVIELIST reads the fixed movie list in movie.txt and returns a
%cell array of the words
% movieList = GETMOVIELIST() reads the fixed movie list in movie.txt
% and returns a cell array of the words in movieList.
%% Read the fixed movieulary list
fid = fopen('movie_ids.txt... |
%% CODE for IE 690 Project!
% Written by Sriram Karthik Badam, Deok Gun Park
% based on the code examples provided in Chalearn
clear;
clc;
if ~exist('this_dir')
this_dir=pwd;
end
data_path = [this_dir '/Examples/']; % Path to the sample data.
data_dir = [data_path '/devel/']; % Path ... |
%% fn_reallydlg
%% Syntax
% b = fn_reallydlg(line1,line2,..)
%% Description
% returns true if 'Yes' has been answered
% argument can be one or several string or cell array of strings
%
% See also fn_input, fn_structedit
%% Source
% Thomas Deneux
%
% Copyright 2009-2012
%
|
Strings_01 = {'*Heading';
'** Job name: sunil01 Model name: Model-1';
'** Generated by: Abaqus/CAE 6.14-1';
'*Preprint, echo=NO, model=NO, history=NO, contact=NO';
'**';
'** PARTS';
'**';
'*Part, name=Part-1';
'*Node'};
xincr = 2;
yincr = 1;
xbase = 1:xincr:4;
ybase = 1:yincr:2;
[x,y] = meshgrid(xbase,ybase);
xc = x;
... |
%choose the reconstructed 4D nifti file
%(Mkf)
[FileName,PathName] = uigetfile('*.nii','Select the Nifti 4D dataset','/home/sophie/Desktop/');
file=strcat(PathName,FileName)
D=MRIread(file);
Data=D.vol;
S=size(Data);
%Average walk and not walk
Walk=Left+Right+Straight;
%plot and choose a threshold
plot(Walk)
%Rest... |
function [cbspmod]=histhacksp_run(cbtarget,cbsp,K,T,shift)
%run histhacksp to get result
N=length(cbsp);
cbspmod=cell(N,1);
parfor i=1:N
imtarget=double(cbtarget{i});
img=double(cbsp{i});
selection=nodeselectionsp(img,K,shift);
tic;
[img,distori,dist]=histhacksp(img,imtarget,K,T,selection);
... |
function power = process_song(filename)
% Usage: process_song( song_file_name )
% This function does a segmented resampling of a song array, 1000000
% samples at a time, and then applies various filters.
[song, fs] = wavread(filename);
% NOTE: There's a bug in Matlab's resample.m which we can avoif by sett... |
function [ Patch_Split ] = SplitData( DataSet, LabelSet, param )
% [ Patch_Split ] = SplitData( DataSet, LabelSet, param )
% Partitioning the data manifold via top-down hierarchical clustering
% Input:
% DataSet = d x n data matrix
% LabelSet = n x 1 label
%
% Output:
% Patch_Split = ... |
function [SWITCH] = switchControl3( SWITCH, bufferD, hdr )
if hat - SWITCH.lastSwitchTime < SWITCH.coolDownDuration
return
end
HDR = get_hdr( bufferD, hdr );
if HDR.nsamples < SWITCH.nx
return
end
DAT = get_dat( bufferD, [HDR.nsamples-SWITCH.nx+1 HDR.nsamples]-1 )';
%DAT = readBufferData( [HDR.nsamples-SW... |
function [Xv] = vec(X);
%
% [Xv] = vec(X)
%
% Vectorizing (vec) operator.
%
% This operator stacks the columns of the matrix X into a
% single column vector Xv.
%
% See - Brewer, J. W. "Kronecker Products and Matrix Calculus in System Theory,"
% IEEE Transactions on Circuits and Systems, Vol. cas-25, n... |
function[myrank] = node_rank(v, v_size)
rank = 1:v_size;
[~, node_perm] = sort(v, 'descend');
[~, myrank] = sort(node_perm);
end |
function [finalPic, histNew] = histHSV(image)
maximum = max(image(:));
minimum = min(image(:));
range = maximum - minimum;
histOld = zeros(256,1);
histNew = zeros(256,1);
sorted = sort(image(:));
uniqueVals = unique(sorted);
histOld = zeros(length(u... |
function nonlinear_estimate=AutoColorEstimateNonLinear(rawxyY,myxyY,phosphers,lut,colorimeterhandler,displayhandler,options)
% function nonlinear_estimate=AutoColorEstimateNonLinear(rawxyY,myxyY,phosphers,lut,colorimeterhandler,displayhandler,options);
%
% Estimate [R,G,B] values to produce xyY you want to display... |
clear all;
clc;
%Konstanter
% L = 0.5; %Lemmarnas längd
% m = 0.025; %Massan på pilen
L = 2.5; %Lemmarnas längd
theta0= 0.3491;
x0=L*sin(theta0); %Stränghöjd i startläge
g=9.82; %gravitation
vinkel= 45; %utgångsvinkel
y0=1; %Start höjd
totaltDrag = 5;
draTillbaka = totaltDrag-x0;%Hur långt vi drar pilen
m = 5.... |
function x = inverse_quadratic(x0, x1, x2, n)
x(1) = x0;
x(2) = x1;
x(3) = x2;
for i = 4 : n
x_i = [x(i - 3) x(i - 2) x(i - 1)];
y_i = f(x_i);
[a, b, c] = polynomial(y_i, x_i);
x(i) = c;
end
|
Wanneer je meerdere output variabelen van een functie
wilt krijgen, gebruik je blokhaken: [] bij het aanroepen
van deze functie. |
clear variables
path = 'C:\Users\60069978\Documents\MATLAB\medicion11\';
camara = '1';
dir_camara = ['camara_' camara '\'];
set(0,'DefaultFigureVisible', 'on');
x = 285;
y = 380;
tag_x = num2str(x);
tag_y = num2str(y);
filename = [path dir_camara 'LUT_camara_' camara '_frame_x_' num2str(x) '_y_' nu... |
function [xo, XO_x, XO_u]=lake_f(x, u, dt, lakename, motion)
px = x(1);
py = x(2);
pz = x(3);
vx = u(1);
vy = u(2);
vz = u(3);
Lake = LoadLake([lakename '.tif'], 127);
[Gx, Gy] = imgradientxy(Lake);
if strcmp(motion,'linear')
px = px + vx*dt;
py = py + vy*dt;
pz = pz + vz*dt;
elseif strcmp(motion,'nonlin... |
function merged = merge(base,target, R, t)
% Merge two frames given camera pose
% for every point in (R*base+t) finds closest point form target
% and averages them into a combined frame_{base&target}, see 3.1.b
merged = [] ;
for col_b = 1:size(base,2)
dist = 1e10 ;
transf_point = R*base(:,col_b) + t ;
... |
function [ret]=Hun(vector)
len = length(vector);
ret = 1;
for i=1:len
ret = ret + sin(vector(i));
end
end |
function [l] = Shape2L(obj,shape)
%Shape2L Summary of this function goes here
% Detailed explanation goes here
l = obj.pca.Data2Coeff(obj.pose_mu,obj.pose_pc(:,1:obj.n_l),shape);
end
|
function [neighbourhoodWindow] = getNeighbourhoodWindow(image, i ,j, WindowSize)
area = size(image);
length = (WindowSize - 1)/2;
neighbourhoodWindow = image( max(1,i - length) : min(area(1),i + length) , max(1,j - length) : min(area(2),j + length) );
end |
%% Load things
probeFile='~/Desktop/HCN_128.sfp'
%probeFile = '/raid/MRI/data/4dImaging/Projects/MTLocalizer/EEG_EMSE/MOCOFields/spm_MOCOField_112707Data/Polhemus/spm_MOCOFields_112707.elp'
invFile = '/Volumes/MRI-1/data/4dImaging/Projects/MTLocalizer/EEG_EMSE/MOCOFields/arw_mocoloco20080108dat/Inverses/arw_MN_025_sph... |
function G=CreateGauss(E,D,M,N)
%产生均值为E,方差为D,MxN的高斯白噪声矩阵
%
G=randn(M,N); %生产m*n的随机数,分布为均值为0 ,方差为1
G=G/std(G); %除以对G的列取标准差
G=G-mean(G); %减去对列取均值
a=E; %均值
b=sqrt(D); %得到标准差
G=a+b*G
%c=var(G);
%d=mean(G);
%plot(G);
end
|
function y=bin(raw,pt,shift)
% bin raw data in windows of size pt with translation shift
if nargin<3, shift=pt; end
[nd,nt,nb0]=size(raw);
if nb0>1
nb=floor((nb0-pt)/shift)+1;
y=zeros(nd,nt,nb);
for k=1:nb
d=shift*(k-1);
y(:,:,k)=mean(raw(:,:,d+1:d+pt),3); % binning for each trial
end
... |
function out = simulation_TA(Pos_XY_UAV1,Pos_XY_UAV2)
global iter_prcd NUM_UAV SetTaskAllocation p_i p_f p_task NUM_TASK TASK_STATUS
global OBS_NUM OBS_VRT vrt_config DistPathForTask UNOBS_NUM iter_wpt cnt_terminate
global HLI_vel HLI_max_dyaw dt chk_range cnt HLI_pos second_choice wpt
... |
%Run any of the following commands to view the simulation
%Start original simulation
bayesianNavigation
%Load small map and start simulation with exploration = .5
load 'small_explore.mat'
bayesianNavigation3(real_grid,home,real_resources,.5)
%exploration = .01
bayesianNavigation3(real_grid,home,real_resources,.01)
... |
function [ a,b ] = generate_fracture(NX,NY,Lx,Ly,frac )
mu=frac(2,1);
phi=frac(2,2);
n_e=frac(1,1);
n_d=frac(1,2);
DX=Lx/NX;
DY=Ly/NY;
load mes.dat;
clu=[];
for nm=1:frac(7,1)
n=n_e+int8(n_d*randn(1));
close all;
%%stochastic input fracture geometry
theta_e=frac(3,1);
theta_d=frac(3,2);
theta=theta_e+theta_d*rand... |
function [T_t,L_t,S_t,iters,frob_err] = ls_alt_min_ten_st(T,true_r,r_hat,EPS,MAX_ITER,EPS_S)
t = 1;
frob_err(1) = inf;
T_t = T;
n = size(T);
n1 = n(1);
n2 = n(2);
n3 = n(3);
idx = [];
thresh_fact = 10;
thresh_mult = .99;
TOL = 1e-4;
r_hat = 1;
while frob_err(t)/norm(T)>=EPS && t<MAX_ITER % convergence check
if ~mod... |
function [Tn,Wn] = mEuler(f,y0,I,h)
%mEuler Método de Euler explícito
% resuelve el PVI y'=f(t,y), y(t0)=y0
% donde el vector I=[t0,t0+T] y h es el tamaño del paso
Tn=I(1):h:I(2); %la malla del tiempo
Wn=zeros(1,size(Tn,2)); %preset Wn
Wn(1)=y0; %Condicion inicial
for i=1:size(Tn,2)-1
Wn(i+1)=paso_Euler... |
function [result] = convert_to_cell(data)
for i=1:length(data)
result{i} = data(i);
end
end
|
mymotor = TmotorCASPRInterface ('/dev/ttyACM0',2,0.000008,0.8,1/800,1/(2*pi),1);
mymotor.open;
mymotor.lengthInitialSend(10);
tic;
while(toc<10)
mymotor.lengthCommandSend(12);
end
mymotor.close; |
function [ output_args ] = dpnPaperResiduals(op)
%dpnPaperResiduals - for all ions, determine the residual between measured
%and interpolated intensities, and express as a ratio of the measured
%intensity. In this way, we can generate a rough idea of where the
%residuals are largest, i.e. which pixels show the biggest... |
function data = ReadBinaryData(path_name)
data = [];
fid = fopen(path_name);
magic = int8('magic');
read_magic = fread(fid, 5, 'int8');
for ii = 1:5
if magic(ii) ~= read_magic(ii)
return;
end;
end;
n_row = fread(fid, 1, 'int32');
n_column = fread(fid, 1, 'int32');
data = zeros(n_row, n_column);
for ii =... |
%% Stelling 10
%
% Het is niet mogelijk om een .csv file te openen in Matlab.
%
Antwoord = 0;
|
function [rham] = boxg4_to_ham(ichan, rbox);
% function [rham] = boxg4_to_ham(ichan, rbox);
%
% Convert CrIS "g4" radiance from boxcar (unapodized) data to
% Hamming apodized.
%
% Input:
% ichan - [nchan x 1] channel IDs using the "g4" 1306-1329
% numbering for the guard channels.
% rbox - [nchan x no... |
function N = norfb(ec,ee,k,r)
%NORFB Calculates normal force with special constitutive model
x0 = ec(:,2)-ec(:,1);
l0 = norm(x0);
lambda = sqrt(2*ee + 1);
lambda_c = r/l0;
N = min(k*(1-lambda_c/lambda), 0);
end |
classdef class_intersection < handle
%CLASS_INTERSECTION Summary of this class goes here
% Detailed explanation goes here
properties( Access = public )
myArtery % reference to class_artery
name % name of the intersection
% parameters for pretimed in... |
function [inputMovie] = createImageOutlineOnMovie(inputMovie,inputImages,varargin)
% Gets outlines of cell extraction source outputs and overlays them onto a movie.
% Biafra Ahanonu
% started: 2018.02.15 [10:00:12]
% inputs
% inputMovie - [X Y Z] matrix of X,Y height/width and Z frames
% inputImages - [x y nFil... |
clc
close all
clear
N = 50576581;
I = 3233;
R = 550;
S = N - I - R;
I = I/ N;
R = R / N;
S = S / N;
y0 = [S I R]; %variables
pr = [0.2;0.1]; % beta and gamma respectively (params)
tobs = 0:1:500; % times intervals
[T,Y] = ode45(@(t,y)model(t, y, pr), tobs, y0);%estimar parametros!
hold on
plot(T,Y(:,1));
plot(T,Y(:,2))... |
close all;
clear all;
clc;
EyeDetect = vision.CascadeObjectDetector('RightEyeCART','MaxSize',[50,50],'MergeThreshold',8);
froot = 'E:\IP Project\New IP Project\dataset_images';
list = dir(sprintf('%s\\*.jpg', froot));
for index = 1:length(list)
close all;
% load image
fn = sprintf('%s\\%s', f... |
function psth_final = psth_func(Y,start_time_ms,psth_end_time_s,t_bin_ms,grid_root)
%psth_final = psth_func(Y,start_time_ms,grid_root)
%Add a normal description
%% Initial parameters
no_conds = 6; %The number of sound stimuli
no_repeats = 10; %The number of repeats for each echoic condition
num_stim = no_conds*no_rep... |
function density = APSA3B_integral_u3(u1, u3, theta)
if u3 <= 0.5
density = u3*(2*theta*u1 - theta + 2*theta*u3 - 4*theta*u1*u3 + 1);
else
density = u3 - theta + 2*theta*u1 + 3*theta*u3 - 2*theta*u3^2 + 4*theta*u1*u3^2 - 6*theta*u1*u3;
end
end |
%% MAIN 1: Gaining and saving all GRIMM data
clc
clear all
close all
addpath("../functions/")
%% P1 - Specifying Parametors
% Put all data in one time table with the following headers - dateTime, pm1
%, pm2.5 pm10
dataFolderPre = "/home/lhw150030/mintsData"
% dataFolder = "/media/teamlary/Team_La... |
function O = power_law (I,gamma)
%%This function will receive an imput image I and a value of gamma in order
%%to perform power law transformation on the original image
ID=double(I);
[m,n]=size(I);
%Let's apply the power law transform with constant c=1
O=abs((1*ID).^gamma);
%Now we have to normalise this output on an... |
net = setwb(net,fireflies(f,:));
% policzenie mocy swiatla
mse = 0;
for i = 1:L_SIZE
result = net(l_data(:,i));
mse = mse + (result-l_data_correct(i))^2;
end
% policzenie mocy swiatla - druga wersja :)
%result = net(l_data);
%mse = 0;
%for i = 1:L_SIZE... |
% Question Set-up (current best
xdim = 500;
ydim = 500;
n_timepoints = 10; % for example
regressor = randn(xdim,ydim,n_timepoints); % 500x500x10
% a stack of images w/ some interesting difference
regressand = randn(xdim,ydim); %500x500
% Actual work
tic % start timin... |
% Klasyfikacja punktow(obrazow) nalezacych do prostokata
%
% (1,3) o----------------o (4,3)
% | |
% | |
% | |
% (1,1) o----------------o (4,1)
%
% METODA ANALITYCZNA
net = newff([-10 10; -10 10], [4 1], {'hardlim... |
%Graphical User Interface
%Get Familiar With Matlab GUI -- Working Directory, CommandWindow,
%Workspace and Editor
%%
%Matlab as a calculator
%Enter Command in Command Window
%Execute Command and Statement in Command Window By Pressing Enter after
%the command or statement
%Check Display Similiar to Calculator
... |
function printvec(vec)
for i = 1:length(vec)
fprintf('Element %d is %.2f.\n',i,vec(i))
end
|
%main(path_front, path_side, absH, rheight_front, rheight_side, rtoe_side, rwaist_front, rwaist_side, rchest_front, rchest_side_midpoint)
path_front = 'data/img/1/1.jpg';
path_side = 'data/img/1/2.jpg';
result = main('data/img/1/1.jpg', 'data/img/1/2.jpg', 177, [[1,2];[3,4]], [[5,6];[7,8]], [9,10], [[11,12];[13,14]], [... |
function [filenames,feats] = readandcalctexturefeats(path,channel)
% calculate four texture features for all files matching path, using a
% specified channel if given (otherwise use channel 1)
% assume channel 1 if no specification given
if nargin<2
channel = 1;
end
% calculate features for all four directions of... |
data_baseline = readtable('/fs/neurosci01/djk/ncanda/group/scripts/design_matrix/ncanda_baseline.csv');
data_baseline_selected = data_baseline(strcmp(data_baseline.exceeds_bl_drinking, 'Y') &...
data_baseline.R11 == 1 & data_baseline.b_structural == 1 & data_baseline.b_restingstat... |
function N = power_ranger_jr(x, alpha, bf, error, power_threshold)
% function N = power_ranger_jr(x, alpha, bf, error, power_threshold)
%
% computes the Number of measurements
% to achieve a given power for a t-test accross
% several images of every voxel.
%
% Luis Hernandez
% University of Michigan
% Last Edit 2 - 15 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.