text stringlengths 8 6.12M |
|---|
clear
load G.mat;
%load G_ft.mat;
G_ft = fft(G);
%load x.mat;
%load TAU.mat;
%load SIGMA.mat;
%x = csvread('x.csv');
% parameter
n = 256;
W = 133;
B = 16;
delta = 2*10^-9;
k = 4;
d = 1;
L = 8;
dk = d*k;
[ x ] = x_sample( n ); % f_translated vector
TAU = zeros(L,1);
SIGMA = zeros(L,1);
I = zeros(n, L);
Z_I = zero... |
clc
clear all
close all
%rho=10960; % kg/m^3
%cp=237; % J/kg*K
k=1.25; % W/m*K %Peter: values from "Termal characterization of natural and synthetic spider silks (Munro)
alpha = 5.7e-7;%k/(cp*rho); %Peter: values interpolated due to thickness and diameter used in paper
kg = 0.024; % air W/m*K
a... |
classdef emitter < handle
properties
loc = NaN(1,2)
spec
survey = struct('percents',{},'volts',{},'freqs',{},'counts',{},'stds',{},'averages',{},'ScanFit',{})
region = struct('span',{},'slow',{},'done',false,'err',{}) % This does not set done to false
status = '';
err
en... |
% 10.12.99
%
% Alternating Conditional Expectation algorithm (ACE) to calculate optimal transformations
% by fast boxcar averaging of rank-ordered data.
%
% The program ace_main.m performs a calculation of optimal transformations from a data set.
% The algorithm has been invented by L. Breiman and J.H. Friedman [1]
% a... |
function idx = read_index_file(filename)
% READ_INDEX_FILE - Open a text file and read a vector of index.
% Once index (integer typed) is expected on each line. The output
% is a double precision vector.
%
% Usage: idx = read_index_file(filename)
%
% Check filename type
if ~ischar(filename)
error('orchidee:io:re... |
%figure 6 of MVMO paper ---- plots the 20 element array pattern clc;
clear all;
close all;
M = 10;
m = [ -1*M+1 : 2 : M-1];
m = m/2;
k = 2 *pi;
lambda = 1;
d = lambda/2;
kd= k*d;
samplerate = 1800;
theta = -pi:pi/samplerate:pi-pi/samplerate;
% u = kd*m*cos(theta)+del
magf = load('fig6_im.txt');
magf =... |
function [filter_pts50]=grid_points_app(app,dpa_bound,step_size)
if all(isnan(dpa_bound))==1
filter_pts50=NaN(1,2);
else
[x3,y3]=size(dpa_bound);
if x3==1 %%%%%%If point DPA
filter_pts50=dpa_bound;
else
dpa_poly=polyshape(dpa_bound(:,2),dpa_bound(:,1));
no_holes... |
function x = normalize_angle(x)
%NORMALIZE_ANGLE Normalize an angle to [-pi, pi)
% nx = normalize_angle(x)
% x = input angle
% nx = normalized output angle
% force in range [0, 2 pi)
x = mod(x, 2*pi);
% move to [-pi, pi) if x > pi
x = x - 2*pi * (x > pi);
end
|
clear all;
close all; clc;
dTypes={'train'; 'test'};
D.train.N=1e3;
D.test.N=10e3;
%Generate Data
figure;
for ind=1:length(dTypes)
[D.(dTypes{ind}).x,D.(dTypes{ind}).y] =...
exam4q1_generateData(D.(dTypes{ind}).N);
subplot(2,1,ind);
plot(D.(dTypes{ind}).x,D.(dTypes{ind}).y,'.');
xlabel('x');ylabel('y'); grid o... |
function [s, t_sym_s] = mk_sinc(F_Hz, chan, Fsr_Hz, duration_s)
if (nargin < 4)
duration_s = 1;
end
if (nargin < 3)
Fsr_Hz = 48000;
end
if (nargin < 2)
chan = 2;
end
if (nargin < 1)
F_Hz = Fsr_Hz / 8;
end
Tsr_s = 1 / Fsr_Hz;
t_sym_s = ( -d... |
function envelope = getFlightEnvelope(m)
%GETFLIGHTENVELOPE Returns series of points to be plotted of flight
%envelope for altitude vs Mach.
%Minimum time to climb profile (Mattingley Fig3.E2)
climbV = [950 , 0 ;
950 , 11000;
1050, 11000;
1050, 11250;
1200... |
function isIntersect = isIntersecting(obstacles, current_x, current_y , goal_x , goal_y, num_obstacles)
%disp('function called');
isIntersect = false;
%[num_obstacles, n] = size(obstacles);
a1 = (goal_y - current_y);
b1 = -1*(goal_x - current_x);
c1 = (goal_y-current_y)*current_x - (goal_x - cur... |
function varargout = UpravljenjeKoracnimMotorom(varargin)
%
%----------------------------------------------------------------------------------------------
%
% UpravljanjeKoracnimMotorom.m je m-file za istoimenu aplikaciju
% namjenjenu za upravljanje dvofaznim bipolarnim koracnim motorima.
% Aplikacija ja razvijena u o... |
%% NN parameters
input_layer_size = 784; % 32*32 Input Images
hidden_layer_size = 50; % hidden units
nworkers =50;
%% generate communication graph
W0 = binornd(1,.4,[50,50]); %adjacency matrix is a bernoulli random matrix with p= 0.4
for i=1:50
W0(i,i)=1;
end
for i = 1 : 50
for j = i: 50
W0(i,j)... |
function models_out = subject_stimulus_filter(models_in, stimulus)
names.ellipse = {'ak', 'amk', 'hs', 'kl', 'ohm'};
names.grate = {'ek', 'mb', 'sp', 'sr', 'tt', 'vc'};
models_out = models_in;
for m = 1:length(models_out)
idx = [];
for s = 1:length(models_out(m).extracted);
if any(strcmp(models_out(... |
function string = mvltxtc(uic)
% Script for txt
% Siemens ASCII pulse file
% Called by mvlvm
set(uic,'BackGroundColor','white') ;
string = get(uic,'String') ; |
function tailTensor = estTailTensor(train, ...
iter_ind, ...
numObs, ...
skip, ...
span, ...
obsDim, ...
... |
% given the neigbors this function will perform the prediction by taking the class counts of neigbors and
%emitting the largest count label .
function predictVal = predict(actual_result, correct_result)
if(actual_result == correct_result)
predictVal = 1;
else
predictVal = 0;
endif
|
% Check Russian Blues Data
%
% This is a wrapper script to check the table and figures from:
%
% Winawer J, Witthoft N, Frank MC, Wu L, Wade AR, Boroditsky L. Russian
% blues reveal effects of language on color discrimination. Proc Natl Acad
% Sci U S A. 2007 May 8;104(19):7780-5. doi: 10.1073/pnas.0701644104. Epub
... |
clear all;
m=10000;
x=zeros(m,80*1);
x40=zeros(m,40*1);
xaxis=1:80*1;
y=zeros(m,1);
num_labels=8;
rmax=10;
for i=1:m
center=randi(79); %random int number drawn from uniform distribution from 1 to 80
y(i)=floor(center/(80/8));
r=randi(rmax)+1;
for j=1:80
x(i,j)=round(real(sqrt((r)^2-(j-center)^2)));
... |
function [rho_TT rho_ST rho_SS] = dens_wright_sot(T, S, p)
% Second order correction to Wright equation of state for sea water
% Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740.
% Units: T[degC], S[PSU], p[Pa]
% Returns density per temperature^2 [kg m^-3 degC^-2]
a0 = 7.057924e-4; a1 = 3.480336e-7; a2 = -1.11... |
function [TDtoMM] = TDtoMMbyidim( data,idim,MM,MMuidim)
%data is m xn matrix of m points with n coordinates
%idim is an m x 1 matrix with the intrinsic dimensions of the m points
%MM is a multi-manifold structure with fields: idim, stats,pathindex,ptindex,
%cubes,M,totalpts,cubepts,components, EVsqdist
%MMuidim is a li... |
function [t,x,a0,a1]=batchGenTsStepSize(tsName,dMin,dStep,dMax,theta,lambda,indref,eta,tcelsius,fs,nt,optsav);
%--------------------------------------------------------------------------
% Version 20171225, Silviu Rei based on load_ts36 by Dan Chicea
% [t,x,a0,a1]=batchGenTsStepSize(tsName,dMin,dStep,dMax,theta,lamb... |
function [f_filtered, var_residu, n_day, residu] = fct_filtered_several_day(f,n_day,dt)
% Temporally filterd the data
%
%% Set parameter
n_dt = n_day*(24*3600)/dt;
% if nargin < 2
% n_dt = 7;
% end
[Mx,My,Mz,N]=size(f);
MX=[Mx My Mz];
M=prod(MX);
%% Reshape
f = reshape(f,[M N]);
f_filtered = fct_filter(f,n_dt*dt,... |
% Multiparameter Eigenproblems (MultiParEig) Toolbox
% Version 2.3 03-Jan-2017
%
% Toolbox for multiparameter eigenvalue problems
%
% Toolbox contains numerical methods for multiparameter eigenvalue problems
%
% ------------------------------------------------------------------------
% Acknowledgements... |
classdef Joint
properties
m = zeros(1,1);
I = zeros(3,3);
Pc = zeros(3,1);
angle = zeros(3,1);
d_angle = zeros(3,1);
end
methods
function obj = Joint(m,I,Pc,angle,d_angle)
obj.m = m;
obj.I = I;
obj.Pc = Pc;
... |
% Andrew Brown Lab 3 Problem 1
clc
clear
%Practice with for loops and if statements
totalSum=0;
%For loop counting from 1 to 10 going up
for i=1:10
if i==1 %use proper grammar for the first bottle
fprintf('%0.0f bottle of beer on the wall\n',i)
else %use proper grammar for the plural "bottles"
... |
function attractiveWalls(serPort)
global F; global L; global R;
R_wheel = 0.2; L_wheel = 0.2;
e = 0.1;
updateSensors(serPort);
while F > 0;
SetDriveWheelsCreate(serPort, R_wheel, L_wheel)
updateSensors(serPort);
R_wheel = R*e; L_wheel = L*e;
en... |
function ori_array_tuning(a,theta,snrthreshold)
%function ori_array_tuning(a,theta,snrthreshold)
% Plot the ori tuning for the array, in the 10x10 grid
% for data in the form cells x stim x trials
%
if (nargin < 2)
%oristep = 360/length(unique(a.passes.BlockIDs));
%theta = [0:oristep:359.9];
%ori=... |
% This code is used to produce ground truth pattern and backprojection
% initializations;
% Written by Wei Zhun at ECE, NUS, 20th, Nov, 2017.
clc; clear all;
close all;
load('basic_para.mat');
load('Forward_Circ1.mat');
N_t=size(Pro_Para,2);
MAX = 1; Mx = 64; % discretization parameter
epsil_exa=zeros(Mx,M... |
function [Nran,F,Pxx,fr]=noise_rand(custom,nums)%随机脉冲噪声
%调用默认参数方式:noise_rand(0)
%输入参数:
%custom=0,表示使用默认参数;否则使用输入的nums
%nums:随机脉冲噪声个数,可以为0
%输出参数:
%t:输出时间
%Nran:异步随机噪声
%F:输出的频谱
%Pxx:输出的功率谱
%fr:频域上采样频率
%clf;
%clc;
if custom==0
l1=1+round(15*rand);%l1-合成的信号中随机脉冲的个数
else
l1=nums;
end
amp=ra... |
function feaout=torqueplot_real(feain)
tic
feaout=feain;
Kss=feaout.Kss;
Ksb=feaout.Ksb;
Kbs=Ksb';
Ksbb=feaout.Ksbb;
Krr=feaout.Krr;
Krb=feaout.Krb;
Kbr=Krb';
Krbb=feaout.Krbb;
rs=feaout.rso;
rr=feaout.rri;
Nt=feaout.sb-feaout.st;
mu0=4e-7*pi;
[D,P,Dw,Pw]=makeDP(feaout,Sthmn);
KinvKsb=Kss\Ksb;
Bs=D*(Kb... |
classdef copse_fig
methods(Static)
function xlim(limits, figs, direction)
% COPSE_FIG.XLIM reset x axes of all subpanels within specified figures
%
% limits - [xmin xmax]
% figs - 1, 1:4 etc
% direction - 'normal' or 'reverse'
... |
%% Plot for ifo d
load num1.mat
close all
h=figure
marker_list=['d','x','o','+','s'];
line_list={'-','--','-.',':','-'};
%%%%%%%%%%%%% this changes
for i=1:4
plot(T_iter(1:length(MRT(i,:)))*1.2, MRT(i,:), 'k', 'LineWidth', 1.1,...
'Marker',marker_list(i),'LineStyle', line_list{i},'MarkerSize',6, 'MarkerIndices'... |
% Process C. elegans network based on each neuron's function
%% Import network
[~, ~, raw] = xlsread('/home/jhow/Documents/OfficialRents/DataSets/Worm/NeuronConnect.xls','NeuronConnect.csv');
raw = raw(2:end,:);
raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''};
cellVectors = raw(:,[1,2,3]);
raw = ... |
function tau = f_windstress(mag,z)
% - wind stress in dynes/cm^2
%
% Usage: tau = f_windstress(mag,z);
%
% mag = wind speed in m/s
% z = height above sea surface of wind sensor in meters
% (default = 10)
%
% tau = wind stress (dynes/cm^2)
%
% See also: f_windCman, f_vecUV, f_vecPlot, f_ekmanDepth
% ----- ... |
function out = lab8_HT()
%Initial Data
global rho k mu T_in T_out T_s
rho = 1000;
k = 0.643;
mu = 0.001;
T_in = 30;
T_out = 70;
T_s = 100;
Re = [1, 4, 10, 100, 1000];
Cd = [24, 9, 4, 1, 0.44];
[a,b] = linear_regression(Cd, Re);
dt = 0.01;
... |
function [ result ] = make_sensing(idle , busy, SNR, threshold, signalPU_var ,S)
% --- Sinal do Prim?rio --- %
snr = 10^(SNR/20);
signalPU_m = snr; %% m?dia da distribui??o normal do sinal
% ------------------------- %
% --- Ru?do --- %
noise_m = 0; %% m?dia do ru?do (distribui??o Normal) N(0,1)
noise_v... |
%%如果单独的做点轨迹,应该可以用这些参数来评价点轨迹生成的好坏;因为同一条点轨迹的不同点对应的纹理信
%息应该差别不大。光流是按照块来匹配的,因此用块状超像素来做点超级点轨迹是合理的。在做的时候还可以考虑
%超像素的纹理信息。
function [tr, tr_lo, tr_mo, tr_co, all_center,all_cl]=super_point_trajectory(data, options)
%% Compute Trajectories;
disp('compute trajectories');
% if( exist([options.datafolder '\trajectory.mat'], 'file'... |
% Ideal Lowpass Filter
% function: ÀíÏëµÍͨÂ˲¨Æ÷
% Author: Wu Jiangnan 2019/4/5
%
function [ Hd ] = LPfilter( input,r)
% input : image in 'double' data type , 2 dimensions
% r : the radius of ideal filter;
% range is [0,1] ( normalized )
% R of filter
[m,n] = ... |
function ThrowFcn2(~,~, game, res1, N, M, FinishBtn, SelectBtn)
%% GET OFFENDER/DEFENDER DATA
offender = get(game.OffenseTxt, 'UserData');
defender = get(game.DefenseTxt, 'UserData');
Noff = get(game.board(offender).Text, 'UserData');
Ndef = get(game.board(defender).Text, 'UserData');
offOcc = get(game.board(offende... |
function HumanRepairLog(LogFile)
%%
BupFile = [LogFile(1:end-3) 'log.bup'];
c=0;
OK=false;
while OK == false
if exist(BupFile,'file')==2
c=c+1;
if c>1
BupFile = [BupFile(1:end-1) num2str(c)];
else
BupFile = [BupFile num2str(c)];
end
else
... |
function [ t, y ] = traffic_khan_rk4 (tstop, dt, ntimpl, npts, dist, fract, peak)
% function [ t, y ] = traffic_blank_rk4 (tstop, dt, ntimpl, npts, dist, fract, peak )
% Driver routine for ODE integration using Runge-Kutta 4th order method
% Input:
% tstop = final time (hr)
% dt = time step (hr)
% ntim... |
% Set stage indices
iG = 1; % keeps track of the gas stage number
iH = 1; % keeps track of the Hot fluid stream number
iC = 1; % keeps track of the Cold fluid stream number
iE = 1; % keeps track of the Environment (heat rejection) stream number
iA = 1; % keeps track of the Air (heat rejection) stream number
% Com... |
function x=GatelyValue(v,tol)
% GATELYVALUE computes the Gately point of an essential game v.
%
% Resource: Littlechild and Vaidya (1976)
%
% Usage: x=GatelyValue(v)
% Define variables:
% output:
% x -- Gately Point of the essential game v.
%
% input:
% v -- An essential TU-game of length 2^n-1.... |
%% Initialization: lese Eingabe ein
clear all;
useInputAssistant = false;
useSDP = true;
saveas = 'test';
% Zum Beispiel: Beispiel1, Minibsp_linkLoad, Vorlage
if (isunix)
otherFolder = '../DD_Nach_Zweiter_Kaibel_Konsultation/Eingabe/Instanzen/DVOPD';
else
otherFolder = '../DD_Nach_Zweiter_Kaibel_Konsultation/... |
function [ hx ] = ripf( fun, x0, err, mit )
hx = zeros(mit,1);
hx(1) = x0;
for i = 2 : mit
hx(i) = fun(hx(i-1));
if abs( hx(i) - hx(i-1));
break;
end
end
end
|
function mensaje_des = descifrado(mensaje, publica, privada)
% Funcion que descifra un mensaje cifrado utilizando las claves privada y
% publica.
% Compruebo el mensaje introducido
if(~ischar(mensaje))
disp('Error [descifrado]: el mensaje introducido no es una cadena.');
mensaje_des = 0;... |
function sim_mat = get_nbr_sim(adj,weight)
tic
n = size(adj,1);
adj2 = adj*adj;
deg = sum(adj,2);
deg_mat = repmat(deg,1,n) + repmat(deg',n,1);
sim_mat = adj2./deg_mat + weight*adj;
toc
end |
clear
more off
Plotz=0 # Perf graphs
Convz=0 # Conv graphs
Unitz=0 # Perf 10,20,...,100
opt=0
# graphical properties
# Experiment consts
home_path_sim='C:\Users\Matusovsky\Desktop\Masters-UC\results\experiments\PerformanceStatic\24_Feb_2016\'
# Performance
wrc_path_sim='\\file\UsersY$\yma61\Home\Desktop\res... |
function [quaternion, position] = markers2pose02(m)
% m should be the marker information for a single frame.
% m is in the form [x1 y1 z1 x2 y2 z2 x3 y3 z3....]
% Make it be a (8x3) matrix in the form
% [x1 y1 z1]
% [x2 y2 z2]
% ...
% [x8 y8 z8]
m = reshape(m,3,8)';
% p... |
clear
close all
% Numerical simulations to simple ODEs to convey general pricniples behind
% NCR
addpath('utilities')
FigPath = '../fig/preliminary_studies/';
mkdir(FigPath)
DataPath = '../out/preliminary_studies/';
mkdir(DataPath)
%% NCR
total_time = 3600;
% initial concentration of active complex
A0_vec = [1e-8 ... |
% EE 5353 - Biomedical Imaging
% Final Project - Image Reconstruction by Projections
% john jenkinson, UTSA Spring 2014
%
clear all; close all; clc;
%method 1.
tic
X=linspace(-3,3,256);
Y=linspace(-3,3,256);
phi=pi/9;
x0=-0.2;
y0=0.3;
a=2; a=a^2;
b=0.5; b=b^2;
c1=cos(phi);
c2=sin(phi);
u=zeros(256);
for y=1:length(Y)
... |
function [Coll, tf, raf, vaf, rbf, vbf] = Devoir3(rai, vai, rbi, vbi, tb)
% DEVOIR3 Executer le devoir3
systeme = Donnees(rai, vai, rbi, vbi);
pas = 0.01; %variation de temps à chaque itération
precisionMinimaleInitiale = systeme.PrecisionMinimale;
tf = 0;
raf = [0, 0, 0];
vaf = ... |
function writeToFile (data, fName)
fid = fopen([fName '.txt'], 'a');
fprintf(fid,'%f ', data);
fprintf(fid,'\n');
fclose(fid);
endfunction
|
function [nne] = astar(input_map)
%clc; clear all; close all;
dbstop if error;
global do_plot; do_plot = 0;
global nne; nne = 0;
H = figure;
global VISIT_ALL_NODES; VISIT_ALL_NODES = 0;
display(sprintf('INFO: visit all nodes %d',VISIT_ALL_NODES));
global G_COST; G_COST = 1;
display(sprintf('INFO: movement co... |
function [var_eps,VAF] = AOloopSID(G,H,As,Cs,Ks,sigmae,phi)
% This MATLAB routine closes the loop for the Subspace Identification model
% and computes the variance of residual wavefront, using system matrices
% As, Cs, Ks, G, H, covariance matric sigmae^2*I and simulated data phiSim
% Define some shorthards
o = size(G... |
function [ mirror_pnts ] = mirror( pnts,I )
if ~iscell(pnts)
error('pnt is not a cell');
end
centerX=size(I,2)/2;
nPnt=length(pnts);
mirror_pnts=cell(nPnt,1);
centerX=repmat(centerX,size(pnts{1},1),1);
for l=1:nPnt
tmp=pnts{l};
tmp=tmp(end:-1:1,:);
mirror... |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
%
%
%
%
% problem 8- Use the Laplace Transform to solve the differential equation
%
% y'''(t)+y'(t)-2y(t)=dirac(t), y(0)=2, y'(0)=3 , y''(0)=1
syms t s Y
y0=1;
yd0=3;
y2d0=1;
x=dirac(t);
X=laplac... |
% Matlab
clear;close all; clc
n_pml = 10;
nx = 1020; dx = 10; x = (-n_pml:nx-1-n_pml) * dx; %(1:11) and (1010:1020) are PML zone
nt = 700; dt = 1.0e-2;
v = 1000.0; rho = 1500;
R = 0.001; delta = n_pml * dx; d_const = (3.0*v/2.0/delta)*log(1.0/R) /(delta*delta);
d_pLeft = ( (-n_pml:0... |
clear;
%% Define variables to solve equation x using power law series x^i to solve f
syms x; % symbol to be used in equations
N=[2 4 6]; % number of terms in power series
omega=[0 8]; % size of domain from omega(1) -> omega(2)
%% Define equation to solve
f=exp(-x);
%% Set c and loop over all power law lengths N
c=ze... |
load('hemi-R/surf.mat');
load('hemi-R/unfold.mat');
lbl = labelmap;
% % crop
% buffer = 5;
% [r,c,v] = ind2sub(sz,find(lbl==8));
% lbl(max(r)+buffer:end,:,:) = [];
% lbl(1:min(r)-buffer,:,:) = [];
% lbl(:,max(c)+buffer:end,:) = [];
% lbl(:,1:min(c)-buffer,:) = [];
% lbl(:,:,max(v)+buffer:end) = [];
% lbl(:,:,1:min(v)-... |
% simmain: sumulation script for a reference implementation of the
% control law presented in M. Dolgov, U.D. Hanebeck, "Dynamic Compensation
% of Markov Jump Linear Systems without Mode Observation", 2015
simTime = 200;
dimX = 2;
dimU = 1;
dimY = 1;
dimW = 2;
dimV = 1;
numModes = 2;
A = zeros(dimX,dimX,numModes);
... |
clc; clear; close all
pkg load image
A = imread('files/sydney.jpg');
[m, n] = size(A);
subplot(2, 2, 1)
imshow(A)
title('Imagen Original')
% Calcular el histograma
h2 = zeros(256, 1); % h2 = [h(0) h(1) ... h(255)]
for i = 0:255
h2(i+1) = sum(sum(A==i));
endfor
subplot(2, 2, 2)
bar(0:255, h2)
tit... |
%@(#) tittel.m 1.2 94/08/12 12:15:51
%
function ht=tittel(titext,fsize,xl)
if nargin<2, fsize=14;end
if nargin<3, xl=max(0.5-length(titext)/80,0);end
c=get(gcf,'children');
for i=1:length(c),
if strcmp('titext',get(c(i),'userdata'))
delete(c(i));break;
end
end
ha=axes('pos',[0 .95 1.0 0.02]);
set(ha,'us... |
% Demo to divide a color image up into blocks.
function ca=subim(rgbImage,blockSizeR,blockSizeC)
% clc; % Clear the command window.
% close all; % Close all figures (except those of imtool.)
% Read in a standard MATLAB color demo image.
% folder = fullfile(matlabroot, '\toolbox\images\imdemos');
% baseFileName = 'p... |
function visualizeCells(phi)
%VISUALIZECELLS plots the values of cell variable phi.value
%
% SYNOPSIS:
%
%
% PARAMETERS:
%
%
% RETURNS:
%
%
% EXAMPLE:
%
% SEE ALSO:
%
% Written by Ali A. Eftekhari
% See the license file
d = phi.domain.dimension;
switch d
case 1
phi.value = [0.5*(phi.value(1)+phi.value(2))... |
%% Script for analyzing the Sit-Stand Test RGB Video
%% Reading the Input RGB Video
inputRGBVideo = VideoReader('test_data/MAH00174.MP4');
path_save_dir = 'temp';
% Create folders to hold the processed fils
path_diff_threshold = 'diff_threshold';
path_diff_mf_threshold1 = 'diff_mf_threshold1';
path_diff_mf_threshol... |
function bamp_simulate_from_empiricalData_RespPlot(variables_all,options)
%% Plot slopes
yLabelArray = {'\zeta','\beta','baseline','\sigma_1','\sigma_2','\mu_3','noise'};
colourArray = {'b', 'g','k', 'm', 'r','c','k'};
xLimitArray = {[-Inf Inf], [-Inf Inf], [-Inf Inf],[-Inf Inf],[-Inf Inf],[-Inf Inf],[-Inf In... |
%% b) Correr simulador1 50 vezes com critério de paragem P=10000 mas lambda = 1800
P = 10000;
l = 1800;
C = 10;
f = [100000, 20000, 10000, 2000];
delays = zeros(1, length(f));
errorsd = zeros(1, length(f));
loss = zeros(1, length(f));
errorsl = zeros(1, length(f));
N = 50;
for j = 1:length(f)
P... |
function ar=loop(data)
ar=1:numel(data);
end |
function probability_MLE = MLE_estimation(bayes_net1,generated_samples,N,A,B,C,D,E,epsilon)
% This function estimates the MLE probability
bayes_net2 = learn_params(bayes_net1, generated_samples);
Engine_4 = jtree_inf_engine(bayes_net2);
CPT3 = compute_conditional_probability(bayes_net2, N);
dispcpt(CPT3{5})
... |
% Copyright @ Mostafa Rahmani, 2017
function x = shrinkage_12(q,gamma)
[N1,~] = size(q) ;
q1 = sum(q.^2).^0.5 ;
q2 = repmat(q1,N1,1) ;
G = q - (q./q2)*gamma ; clear q2 ;
q3 = (q1 >= gamma) ; clear q1 ;
q4 = repmat(q3,N1,1) ; clear q3 ;
x = G.*q4 ;
|
% mathComplex4.m
% Visualization of a Compound Complex Function / Fourier Component
% Phase Portrait at a winding frequency fw
% DOING PHYSICS WITH MATLAB
% https://d-arora.github.io/Doing-Physics-With-Matlab/
% Matlab Version 2018a / 180915
% Ian Cooper
% email: ian.cooper@sydney.edu.au
% School of Physics, U... |
function trans = composeTransforms3d(varargin)
%COMPOSETRANSFORMS3D Concatenate several space transformations.
%
% TRANS = composeTransforms3d(TRANS1, TRANS2, ...);
% Computes the affine transform equivalent to performing successively
% TRANS1, TRANS2, ...
%
% Example:
% PTS = rand(20, 3);
% RO... |
%% The task of the program is to show the movie sequence so that the user
%% can choose the time point when catastrophy takes place
function [CellParams] = f_CellParams(InitImage, PosInCell)
clear;
close all;
%--------------------------------------------------------------------------
ImageFolder = '_InputIma... |
%MAX Dataset overload
% $Id: max.m,v 1.3 2007/03/22 07:45:54 duin Exp $
function [s,I] = max(a,b,dim)
prtrace(mfilename,2);
if nargin == 1
[s,I] = max(a.data);
elseif nargin == 2
if ~isa(a,'dataset')
s = b;
d = max(a,b.data);
elseif ~isa(b,'dataset')
s = a;
d = max(a.data,b);
else
s = a;
... |
function [x,q]=rayleigh(A,x,q,tol,maxit)
I = speye(length(A));
for i = 1:maxit
x = ( A - q*I )\x;
x = x/norm(x);
y = A*x;
q = x'*y; % rayleigh quotient: (x'*A*x)/(x'*x)
r = y - q*x;
if ( norm(r) < tol )
fprintf("Rayleigh iteration converged in %d iterations.\n",i);
brea... |
function ROI_matrix=circleROI(ROI_matrix, ROI_number, Xc, Yc, r)
% Creates a circular ROI
%
% ROI_matrix 2D matrix
% ROI_Number integer, 1, 2, ...
% Xc circle center position in pixels
% Yc circle center position in pixels
% r circle radius in pixels (could be fractions of pixels)
% Xr relative... |
function [B] = Q4_B (params, output, time)
fn = @(t,y)lifeCycleWithBuffelgrass(t,y,params);
[T,Y] = ode23s(fn,time,output);
B = Y(end,4);
end |
function rawdata=getdata(datapath,fidfolder,baselinecorrection)
%Reads the raw data of fidfolder in datapath, modifying it only by a
%baseline correction using the last points in each fid of number
%baselinecorrection.
%The rawdata dimensions increment as... {FID,multi,datablock}
% The user must figure out how to parti... |
function [ ke ] = fem_compute_elastic_force_elements(mesh, state, params, material, h, E, nu,rho)
% Copyright 2011, Kenny Erleben
if h
params.h_max = h;
params.E = E;
params.nu = nu;
params.rho = rho;
end
%--- Get number of elements
cntT = length(mesh.T(:,1));
%--- Allocate space for local elastic fo... |
% Derive jacobian function for 'block tilting' example.
%
% convention for natural constraints:
% written in the local frame whose last axis (Z in 3D, Y in 2D) aligns
% with the contact normal; Positive value for this number must means
% no contact, not penetration.
clear;clc;
% symbols
% poses in world... |
function anaT = analysis_table(lfps, splittype)
%%
% generate a table to see how variables are related to one another
% sessions x variables x stimulus type
%
if nargin < 2; splittype = 'drug'; end
% single pair or more? ===========================
ndrug = 1;
switch splittype
case 'drug'
ndrug = 2;
... |
% Nom du fichier d'output a analyser
repertoireOut = 'simulations/';
filename = 'excitation';
repertoireExe = './'; % Chemin d'acces au code compile (NB: enlever le ./ sous Windows)
executable = 'Exercice3'; % Nom de l'executable (NB: ajouter .exe sous Windows)
input = 'configuration.in'; % Nom du fichier d'entree de b... |
function [hist_prec,hist_prec_mean,mean_stop_num,stop_step,total_step,parms_inner] = get_early_stop_step
hist_prec = zeros(3,101);
stop_step = zeros(1,3);
total_step = zeros(1,3);
clear inited;
init
clear do_force do_plot
parms_inner = parms;
%z
if ~isfield(parms_inner,'metric_method')
parms_inner.metric_metho... |
function DelAvPref()
rmpref('AvPref');
end |
function [ allcValsMat,allcBARs, allHs, allTCFEs,allHverif,allAlphasMat,allKnees] = MWC_ScatterPlots( allNVals, maxRuns,LVal, rangC, rangAlpha, Htype,randType,plotTypes,Tcost,mtdi )
% This function plots all the scatterplots of H vs total cfe + a MaintCost
% The output is a list of structures for each value on containi... |
function gab_save_job(job,fid)
%a safe way to save a job struct. checks for prexisting job file
job=gab_clean_job(job);
if ~exist(fullfile(job.jobDir, [job.jobName '.mat']),'file')
if ~exist(job.jobDir, 'dir')
rec_mkdir(job.jobDir)
end
save(fullfile(job.jobDir, [job.jobName '.mat']),'job');
else
... |
function output = runLogisticNLLasso(depLearning,explLearning,depTest,explTest,explLearning1,depLearningQual)
[TT,KK]=size(explLearning);
explLearningNL = explLearning;
explTestNL = explTest;
for i=1:KK
for j=i+1:KK
U = explLearning(:,i).*explLearning(:,j);
if ~ismember(0,sum(abs(e... |
%=========================================================================
%
% Program to demonstrate the properties of the
% Functional Central Limit Theorem:
% Standardization of a random walk
%
%=========================================================================
clear all;
clc;
RandStream.setDefaultSt... |
%Whale Group at MTBI
%This function corresponds to the single males
%for the Whale Group (also know as the Whale Watchers :P )
%betay = birth rate of males
%mux = probability of surviving the single female cycle
%muy = probability of surviving the single male cycle
%y = single males
%px = paired females
funct... |
function rms_error = get_rms_error(X,Z)
rms_error = std(X(:)-Z(:)); |
% EXAMPLEMAS
%
% Files
% Agent - Example agent model for ExampleMas
% ExampleMas - Simulator to demonstrate async requests.
|
%%Wrapper to Gustav Model. Threshold vs. Accumulator. CDM. 03/06/17
%Aim is to test many radii and lateral offset to see if they produce different starting times.
%First step, compare across radii, sans noise, to see if the time to SWAction differentially changes across models.
%Get parameters from Gustav's best fit.... |
function [params, all_names] = parameters(runopts)
% Brian Livingston, 2020
% livingstonb@uchicago.edu
import solver.DHACalibrator
%% SET SHARED PARAMETERS
shared_params = struct();
shared_params.r = 0.01;
shared_params.Bequests = false;
% Statistics from the 2019 SCF
scf = se... |
function [dist] = bmCompareWeightedRecon(mMembership1, mMembership2, mAdj1, mAdj2, sMeasure)
%
% Compares the blockmodels represented by cPosition1 and cPosition2, using the
% weighted reconstruction error.
%
% INPUT:
% mMembership1 - matrix of memberships of each vertex
% mMembership2 - matrix of memberships of each v... |
close all;
sigma = eye(2,2);
mu = [2, 3];
r = mvnrnd(mu, sigma, 10);
m1 = size(r, 1);
figure
hold on
for c = 1:m1
ncr = mvnrnd([r(c,1), r(c,2)], sigma/5, 10);
plot(ncr(:,1), ncr(:,2), '*')
text(r(c,1), r(c,2), num2str(c))
end
legend(strread(num2str(1:m1),'%s'))
plot(r(:,1), r(:,2), '+')
hold o... |
function scrMatrix = multiEnrollmentScrProcessing(ndxFilename, uniSessionScoreMatrix, duration, maskVec)
%
% Inputs:
% 'ndxFilename' is an ASCII file with a list of files to load.
% 'uniSessionScoreMatrix' is a matrix of scores which includes any
% trial involving any session from any original file,... |
% Processes all tiff stacks in Folder to surfaces and defines ROI
% Needs external library: isomesh
Files = dir('*-Bin.tif');
for ii = 1:numel(Files)
display(['##### Processing Stack ',num2str(ii),' of ',num2str(length(Files))])
NameSplit = strsplit(Files(ii).name,'Bin');
embryoName = NameSplit(1);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.