text stringlengths 8 6.12M |
|---|
%% Chebyshev
% fig_compareFilters.m
close all
clear
M = 1024; % Number of FFT points
m = 2;
N = 2*m*M-1;
load(sprintf('prototype/prototype from Chebyshev (M = %d, m = %d).mat',M,m))
p0 = p0/sqrt(2*M); % The prototype filter
%%--plot spectrum for prototype filter
idx1 = 1;
idx2 = 40;
idx3 = 81;
hfvt = fvtool(... |
function Set_Style(XLabel,YLabel,Edges,YLIM,Font_Size)
xlabel(XLabel,'Interpreter','Latex');
ylabel(YLabel,'Interpreter','Latex');
xlim([Edges(1),Edges(end)]);
ylim(YLIM);
set(gca,'FontSize',Font_Size,'TickLabelInterpreter','latex');
set(gca,'unit','normalize','Position',[0.07,0.1100,0.91,0.87]);
e... |
function [ content ] = readJson( filename )
%READJSON Save content of json file into a struct.
% INPUT filename: Full path to json file.
% OUTPUT content: Content of the json file as MATLAB struct.
% Author: Benedikt Staffler <benedikt.staffler@brain.mpg.de>
fileID = fopen(filename);
str = fscanf(fileID,'%s');
content... |
%% Purely linear spectra
scale_fct = max(real(lin_spec{1}{1}));
figure
plot(om1_rng,real(lin_spec{1}{1})/scale_fct);
hold on
plot(om3_rng,real(lin_spec{2}{1})/scale_fct);
%%
figure
plotyy(om1_rng,real(lin_spec{1}{1})/scale_fct,om1_rng,imag(lin_spec{1}{2})/scale_fct)
hold on
tmp1 = interp1(om3_rng,real(li... |
function iturbo2script_3zbio_ASH(data, nocarriers, noexps, expname, TM, Observation)
%% run iTURBO2 experiments and plot results against ash observations
% use 3 different bioturbation depth depending on the observed ash-profiles
% data = matrix of required data (age, mxl, abu, iso) - explanation see below
% nocarrier... |
function A=Insertion(A,n)
% 递归形式插入排序的子函数
% 功能为将A(n)插入前面A(1,…,n-1)个数中。
key=A(n);
j=n-1;
while (j > 0 && A(j) > key )
A(j+1)=A(j);
j=j-1;
end
A(j+1)=key;
|
clc;
% the number of road segments (nodes)
n = 220;
% scope of the road network 0~x/y/z
% 1 unit = 10m
x = 100;
y = 100;
z = 0; % if no Z axis, set z=0
% energy level (other properties) /residual energy
energy_level = 4; %Property f1 has four property categories
% energy cost /energy consumption
energy_cost = 3; %P... |
function [Q] = com2qua2(A)
% This function convert of complex matrix A into an
% equivlent quaternion matrix Q which the half size of A
A_upper = A(1:end/2,:);
A_lower = A(end/2+1:end,:);
Q = cat(3, real(A_upper), imag(A_upper), -real(A_lower), imag(A_lower));
% A = [a1, a2; -Q(:,:,3)+Q(:,:,4)*i, Q(:,:,1... |
%¼ì²é¾ØÕóµÄ½×Êý
A=eye(5)
[n,m]=size(A)
B=rand(5)
C=A*B
len=length(A)
A^3
A=[1,2;3,4]
B=[1,1;2,2]
Y1=A*B
Y2=A.*B
Y3=A.*A
|
function K = fdf_hinf(F, D, T)
% FDF_HINF(F, D, T) computes the H-infinity optimal fractional delay filter
%
% [INPUT]
% F: analog filter (TF object)
% D: fractional delay (positive real number)
% T: sampling period (positive real number)
%
% [OUTPUT]
% K: the optimal fractional delay filter (TF object)
... |
%% Restricciones
% NO FUNCIONA
% Optimicemos la función 2 de Deb |debf2| con la restricción de que x>0.35
%% AG con letales
t = [0:0.01:1];
p = population('real',[0 1],30,0,0.9);
p = random(p,100);
generaciones = 20;
p = evaluate(p,@debf2L);
for i=1:generaciones
p = sus(p);
p = crossover(p);
p = mutation(... |
function [K,F] = AssemblageP2(alpha,beta,f, X, T)
% Assemblage des matrices élémentaires "elemki" dans la matrice globale K
% Assemblage des seconds membres élémentaires "elemFi" dans le second
% membre global F
% cette fonction fait appel aux fonctions:
% 1) mat_elem_P1(alha,X,T,i)
% 2) SM_elem_P1(f,X,T,i)... |
%----------------------------------------
%此程序用以仿真导弹控制系统
%作者: Jiangfeng
%日期: 2011.4.11
%----------------------------------------
function [control]=control(dq)
global ktheta kpsai;
u1=ktheta*dq(1);
u2=kpsai*dq(2);
control=[u1 u2];
end |
function d_dt_theta = shaftSpeed(t,theta,rpm)
%Returns d_dt_theta(t) = shaft angular velocity [radians/second]
rps = rpm * pi/30; % shaft speed [radians/second]
% this is just a hard coded control of the rotor speed
t_trans = 2;
t_start = 1;
t_ss = 10;
t_up = t_start + t_trans;
t_down = t_up + t_ss;
if t ... |
function ringapert=SetPhysicalAperture(ring,apertureX,apertureY)
%ringapert=SetPhysicalAperture(ring,apertureX,apertureY)
%
% defines an aperture element before and after each element in ring
% describing the chamber dimensions.
%
% apertureX,apertureY are the chamber vertical and horizontal aperture.
%
% chamber size... |
%% 约束点条件不必要考虑,由于通过节点占用推出的机器人行驶方向已经框定了机器人不会同时进入一个交汇点(否则无法离开节点,这和约束1相违背,因此不会出现这个情况)
while 1
clear;
clc;
D = load('tsp_dist_broad.txt');
for_test_tradition=1; % 指示是否需要引用传统方法中使用的起点和终点组 1 是 0 否
if for_test_tradition==1
load('9_9_13.mat')
% temp=r_start_ori;
% r_start_ori=r_Goal_o... |
function img_hu = XuMuToHU(img_mu, water_mu)
img_hu = img_mu/water_mu*1000-1000; |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Author: Hamza Bourbouh <hamza.bourbouh@nasa.gov>
% Notices:
%
% Copyright @ 2020 United States Government as represented by the
% Administrator of the National Aeronautics and Space Administration. All
% Rights Reserved.
%
% Disclaimers
%
% No Warranty:... |
%---------------------------
% Pussy version of script 1.3
%----------------------------
images = {'../images/baboon.bmp', '../images/birds.bmp', '../images/Tulipas.bmp', '../images/floresVermelhas.bmp','../images/folhasVerdes.bmp'}
for i=1:length(images)
im = imread(images{i});
rgb2yuv(images{i});
end
|
%NOTE: turn on the first line below if you want to explore the nourishment efficiency
%for coordination; turn on the second line below if you want to explore the
%nourishment efficiencies for conservative non-coordination
% load('basePV1_basePV2_sensitivity_analyses_DATA.mat','a2_vec','a3_vec','R2_coord','R3_coord');
l... |
fs = 44100;
fb = 0.6;
frameLength = 300;
Delay = 0.04;
den = [1 zeros(1, floor(Delay*fs)) -fb];
num = 1.0;
iir = dsp.IIRFilter('Numerator', num,'Denominator', den);
[file,path]=uigetfile('*.wav'); %wavファイルの読み込み
fileReader = dsp.AudioFileReader(file,'SamplesPerFrame',frameLength);
deviceWriter = audioDeviceWriter('Samp... |
function SetLinearModelMatricesRoomA235( tController )
%Setting all the matrices of the linear time inveriant discrete model
%
BuildingCO2SystemMatrix();
%
tController.tModel.aafA = Ac_CO2;
tController.tModel.aafB = Bc_CO2;
tController.tModel.aafE = Ec_CO2;
tController.tModel.aafC = 1;
%
end ... |
function update=update(n)
global a;
global nexta;
global b;
global nextb;
global xvalues;
global yvalues;
mu_a = 0.001 % mobility of species a
mu_b = 0.001 % mobility of species
Dh=.01; %spatial res
Dt=.01; % temporal resolution
for x=1:n
for y=1:n
%state-stransistion function
aC=... |
function dianyunalg()
global toprestore;
global toprenum;
global hObject1 handles1;
global runstat;
global paravalue;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%算法参数配置%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
deltathrd = str2num(paravalue.alg.trianthreshold); % 三角形边长阈值,超过此阈值的三角形将被过滤掉
%% 载入数据
for i=1:toprenum
... |
function [actError, dError] = kernelActivationOptFun(logwScaler, targetAct, samples, w)
Sigma = exp(-.5* maha(samples, samples, diag((exp(logwScaler)*w).^-2)));
actError = (median(mean(Sigma, 2)) - targetAct)^2;
if nargout > 1
optfun = @(lws) kernelActivationOptFun(lws, targetAct, samples, w);
dError = numer... |
function [x, y, u, v, f_x, f_y, V_j, V, T, x_dog, y_dog, u_dog, v_dog, sheep_noise_arr] = run_simulation(maxv, tau, X_T, Y_T, ...
spd_dog, seed, ...
... |
function [T,I,Y]=perfusionResponseP2X4Stack2sub(y0,ton,toff,Ttot)
ode=modelODEP2X4Stack2sub(ton,toff);
[T,Y]=ode15s(ode,[0 Ttot],y0,odeset('NonNegative',1:9));
I=getTotalCurrentP2X4Stack2sub(Y);
end |
function add_transceiver(layer_obj,varargin)
p = inputParser;
addRequired(p,'layer_obj',@(obj) isa(obj,'layer_cl'));
addParameter(p,'load_bar_comp',[]);
addParameter(p,'Channels',{},@iscell);
parse(p,layer_obj,varargin{:});
filenames=layer_obj.Filename;
channels_open=layer_obj.ChannelID;
channels_to_add=p.Result... |
function heat_map = plot_intersection_scatter(xy, size_config)
% Plot heat map of intersections alone ray axis
% INPUT
% xy: n*2, points
% size_config: [side_pixels, side_real_length, center_x, center_y]
pixel_length = size_config(1);
real_length = size_config(2);
center = size_config(3:4);
dx = real_lengt... |
gain = 1;
doloop('orn_inputs_depr', gain, @MCRI_PGslow, 'PGMCS_tc', '170')
|
checkforao;
BPMname = getname('BPMx',[5 8]);
BPMname = BPMname(1:10);
% retry = 200;
% fprintf(' Setting LabCA retry count to %i\n', retry);
% lcaSetRetryCount(retry);
% liberainit([3 5],0);
% if strfind(getpvonline('SR_mode'),'Two-Bunch')>0
% setpv('LIBERA_0AB3:ENV:ENV_GAIN_SP',-33);
% else
% setpv('LIBER... |
function TESTmouse()
% just for testing
% initialize
[v, p] = Initialization();
% define frame input folder
p.inputFolderName = 'C:/Documents/Mouse/Mouse Tracker/Videos/04-12-1315-47-37.409';
% determine list of files in input folder p.inputFolderName
p.FileList = [LS([p.inputFolderName '/*.jpg'... |
function [score,BB] = visualize(B,W,fh)
% VISUALIZE Draws circuit components and wiring, and scores the solution
% Inputs:
% B - Board, a matrix with component ID's, 0's means no component.
% W - Wiring, a matrix (nx4) matrix with wires, invalid wires are
% ignored but charged into the ... |
function [f, re, b, z] = modelulMatematic
n = 7;
x = sym('x',[1 n]);
%%% Functiile
f = [
4*x(1) + x(2)
x(1) + 4*x(2)
3*x(1) + 2*x(2)
];
%%% Restrictiile
re = [
x(2)
];
%%% b (partea dreapta)
b = [
45
30
42
6
];
%%% Z ... |
function plot_discrete_conv(x, h, y, name)
% Print all variables.
disp('x');
disp(x);
disp('h');
disp(h);
disp('y');
disp(y);
figure();
set(gcf,'name', name)
x_len = length(x);
h_len = length(h);
% When plotting x and h
% complete shorter one's
% le... |
function [ y ] = poly_seq( x,n )
if n == 0
y = ones(1,length(x));
elseif n == 1
y = x;
else
y = (((2*n-1)* x .* poly_seq(x,n-1) - ((n-1)*poly_seq(x,n-2)))/n);
end
end |
% this program processes stress film image
%% import image and plot
[name,path] = uigetfile('*.tif');
if name == 0
return
end
I = imread([path,name]);
grayI = rgb2gray(I);
figure;
imshow(I);
%% locate center of circle and radii
hold on
[x,y] = ginput(3);
[r,c] = fit_circle_through_3_points([x,y]);
[... |
function fitness = fitness_conv(sim_mat, labels)
n = length(labels);
fitness = zeros([n,1]);
clusters = unique(labels);
k = length(clusters);
for i = 1:k
c = clusters(i);
mem = find(labels==c);
for j = 1:length(mem)
fitness(mem(j)) = sum(sim_mat(mem,mem(j)));
end
end
end |
function [ food_map,food_loc ] = genFoodMap( indx, v_r )
global seg
figure;
food_map = zeros(seg(indx).d.w,seg(indx).d.h);
o = seg(indx).o
food_loc = seg(indx).f_loc
food_loc = [(food_loc(:,1)-o.x),(food_loc(:,2)-o.y),(food_loc(:,3))]
for i = 1: size(food_loc,1)
sprintf('food_loc %d,%d',food_loc(i,1),fo... |
% exampleIBC.m
% - example of Indicator-species Based Cluster (IBC) analysis
%
% by David L. Jones, Jan-2013
% Mar-2013: updated
% -----Notes:-----
% This is data is from from van der Aart & Smeenk-Enserink (1975) and is Hunting
% spider abundances for 12 species (spiders) taken from 28 sites (site_labels)
% and ass... |
function img = greyscale(fn)
img = imread(fn);
[r c d] = size(img);
imd = double(img);
imd(:,:,1) = imd(:,:,1) - imd(:,:,1).*0.2989;
imd(:,:,2) = imd(:,:,2) - imd(:,:,2).*0.5870;
imd(:,:,3) = imd(:,:,3) - imd(:,:,3).*0.1140;
img = uint8(imd);
image(img);
end |
% MATLAB function of "Analytic" series solution of U_xx + U_yy = 1 on a
% unit square with U(x,y) = 0 at the boundaries
% Author: Casey Tyler Icenhour
% Organization: NCSU/ORNL
% September 26, 2016
function U_analytic = analyticFXN_poisson2D(p,series_index_max)
% generate ID list of nodes from length of p X-Y array
n... |
function [dT,Tm] = dTsubgrid(dT,dt,Tm,T_mid,Rho0,T_top,dsubgridt,Nx,Nz,...
nx1,nz1,xp,zp,xm,zm,dx,dz,Alpham,Cpm,Kappam,marknum,Rho_mid,Cp_mid)
TSUM =zeros(Nz,Nx);
WTSUM =zeros(Nz,Nx);
for m = 1:1:marknum
% Define i,j indexes for the upper left node
j = fix((xm(m)-xp(1))/dx)+1;
i = ... |
% Depedency: STAT toolbox for KDTreeSearcher and rangesearch
function [class]=fdbscan(xy,k,Eps)
%class(i) = 0 when point i is an outlier
% 1...65534 when part of a cluster (core or border)
class = zeros(size(xy,1),1,'uint16');
cluster = 1;
tree = KDTreeSearcher(xy);
%first classify every point as undefine... |
function [histogram] = myImHist (I , lower , upper)
[row,col] = size(I);
f = zeros(1,256);
sumofelements = 0 ;
for i = 1:row
for j = 1:col
binno = I(i,j);
if binno >= lower && binno <= upper
f(binno+1) = f(binno+1) + 1;
sumo... |
clear
clc
%% Defining Inputs
positive_integers=0:1:19; % n=0, 1,2,...,19
positive_integers = transpose(positive_integers);
ro=0.7:0.1:0.9; % ro=0.7, 0.8, 0.9
%% Probability Matrix of 20x3
% column 1: 0.7^n*(1-0.7); n = 0,1,2,...,19
% column 2: 0.8^n*(1-0.8); n = 0,1,2,...,19
% column 3: 0.9^n*(1-0.8); n = 0,1,2,...... |
function [perc, x] = evalSSR_perc(C, s)
% C \in R^N-by-N: representation matrix by self-expressiveness based method
% s \in {1, 2, ... n}^N: group labels
%
% perc: percentage of points that is subspace sparse.
% x: for plotting curve: [0; x; 1] \times [0:1/N:1, 1];
N = length(s);
x = zeros(N, 1);
for ii ... |
load('metadata_avg_new.mat');
vis = 1;
sem = 2;
e = zeros(9,2);
%%
S = metadata(1).targets(3).target;
C = sqrt_truncate_r(S, 0.2);
c = metadata(1).cvind(:,1);
for i = 1:9
t = c==i;
e(i,vis) = norm(bsxfun(@minus,C(t,:),mean(C(~t,:))), 'fro') / norm(C(t,:), 'fro');
end
%% Semantic
S = metadata(1).targets(4).targe... |
clear;
clc;
close all;
init_grid_world;
maxPEval = 1000;
delta = 0;
gamma = 1;
eps = 0.001;
for i=1:maxPEval
delta = 0;
for j=1:length(S)
v = V(j+1);
for k=1:length(A)
[nS, r] = grid_world_transition_reward(j, A{k});
Q(j+1, k) = 1*(r + gamma*V(nS+1)); %Q function
... |
clear; close all; clc;
img = im2double(imread('i1.jpg'));
ref = im2double(imread('r1.jpg'));
[fils cols] = size(img);
% ref = histeq(ref);
% img = histeq(img);
% Grafica perfil
% figure(1);
% subplot(221); plot(img(round(fils/2), :), 'b'); xlabel('Pixel'); ylabel('Intensidad'); title('Objeto');
% subplot(222); imsho... |
function [mathIntermediateData]=interfaceF_prepareMathDataInfo(type, aggregationInfo, commonDataInfo)
if isequal(type, 'FIRSTGUESS')
mathIntermediateData=0;
else
mathIntermediateData=interface_prepare(aggregationInfo.mathDataInfo, commonDataInfo);
end
end
|
%% Application of JUKF to Lorenz System
%% SNR is 10%
% Simulation run time
close all
clear all
clc
rng('default')
runtime = 100;
% Integration step
global deltat
deltat = 0.01;
% Number of iterations
ni = round(runtime/deltat);
% Number of states
global nse
ns = 3;
% Number of estimated states (... |
function [ COUNT ] = NrOfLIMoments( Moments )
%NrOfLIMoments Counts the number of LI moments computed up to now
%
% INPUTS:
% Moments = structure containing the moments
%
% OUTPUTS:
% COUNT = number of linearly independent moments
COUNT = 0;
for ii = size(Moments.LI,2):-1:1
if any(Moments.LI(:,ii))
COUNT = ... |
function pc=draw_AllSpots(AllSpots,frame,driftlist)
%
% function draw_AllSpots(AllSpots,frame,driftlist)
%
% Will draw all the spots detected by the auto spot picker in imscroll and
% stored in the AllSpots structure. The spots will be drawn at their
% location in the specified 'frame' using the driftlist to compensat... |
[percenterror W_1 W_2] = ANNRun(12, 0.0015,1000);
%load downloaded jpg/jpeg picture
%load 'assign3v6.mat'
% a = img;
% a = uint8(a);
% a = rgb2gray(a(:,:,:));
%
% a = 255-a;
% flag = 0;
% num = 130;
% for m = 1: size(a,1)
% for n = 1 : size(a,2)
% if a(m,n)>=num
% a(m,n) = 255;
% end
%... |
classdef Needle < MapChip
methods
function obj = Needle(x,y,direction)
obj@MapChip(x,y);
obj.name_ = 'block';
obj.rigit_ = 0;
obj.death_ = 1;
switch direction
case 1
obj.imdata_ = imread('needleUp.bmp');
case 2
obj.imdata_ = imread('need... |
function [a, fmin, range] = min_max_norm_cvip(vector,s_min,s_max)
% MIN_MAX_NORM_CVIP - applies min-max normalization to set of feature vectors in a matrix.
%
% Syntax :
% -------
% a = min_max_norm_cvip(vector, s_min, s_max)
%
% Input Parameters include :
% ------------------------
% 'vector' ... |
function [Num_der, Err] = NumDerErr_tan(h)
%% Derivative approximation at x = 1
x = 1.0;
%% Numerical derivative
Num_der = (-3*tan(x)+4*tan(x+h)-tan(x+2*h))/h/2;
%% Real derivative
Real_der = 1/cos(x).^2;
%% Error
Err = abs(Num_der-Real_der);
end |
function [Plant] = PlantA(d,Veq,Weq,dw,Iw,I,L,md)
% Plant model from e_r, e_l to V, W
s = tf([1 0],[1]);
z = tf('z');
%% Plant Model (old-robot)
m = 3.4; mc = 2.76 + md; I = I ; Iw = Iw; L = L; R = 0.0420; d = d; dw = dw;
Weq = Weq; Veq = Veq;
Ao = m + 2*Iw/(R^2); Bo = I + (2*Iw*dw^2)/R^2;
% Linear Plant without a... |
function [x,y]=Coordinate(Room_tag,Size_Grid,scale)
Room_Length=Size_Grid;
Room_Width=Size_Grid;
step=scale; %测试步长
%计算最终剩余点区域的几何中点,作为定位的坐标
counter=0;
xmax=0;
ymax=0;
for x_i=1:Room_Width*step
for y_j=1:Room_Length*step
if Room_tag(x_i,y_j)==1
xmax=xmax+x_i/step;
ymax=ymax+... |
function J=hor_col(I,n,sigma);
% This function affects a Gaussian vertical Filter
% whit characters (2*n+1*1) and sigma on image I
Y=[-n:n];
Gy=(exp(-(Y.*Y)/(2*sigma*sigma)));
Gy=Gy/sum(Gy);
x=size(I(:,1,1),1);
y=size(I(1,:,1),2);
J1=zeros(x-2*n,y,3);
for j=-n:n
... |
classdef Recon_base
%RECON_BASE Summary of this class goes here
% Detailed explanation goes here
properties
end
methods (Abstract)
[v,vcomb,delta,ne]=runalg(m,s,supp,csupp,phaseref,kspace2imspace,imspace2kspace,maxits,gs,b0,coilprojw,debug)
end
methods (Static)
... |
clear paramsAll;
clear params;
params.Gridjob.runLocal = false;
params.Gridjob.requiremf = 5000;
params.Gridjob.wc_host = [];
params.Gridjob.jobname = 'concat';
params.Gridjob.initRandStreamWithSeed = 12345;
params.ActConcat.inActFolder1 = '../../20131217_ReLuDAE/20140204_InputZtrafo/labelMeZtransformed';
params.ActCo... |
function [vertStruct]=hextile(rect,size)
% hextile(rect,size)
% rect - [x y w h]
% size - distance between hexes (default 1)
% returns
% h - plot handle
% xy - centers of all hexagons drawn
[x,y,w,h] = deal(rect(1),rect(2),rect(3),rect(4));
if nargin < 2,
size = 1;
end
[c,s]=deal(cos(pi/6),sin(pi/6));
xlist = 0... |
% fname is path to aphiddata.csv file
% plots the trajectories of the <expnum> experiment
% sample usage: plotaphid('aphiddata.csv', 1);
function plotaphid(aphiddata, expnum)
% grabs the [frame number, x coord, y coord] of first experiment
indx = ( aphiddata(:,1) ==expnum);
sim1fxy = aphiddata(indx, [3, 4... |
clc;
clear all;
close all;
%%%%% LDS Work inspired from Raptis Work at UCLA Vision Lab
% data = Input your 3D accelerometer data here
block_size = 5; % Size of the Hankel matrices used in System Identification algorithm
system_order = 5; % Defines the order of the LDS
internal_iter ... |
function afSample = GetExpectedSample( tCopula )
%
afSample = tCopula.afExpectedSample;
%
end % function
|
stats = [];
statIdx = 1;
for iNumPos = 1 : 4 %5
for iUser = 1 : 11 %10
stats(statIdx,:) = [lili(iUser,iNumPos),iUser,iNumPos];%,iClassifier*11+iFeat];
statIdx = statIdx + 1;
end
end
%do the multi-way ANOVA
figure
[p,tbl,statss] = anovan(stats(:,1),{stats(:,3... |
function monitor_SR06U_VCM2
fprintf('\nMonitoring SR06U___VCM2 - if it goes off will turn on and reset last setpoint...\n');
while 1
sp = getpv('SR06U___VCM2J__AC00');
if getpv('SR06U___VCM2___BC22')==0
setpv('SR06U___VCM2___BC22',1);
a = clock;datestr = date;
fprintf('\n%s %d:%d:%.0f... |
function [cmResults] = runNMFBMRealTesting(cData, numRun, varargin)
%
% Evaluate the factorisation algorithms on real (input) datasets.
%
% @author: Jeffrey Chan, 2014
%
%
% Scans the input directories then runs the testing
%
% cData -
% numRum - the number of runs to experiment over ([0,numRum]). The appropriate... |
function CLA = alignclickset(tag,CL,type,FILT,CLA,NOALIGN)
% CLA = alignclickset(tag,CL,type,FILT,CLA,NOALIGN)
% Interactive alignment tool for focal clicks
% tag is the tag deployment string e.g., 'sw03_207a'
% CL is a vector of unaligned click cues
% type is 'rc' or 'bz' for regular click or ... |
function h_fig = plotOrientation(exptSummary)
plotIndiv = true;
retrainSess = 1:2;
laserSess = 3:12;
occludedSess = 13:22;
if ~plotIndiv %sets y axis limits
minValue = 30;
maxValue = 60;
else
minValue = 5;
maxValue = 85;
end
patchX = [2.5 12.5 12.5 2.5];
patchY = [minValue minValue maxValue maxVal... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% reverberacao.m
%%
%% This function evaluates the decay time of a room, given its
%% impulse response.
%%
%% [EDT,T20,T30,T40] = reverberacao(IR^2,Fs,flag)
%%
%% The input are the squared impulse response and its sampling frequency.
%% The delay of this impul... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%该程序主要用于训练样本;首先从数据库中读出各类人的手指静脉图像
%然后映射到高维空间中;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
clc
images=[];
ff=[];
img1=[];
u... |
%%Data is downloaded from http://www.ee.cuhk.edu.hk/~xgwang/MITtrajsingle.html
%%The file name is "filtTrk_parkinglot.mat"
%%There are 40453 tracks in the file
data = load('filtTrk_parkinglot');
fileID = fopen('subTracks', 'w');
seg = 20;
numOfSegs = 0;
for i = 1:length(data.trk)
subCounter = 1;
counter = seg;... |
%%**************************
xxxxxxxxxxxxxxxxxx
clear;
fai_cu=[.5 .2 .8];
for i_fai=1:3
%parameter_initialization_two_stage;
van_coe=73.07/100;
volume_ratio=fai_cu(i_fai);
fai=volume_ratio;
f_d=.01:.01:.99;
c_d0=35;
c_f0=.1;
%o_p_power=.5*niu*R*T*(c_d0-c_f0)/10^5;
o_p_power=0.5*van_coe*(c_d0-c_f0);
%o_p_energy=van_coe*... |
push 1
push 2
push 90
push 5
mod
pall
|
close all;
%clear all;
scale = .125;
sparsity = 1; %how much data to keep 1/sparsity*100%
lambda = 2;
snr = 5000;
type = 'SUB'
% load some datas
%load ../data/stars512;
%x=stars512;
%load ../data/sameer512
%x=sameer512;
%load ../data/rachel379
%x=rachel;
%load ../data/oscar1078
%x=oscar;
%load ./l1magic/Data/boats.ma... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Author: Hamza Bourbouh <hamza.bourbouh@nasa.gov>
% Notices:
%
% Copyright @ 2020 United States Government as represented by the
% Administrator of the National Aeronautics and Space Administration. All
% Rights Reserved.
%
% Disclaimers
%
% No Warranty:... |
function [F0, flag] = calc_F0(I, F0_handles_Position)
%% This function calculates the background as the mean of the selected ROI.
% We might consider of not saving the handle as a whole but only it's
% position property.
%% Inputs:
% I: Original image after first preprocessing (called I2 in read_disp_img).
% F0_handles... |
function [Mean, STD, STE] = Jin_MeanSTE_Line(x,y,varargin)
y = GetExcludeNan(y);
% markersize=25;
markersize=5;
linewidth=1;
% Example)
% Width=0.3;
% Color.color=53; Color.alpha=0.4;
% h = JMeanSTE_Line(1,a.data1,Width,Color)
if nargin == 2
Width = 0.25;
Color.color=4; Color.alpha=1;
end
if ... |
function result=perform(meanVector,covarianceMatrix,action,relevance)
rankedList=ChangeAction2RankList(action,length(meanVector));
result=metric(rankedList,relevance);
feedback=[relevance(action),action'];
relevance(action)=[];
[~,action]=sort(BeliefUpdate(meanVector,covarianceMatrix,feedback),'descend');
%%ranke... |
% Pattern Recognition Toolbox.
% Version 0.1 22-Oct-1999
% Copyright (c) Pedro L. Galindo Riaño
%
% Operaciones con un patrón
% -------------------------
% torow - Convierte un vector en un vector fila
% tocol - Convierte un vector en un vector columna
%
% Operaciones con una fila de salidas
% --------------... |
offsetX = 3478085;
offsetY = 7085263;
bear2010 = csvread('BearObs2010XY.csv');
bear2010 = bear2010-repmat([offsetX offsetY],size(bear2010,1),1);
%plot(bear2010(:,1)+offsetX,bear2010(:,2)+offsetY,'.','MarkerSize',3)
%hold on;
%draw_prov_borders;
%error('sdfsdf');
gridn = 20;
[P,PQ,XT] = lgcp(bear2010,'latent_method','L... |
function OrganizeTrialInfoCalculia_combined(sbj_name, project_name, block_names, dirs)
for bi = 1:length(block_names)
bn = block_names{bi};
%% Load globalVar
load(sprintf('%s/originalData/%s/global_%s_%s_%s.mat',dirs.data_root,sbj_name,project_name,sbj_name,bn));
% Load behavioral file
so... |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
%
%
%
% problem 2 - stability of y(t)=exp(x(t))
t=-5:0.01:10;
y=exp(cos(pi*t));
plot(t,y);
syms t
x=cos(t);
y=exp(x);
limit(y,t,inf)
limit(y,t,-inf)
|
function pet_modelall_lat_xxx_123_latview
% ANOVATWOWAYJAGSSTZ
%
% Bayesian two-way anova
%
% Original in R: Kruschke, J. K. (2011). Doing Bayesian Data Analysis:
% A Tutorial with R and BUGS. Academic Press / Elsevier.
% Modified to Matlab code: Marc M. van Wanrooij
% % Specify data source:
% dataSource... |
% function simul(position_t)
fig = figure(1);
hold on;
grid on;
set(gca ,'GridColor','w');
set(gca,'Color','k');
xlim([0 640]);
ylim([-320 320]);
zlim([0 700]);
% view(-3,10);
% view(0,90);
view(0,0);
for t= 1:1000
if mod(t,1)==0
h= scatter3(position_t(:,1,t),position_t(:,2,t),position_t(:,3,t),'w','.');... |
function f=chipDynoLikeStatNoise(params,data,precs,X,nEffectGenes,R,C);
% CHIPDYNOLIKESTATNOISE marginal likelihood for chipChip dynamical model
% CHIPDYNO
nGenes=size(data,1);
nTrans=size(X,2);
npts=size(data,2);
beta=params(1);
gamma=params(2);
mu=params(3:2+nTrans)';
V=params(3+nTrans:end-nTrans)';
preSigma=spars... |
function result = cinputdialogs(DlgName, DlgTxt, DlgDef, DlgMode)
%res = cinputdialogs('hej,'du','glade', 0);
global contloop result deleted figinp OKCallback CancelCallback;
if DlgMode == 0
contloop = 1;
OKCallback = 'cinputdialogs(''DlgName'',''DlgTxt'', ''DlgDef'',2)';
CancelCallback = 'cinputdialogs(''DlgName'... |
%% Plot the centers and their diam/4 balls just to see how it looks
%% Author: Leena Chennuru Vankadara
% Theory of Machine learning group,
% Max Plank Institute for Intelligent Systems
clear all
close all
clc
% load('../Datasets/twelveclustersgaussian2D.mat')
% X = table2array(clustersgaussian2D);
load('..... |
function [ outVal, outGr, outHes ] = ExtTridiag2( x0, VGH)
% Extended Tridiagonal 2 function
n = length(x0);
outVal = 0;
outGr = zeros(n, 1);
c = 0.1;
% computes the value of function in point x0
if VGH(1) > 0
for i = 1:n-1
outVal = double(outVal + (x0(i)*x0(i+1)-1)... |
%%%%%%%%%%%%% function pecstral_analysis.m %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Purpose:
% performs pecstral analysis
%
% Input Variables:
% pecstrum_test pecstrum of test object
% C weight vector for finding appropriate object from test image
% pecstrum_ref ... |
DL_wt(1).path = '/Volumes/flyplacememory/TJ/VR_Maze_Experiment_Data/temperaturePreference/2013-12-09/20130912102155_stimulusTest';
DL_wt(2).path = '/Volumes/flyplacememory/TJ/VR_Maze_Experiment_Data/temperaturePreference/2013-12-09/20130912121352_stimulusTest';
DL_wt(3).path = '/Volumes/flyplacememory/TJ/VR_Maze_Experi... |
clc
clear all
s=tf('s');
syms s ;
syms w;
H = tf([2 5 1],[1 2 3])
nyquist(H) |
clear all
close all
clc
%% 2.1.6
h = 2;
a = .05:.05:1.95;
k = h./a + sqrt((h./a).^2 - 1);
s = (k.^2-1).*a./k/2;
figure(1);
plot(a,s);
xlabel('Wire radius, a');
ylabel('Line charge position, s');
grid on;
axis([0 2 0 2]);
%% 2.3.3
a = 1; h = 2;
k = h/a + sqrt((h/a)^2-1); s = (k^2-1)/k*a/2;
x = -4:.25:4; y = x;
[xx,yy]... |
function [ap] = calc_ap(gt, desc)
% ap = calc_ap(gt, desc)
%
% gt : ground truth labels [-1,1]
% desc : decision_values
%
%----------------------------
% for test only
% gt = [-1 1 1 -1 -1];
% desc = [0 1 -1 0 0];
assert(length(gt)==length(desc));
gt = gt(:);
desc = desc(:);
[dv, ind] = sort(-desc); dv = -dv;
gt = gt... |
function tf=isTreeCell(tree)
% Return true if BSP tree node is a cell.
tf=ischar(tree); |
clc;
close all;
%image = imread('checkboard.jpg'); %This is a color image
%image = imread('rolla.jpg');
im1 = imread('1.tif');
im2 = imread('2.tif');
im1_temp = im1;
im2_temp = im2;
im1 = rgb2gray(im1);
im2 = rgb2gray(im2);
%im1_temp = im1;
%im2_temp = im2;
im1 = double((im1));
im2 = double((im2));
S=1;
N = 7;
... |
function MnUBmsmb_analytic_parameter_space(n,K3,K6)
ODE = @MnUBmsmb_analytic;
BC = @No_BC;
p.n=n;
p.K3=K3;
p.K6=K6;
p.signal = 'monomer';
N = 1:1:n;
r.p1_min = -8;
r.p1_max = 8;
r.p2_min = -8;
r.p2_max = 8;
res = 100;
K1=logspace(r.p1_min,r.p1_max,res);
K2=logspace(r.p2_min,r.p2_max,res);
% Thes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.