text stringlengths 8 6.12M |
|---|
%% Script to run the spod_spectrum_ploot_imag_data.m for plotting the spectra
clc; clear;
close all;
% x = [10; 15; 20; 25; 30; 35; 40; 45; 50; 55; 60; 65; 70; 75; 80; 85; 90; 95; 100];
x = [10; 30; 40; 50; 70; 90; 100];
% Write out the files for plotting in paper
dirout = './';
count = 1;
for i = 1:size(x,1)
... |
function samples = tonalsuppression(samples, sampleRate, partials, windowDuration)
%TONALSUPPRESSION Reduce harmonic content in an audio signal.
% Remove tones from an audio signal by adding a phase inverted
% synthesized signal to the original signal. The synthesized signal is
% constructed by FFT analysis and t... |
function [r] = qmult(p,q)
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
p1 = p(1,1);
p2 = p(1,2);
p3 = p(1,3);
p4 = p(1,4);
q1 = q(1,1);
q2 = q(1,2);
q3 = q(1,3);
q4 = q(1,4);
r1 = (p1*q1 - p2*q2 - p3*q3 - p4*q4);
r2 = (p1*q2 + p2*q1 + p3*q4 - p4*q3);
r3 = (p1*q3 ... |
function [X,C,I,out] = twostatesys(inp,par)
% *************************************************************************
% Example Problem From
% Implementation of Dynamic Programming for n-Dimensional Optimal Control
% Problems with Final State Constraints
% Philipp Elbert, Soren Ebbesen, Lino Guzzella
% IEEE Transa... |
%%
% This script solves optimisation of the scenario-tree based model
% predictive control. The dynamic system considered is the standard
% spring-masss system.
%%
% Generation of the system
clear all;
close all;
clear model;
clc;
Nm=5; % Number of masses
T_sampling=0.5;
ops_masses=struct('Nm',Nm,'Ts',T_sampling,'xmin... |
function calc_plot_payoff(self, minpx, maxpx, interval, port_balance)
% 计算画图的函数
% 吴云峰 20170331
axes_handle = self.axes_handle;
if ishandle(axes_handle)
else
axes_handle = axes;
self.axes_handle;
end
cla(axes_handle, 'reset')
% 计算
self.calc_selection_to_structure;
if isempty(self.s)
return;
end
self.calc_r... |
% GenerateDispStr (disp) Testbench
% disp für scalar
clc
% Test Cases:
% TC Sonderfall Null
TC(1).value = unc(0,0.1);
TC(1).expected_str = '0.00(10)';
TC(2).value = unc(0.001351,0.0000001534);
TC(2).expected_str = '0.00135100(15)';
% TC Auffüllen mit Nullern
TC(3).value = unc(1.536e-9,0.0126e-9);
TC(3).expected_str ... |
function [p, accuracy, AUC] = performance_eval(data1, data2, scale)
% -------------------------------------------------------------------------
% Binary classification for multiscale entropy features
%
% Inputs:
% data1, data2: multiscale entropy values (samples x scale)
% scale: scale factor
%
% Outputs:
%... |
function fig = ClusterSpikeWfms(snipfiles,ctfiles,channels,snipindx,multiindx,f,t,proj,clustnums,polygons,hsort)
% Compute their projections on the filters
hfig = Cluster(proj(2,:),proj(1,:));
h1 = uicontrol('Parent',hfig, ...
'Units','points', ...
'Position',[412 337 76 30], ...
'String','AutoCorr',...
'Callback','Clu... |
function han = m_scatter(varargin)
%
% DG 2011-04-26: making a m_map compatible version of matlab's scatter function, adopted from m_plot.m
%
global MAP_PROJECTION MAP_VAR_LIST
if isempty(MAP_PROJECTION),
disp('No Map Projection initialized - call M_PROJ first!');
return;
end;
if nargin < 2;
help m_scatter
r... |
function LogiRegress()
global N Score1 Score2 Y;
%线性回归用来分类 %逻辑回归
N=1000;%样本容量
dimX=1;%X维度
domain =80;%x范围,定义域
noise= normrnd(0,20,N,1);
x=domain *rand(N,dimX)-domain /2;
X=[x,ones(N,1)];
Y=2*X(:,1)+10 +noise;
Y=1*(Y>0);%生成01
%%远端离散点加上之后 线性回归准确率下降?
for i=1:5
... |
%% fn_maskavg
%% Syntax
% a = fn_maskavg(a,mask)
%% Description
% region-wise averaging of a according to a 2-dimensional mask
%% Source
% Thomas Deneux
%
% Copyright 2007-2012
%
|
function Flag = iseven(X)
% iseven True for even numbers.
%
%
% Syntax
% =======
%
% Flag = iseven(X)
%
%
% Input arguments
% ================
%
% * `X` [ numeric ] - Number(s) that will be tested.
%
%
% Output arguments
% =================
%
% * `Flag` [ `true` | `false` ] - True for even numbers.
%
%
% Descripti... |
function [vals,varargout] = minmax(data,varargin)
%MINMAX find kth smallest or largest values and their indices.
%
% USAGE:
% vals = minmax(data) % find minimum
% vals = minmax(data,k) % find kth smallest values
% vals =... |
%% CFD Boston University Course -------------------------------------------
% Step 5 of 12 to Navier Stokes Code: Two Dimmensional Linear Convection
%
% Governing Equation:
% \frac{\partial{u}}{\partial{t}} + c\frac{\partial u}{\partial x} + c\frac{\partial u}{\partial y} = 0
%
% This code is the first simplest 2D CFD... |
%% compute intermodulation freq
syms w1 w2;
Vin = cos(w1)+cos(w2);
Vout = Vin + Vin^2 + Vin^3;
factor(Vout) |
function y=func12_2(x)
num=100*(1-0.1*x.^2).^2+x.^2;
den=(1-x.^2).^2+0.1*x.^2;
y=sqrt(num./den); |
function moles = phaseMoles(self, n)
% PHASEMOLES - moles of phase number 'n' (kmol).
%
if nargin == 2
moles = mixturemethods(28, mix_hndl(self), n);
elseif nargin == 1
np = nPhases(self);
for n = 1:np
m(n) = mixturemethods(28, mix_hndl(self), n);
end
moles = m;
else
error('wrong number of ... |
clear;clc
% NM=['John ';'James ';'Harry ';'Carter']
J1=[6 4 5 7 5 6 5];
J2=[4 5 3 2 4 3 5];
H=[5 3 2 6 2 2 3];
C=[4 3 2 3 2 3 2];
a=sum(J1);
b=sum(J2);
c=sum(H);
d=sum(C);
total_h=[a b c d]
wg=zeros(1,4);
for i=1:4
wg(i)=FN_00781035_Final_01(total_h(i))
end
fid=fopen('ML_00781035_Final_01_out.txt','w')
fprintf(fid... |
edinici = find(matrica == 1);
[redici, koloni] = size(matrica);
brEdin = max(size(edinici));
brNuli = (redici * koloni) - brEdin;
brHorizontalniPromeni = 0;
for i=1:redici
for j=2:koloni
if (matrica(i, j) ~= matrica(i, j - 1))
brHorizontalniPromeni = brHorizontalniPromeni + 1;
end
... |
function [haviotKok,haviotTransport, haviotSampling, lapaisyTransport, lapaisySampling] = particleLosses(Q,kuvat, dp,d,L,kallistumiskulma,Uo,inletinAsento, mutkienMaara)
%Tämä on vaihtoehtoinen funktio hiukkashäviöiden laskemiseen. Tässä täytyy
%itse määrittää kaikki parametrit mitä laskemiseen tarvitaant
%TÄtä funkt... |
clear all
[num,txt,raw] = xlsread('text.xls');
[row,col]=size(raw);
for r=1:row
raw{r,9}=str2double(raw{r,9});
raw{r,8}=str2double(raw{r,8});
raw{r,7}=str2double(raw{r,7});
raw{r,6}=str2double(raw{r,6});
raw{r,5}=str2double(raw{r,5});
raw{r,4}=str2double(raw{r,4});
raw{r,2}=strrep(raw{r,2}... |
function multi2=singletomulti(single,multi)
hsmm5=hsmm();
multi2=multimodel(hsmm5);
[ny nx]=size(multi.matrixmodel);
multi2.n=multi.n;
multi2.iall=multi.iall;
multi2.iemis=multi.iemis;
multi2.itrans=multi.itrans;
multi2.iin=multi.iin;
multi2.idur=multi.idur;
for ky=1:ny
for kx=1:nx
d=dur_m... |
clf;clear all;
srrc = srrc_pulse(5,10,0.3)
rc = conv(srrc,srrc)
subplot(2,2,1);plot(srrc);title('srrc sginal')
subplot(2,2,2);plot(fftshift(abs(fft(srrc))));title('srrc sginal f domain')
subplot(2,2,3);plot(rc);title('rc sginal')
subplot(2,2,4);plot(fftshift(abs(fft(rc))));title('rc sginal f domain')
function [y,t] ... |
function F = SchurParlett(f,A)
% function F = SchurParlett(f,A)
% Function of a matrix via Schur decomposition.
% A is nxn and its eigenvalues are treated as distinct.
% f is a handle to a function f (assumed to be accessible).
% F = f(A)
% GVL4: Algorithm 9.1.1
n = length(A);
[Q,T] = schur(A,'complex')... |
function image = features_to_image(features)
% image(:, :, 1) = double(features.environment | features.start_car.arrow | features.end_car.arrow);
% image(:, :, 1) = double(features.environment | features.start_car.triangle | features.end_car.triangle);
image(:, :, 1) = double(features.environment);
ima... |
function plot1()
addpath '/rota/Analysis/PS/osc2011/'
file='20120925_51130_52600.mat';
load(file);
il=2643.892;
fl=826345;
Freq=(il-iset)/il*fl;
find_figure('cw sp'); clf; hold on;
Ph=78;
A=(Abs+i*Disp) * exp(i*Ph/180*3.1415926);
plot(Freq, real(A), 'b-');
plot(Freq, imag(A), 'r-');
xlim([0,... |
function rvecx = rvec(x)
rvecx = real(x(:));
end
|
function [ out ] = MPS_NormDifference_left( A, B )
out = MPS_Overlap(A, A, 'left', 'left') - MPS_Overlap(A, B, 'left', 'left') - MPS_Overlap(B, A, 'left', 'left') ...
+ MPS_Overlap(B, B, 'left', 'left');
end
|
function z=CS7(x)
global ProblemSettings;
nVar=ProblemSettings.nVar;
f1=x(1)^3-3*x(1)*x(2)^2-1;
f2=3*x(1)^2*x(2)-x(2)^3+1;
z=f1^2+f2^2;
end
%%
% 0.1<xi<2 i=1,4
% .1<xi<10 i=2,3
|
%% 结构化程序式
for i=1:10
x=linspace(0,10,101);
plot(x,sin(x+i));
print(gcf,'-deps',strcat('plot',num2str(i),'.ps'));
end
%%
a=6;
if(rem(a,2)==0)
disp('a is even');
else
disp('a is old');
end
%%
num=-1;
switch num
case -1
disp(-1);
case 0
disp(0);
case ... |
function generatedata(sigma,num)
x=linspace(0,1,num);
y=sin(2*pi*x);
t=normrnd(0,sigma,1,num);
y=y+t;
trainingSet=[x;y];
save('trainingSet.txt','trainingSet','-ascii');
end
|
Dvalue=max(Spectrum)-min(Spectrum);
Dvalue=Dvalue/1000;
plot(smooth(diff(smooth(Spectrum,20)))) |
function atogram_printer(outputPath, generalProperty, imagingData, BehaveData)
[labels, examinedInds, eventsStr, labelsLUT] = getLabels4clusteringFromEventslist(BehaveData, ...
generalProperty.labels2cluster, generalProperty.includeOmissions);
classes = unique(labels);
allTrailsIndex = 1:s... |
addpath('../simulation');
%% models
m = 0.109;
l = 0.25;
I = 1/3*m*l^2;
g = 9.80;
A2 = [0 1 0 0;
0 0 0 0
0 0 0 1
0 0 m*g*l/(I + m*l^2) 0];
B2 = [0
1
0
m*l/(I+m*l^2)];
C2 = [1 0 0 0
0 0 1 0];
D2 = [0
0];
%% explain huge data of acc
Q = [100,0,100,0]; % TAKE 100.100 AS EXAMPLE
R = 1;
Klqr ... |
% run both standard and collapsed gibbs on the nips data set
K = 40; % number of topics
alpha = .1; % dirichlet prior over topics
beta = .01; % dirichlet prior over words
numiter = 200; % number of iterations
[I,D,K,W,di,wi,ci,citest,Id,Iw,Nd] = lda_read('pruned.data',K);
[zi,theta,ph... |
%headers
tic
addpath(genpath('../'));
mfn = mfilename;
%parameters for preprocessing of image and dist. func. calculation
p.Nimages = 255; %last image in seuence
p.yred = [];
p.xred = [];
%fire parameters
p = param_example(p);
%plotflag - for plotting in... |
function background = getBackgroundImage(cam)
background = snapshot(cam);
imshow(background);
end
|
%% Set-up
% Discretization parameters
nx = 81;
ny = 81;
dt = 0.025;
dx = 1/(nx-1);
dy = 1/(ny-1);
% Time interval
t_0 = 0;
tf = 0.25;
% Problem parameters
D = 0.05;
kindergarten = [0.5, 0.5];
W = 1;
theta = pi/2;
a1 = 2;
a2 = 1;
s1 = 100;
s2 = 150;
A = createA(D, W, theta, nx, ny, dx, dy, dt);
spy(A)
|
% Messwerte einlesen
load ChemischeIndustrie.mat;
% Grafische Darstellung der Messdaten als Streudiagramm
figure(1);
scatter3(values(:,1),values(:,2),values(:,3),'ob','filled'); |
function graphErrorsDoolittleCholeskyGivens(eD, eC,eG)
%CREATEFIGURE(Y1)
% Create figure
figure1 = figure;
% Create axes
axes1 = axes('Parent',figure1);
box(axes1,'on');
hold(axes1,'all');
plot([eD],'-sg','MarkerSize',2,'MarkerFaceColor','g'); hold on;
plot([eC],'-or','MarkerSize',2,'MarkerFaceColor','r'); hold on;
p... |
dat = csvread('mauna_loa.csv',1,0);
time = dat(:,1);
co2 = dat(:,2);
plot(time,co2,'b','LineWidth', 4);
set(gca,'FontSize',18);
xlabel('Time (years)','FontSize',18);
ylabel('CO_2 (ppm)','FontSize',18); |
% Version à un seul point. Main_loop devrait être utilisé à la place dans
% la plupart des cas.
% ANCIEN. LAISSÉ COMME RÉFÉRENCE.
%
clear
lambda = 500E-9;
%Nombre de rayon simulé par axe (toujours impair)
n = 501;
%Point à analyser sur l'image
x = 0;
y = 0;
%Distance de la surface S. 1: pupille, 0: plan image
z = 0.0... |
function soa = keypoints_to_structure_of_arrays (keypoints)
% soa = KEYPOINTS_TO_STRUCTURE_OF_ARRAYS (keypoints)
%
% Converts input keypoint array-of-structures (as returned by OpenCV
% keypoint detectors into a structure-of-arrays).
%
% Input:
% - keypoints: array of OpenCV keypoint struc... |
function OK = rangechk(rangeval)
% check a range vector argument
% last modified 19 November 2002
OK = 1;
if size(rangeval,1) ~= 1 & size(rangeval,2) ~= 1
OK = 0;
end
if length(rangeval) ~= 2
OK = 0;
end
if rangeval(1) >= rangeval(2)
OK = 0;
end
|
%%%%%%%%%%%%%%%%%%%%%%%%
% comparison of LEM and LLE, with and without boundary weight
%%%%%%%%%%%%%%%%%%%%%%%%
% colormap info
cmin = 1; cmax = 1.5; clo = [.3,.3,1]; chi = [0,1,0];
load('myjet.mat');
render_aa = 0;
% [RMS] this mesh shows LLE failure
mesh = readMesh('dogface.obj');
P = mesh.v; ... |
%%Find all possibilities of 2 pounds using french coins
clear all
%%2 coin combinations
for ii = 2:1:200
strii = num2str(ii);
eval(['p',strii,'2=length(',strii,':-2:1)+(1-mod(',strii,',2));'])
%pause
end
%%5 coin combinations
for ii = 5:5:200
strii = num2str(ii);
eval(['p',strii,'5=1;'])
for jj = 5:5:ii
... |
function tf = deleteIfExists(obj)
% DELETEIFEXISTS Deletes a queue if it exists
% A logical true is returned if the queue existed in the storage service and
% has been deleted, otherwise false.
% Copyright 2019 The MathWorks, Inc.
tf = obj.Handle.deleteIfExists();
end
|
Bij het samenvoegen van meerdere character vectoren
m.b.v. rechte haken wordt er automatisch een spatie
geplaatst tussen de afzonderlijke character vectoren.
Bijvoorbeeld: ['Bio' 'statica'] |
x = 1.0;
v = 0.0;
dt = 0.01;
t=0;
xVec=[];
vVec=[];
tVec=[];
n=1000;
a = przyspieszenie(x);
for i=1:n
xVec=[xVec;x];
vVec=[vVec;v];
tVec=[tVec;t];
vMid=v+0.5*a*dt;
x=x+vMid*dt;
a = przyspieszenie(x);
v=vMid+0.5*a*dt;
t=t+dt;
end
%%
figure
plot(tVec, vVec); grid on |
function value = calc_patchValue( patch )
[M,N] = size(patch);
tophalf = patch(1:M/2,:);
bottomhalf = patch(M/2 : M, :);
lefthalf = patch(:, 1:N/2);
righthalf = patch(:, N/2 : N);
value = ( abs( sum(sum(tophalf)) - sum(sum(bottomhalf)) ) ...
+ abs( sum(sum(lefthalf)) - sum(sum(righthalf)) ) ...... |
% Syntax
% [Param, err] = PS_GetRectParam(StimN, ChN)
% Description
% Gets parameters of the rectangular pulse for a channel ChN.
% StimN - stimulator number to query (starts from 1)
% ChN - channel number to query (starts from 1)
% Returns:
% Param – array 1x5 containing parameters of ... |
function obj = addDynamicsConstraint(obj)
% Add system dynamics equations as a set of equality constraints
%
% basic information of NLP decision variables
nNode = obj.NumNode;
vars = obj.OptVarTable;
ceq_err_bound = obj.Options.EqualityConstraintBoundary;
node_list = 1:1:nNode;
... |
function plotSlice_2_6_3( t_slice, dt, u, x_ )
t_slice_id = round(t_slice / dt) + 1;
u_slice_num = u(t_slice_id, :);
u_slice_num = u_slice_num(:);
figure; hold on;
title(sprintf('t = %.2f', t_slice));
plot(x_, u_slice_num, 'r-');
legend('numerical');
xlabel('x'); ylabel('u');
end |
function [ output_args ] = multiAnova( mz,sp,meta,names )
%multiAnova - can we identify variables which fail to be useful?
numV = size(sp,2);
numG = size(meta,2);
pval = zeros(numV,numG);
for n = 1:numV
[p,t,s] = anovan(sp(:,n),meta,...
'Display','off',...
'VarNames',names);
pval(n,:... |
function [ILD_matrix,ABI_matrix,ITD_matrix,HRTFinfo] = get_HRTFinfo(bird_number,hrtf_file,hrtf_file2,get_HRTF,get_ITDmatrix)
%Get information from bird's HRTF catalogue - for use in predicting ILD Alone Surfaces
%Header information
[HRTFinfo.filetype,...
HRTFinfo.headerinfo_blocks,...
HRTFinfo.n_channels,HRTFinf... |
length = 100;
duration = 1000;
v = zeros(length,duration);
w = zeros(length,duration);
for x=1:length;
v(x,1) = -1.0367;
w(x,1) = -0.6656;
end
beta = 0.7;
gamma = 0.5;
epsilon = 0.44;
wh = 0.4;
wl = 0.62;
D = 0.0003;
dx = 1;
dt = 1;
for t=1:duration-1;
for x=3:length-3;
v(x,t+dt) = dt*... |
close all
clear
clc
format shortEng
format compact
pth=pwd;
compfolder='\Composite Analysis\';
FEfolder='\Finite Element Analysis\';
%% Composite Analysis
LayerOrientation=[45 -45 0 0 -45 45];
NumberOfLayers=length(LayerOrientation);
OptimizationInputScript; % This script is where most of the input v... |
% function ROI2TBV(structMRI,functMRI,ROI,options)
%
% This function takes an ROI as drawn in MRIcron (based on a structural
% MRI) and coregisters and transforms this ROI to the space and resolution
% of the EPI (functMRI).
%
% Tobias Hauser & Benjamin Chew, 05/2017
function ROI2TBV(structMRI,functMRI,ROI,optio... |
classdef NetworkMonitor < handle
% A NetworkMonitor can be used to monitor properties as well as the
% activity of a number of neuronal groups in a network.
%
% NM = NetworkMonitor(simFile,loadGroupsFromFile,errorMode) creates a
% new instance of class NetworkMonitor.
% A NetworkMonitor will ass... |
function res=RSQ(x, xt)
xt(xt==0)=1e-6;
res=corr2(x,xt)*corr2(x,xt);
end |
t = -2:0.0002:2
cos1 = cos(2*pi*t) % freq =1
cos2 = cos(6*pi*t) % freq =3
% orginal waves
subplot(3,2,1), plot(t,cos1)
title('cos1')
subplot(3,2,2), plot(t,cos2)
title('cos2')
% samples waves
%t_sampled = -2:1/2:2 % will show alaising
t_sampled = -2:1/10:2 % will remove alaising
cos1_sampled = cos(2*pi*t_sam... |
close all;
clear all;
clc;
storPath = '/Volumes/Macintosh_HD_2/Word Spotting Dataset/Dataset_CESR/Grouped_Images_2';
orininalImgPath_1 = '/Volumes/Macintosh_HD_2/Word Spotting Dataset/M0275_01/';
orininalImgPath_2 = '/Volumes/Macintosh_HD_2/Word Spotting Dataset/M0275_02/';
fid = fopen('forGTCSERVer_1.txt','rt');
if ... |
function [spikeData eventData nevHeader] = nevExtractSpikesEvents(fname, varargin)
% [spikeData eventData nevHeader] = nevExtractSpikesEvents(fname)
% This function loads a NEV file into matlab using only
% script commands. It does not use the neuroshare library.
% Also loads waveforms into spikeData using nevExtra... |
%1,6882,1,177.69403,134.57555,109.85075,313.00199,-6.90447,-0.65662
%1,6882,2,314.29104,129.80417,99.34328,294.87077,-6.54525,-1.46042
%1,6883,1,177.69403,134.57555,109.85075,313.00199,-6.90447,-0.65662
%1,6883,2,304.73881,122.16998,88.83582,280.55666,-6.18769,-1.43629
%1,6884,1,177.69403,134.57555,103.16418,305.36779,... |
clear all
makePlatform
x = 10
y = 5
l = 50
w = 80
a = polyshape([x+l/2,x+l/2,x-l/2,x-l/2],[y+w/2,y-w/2,y-w/2,y+w/2]);
plot(a,'FaceColor','magenta');
bc = 3
number = 3;
dis = 5;
dx=l-2*bc;
dy=w-2*bc;
lines = 4
numofpoint = lines*2; |
function value = pvget(W,property)
switch lower(property)
case {'setprops','getprops'}
value = {...
'FinalCostMatrix',...
'InitialInput',...
'InputL2Norm',...
'MaxIter',...
'Objective',...
'ODEOptions',...
'ODESolver',...
... |
T = 5;
t = 0:0.01:50;
k = 0:1:50;
n = k*T;
xt = cos(2*pi*t/12);
xn = cos(2*pi*n/12);
subplot(2,2,1); plot(t,xt);
subplot(2,2,2); plot(n,xn);
xn2 = cos(8*pi*n/31);
xt2 = cos(8*pi*t/31);
subplot(2,2,3); plot(t,xt2);
subplot(2,2,4); plot(n,xn2); |
function [newPoly,keepIndex] = robustSubs(poly,old,new)
%Private utility function for the POLYSYS class.
%
%ROBUSTSUBS Symbolic substitution for POLYNOMIAL objects.
%
% NEWP = robustSubs(P,OLDVARS,NEWVALUE) finds which (if any) elements of
% OLDVARS are being used by P and then substitutes values from NEWVALUE.
%... |
function lp=logNormPDF(x,mu,sigma)
lp=-1/2*log(2*pi*sigma^2)-(x-mu)^2/(2*sigma^2);
end |
classdef ConfigProcess
%UNTITLED3 Summary of this class goes here
% Detailed explanation goes here
properties
id string
activityName string
quantity double
loc string % default location
locList % available locations
correction double ... |
function [Gamma, Psi, th_base, th_c, alpha, beta, gamma, ...
Phi, d_Phi, dd_Phi] = PartialSolZeroDyn(theta_p, alpha_p, num_points)
% Produces the partial closed-form solution for the square of the velocity
% of the phase variable theta in terms of the two coefficient functions,
% Gamma and Psi, where
% theta_dot^2 ... |
function [np, mean_dia] = calc_threshold(I1, threshold_range, md)
n = length(threshold_range);
np = zeros(n); % array of number of detected particles
mean_dia = zeros(n); % array of mean particle diameter
for i = 1:n
threshold = threshold_range(i);
[stats] = process_image(I1,threshold,md);
... |
function los_dens_out = redu2full(params,d,P,O,invgas,los_dens,air,lis)
% los_dens_out = redu2full(params,d,P,O,invgas,los_dens,air,lis)
% initialize
los_dens_out = los_dens;
% change retrieved gases
for n = 1:length(invgas)
reduparams = params(sum(d(1:(n-1)))+1:sum(d(1:n)));
% Reduced profile ... |
function featuresNorm = NormalizeFeatures(features)
% Normalize image features to have zero mean and unit variance. This
% normalization can cause k-means clustering to perform better.
%
% INPUTS
% features - An array of features for an image. features(i, j, :) is the
% feature vector for the pixel img(i, j,... |
classdef Speed < Meta
%SPEED Class that represents Speed properties.
% A speed is a mechanism setting.
% By default no Speed Operations are executed.
%% Default Properties
properties (Access = public)
level = [0,0]; % No level
area = [ 0,0 ;... |
function reliability = spearmanBrown_reliability(subject, cueType)
reliability.dprime_NeutralTrials_odd =[]; reliability.dprime_NeutralTrials_even=[];
reliability.dprime_ValidTrials_odd =[]; reliability.dprime_ValidTrials_even=[];
if cueType==2
reliability.cueBen_odd=[]; reliability.cueBen_even=[];
reliability.... |
classdef TwoDimensionCircle < ether.aim.TwoDimensionGeometricShape
%TWODIMENSIONCIRCLE Summary of this class goes here
% Detailed explanation goes here
properties
end
methods
function this = TwoDimensionCircle(j2dShape)
this = this@ether.aim.TwoDimensionGeometricShape(j2dShape);
end
end
end
|
function nex(ListFile,NEX,NumScans,dim, type,opuser2)
% function nex(ListFile,NEX, NumScans,dim, type, opuser2)
%
% This function reads the filenames from a file and averages the
% contents of the files together.
%
% ListFile - name of the file containing the listing of the
% files to be averaged. This file was ma... |
function[LMP] = findLMP(d,u,r,LMPthresh,LMPdist)
%FINDLMP - find local maximum points of d on boundary
if nargin<5
LMPdist = 0;
end
s = size(d);
dB = getdB(u,r,s);
%LMPind = [];
dB1 = [dB.side; dB.edge];
dB2 = dB.corner;
dB = dB1;
dV = d(dB(:,1));
dW = d(dB(:,2:end));
ind= dV>=max(dW,[],2) &... |
function facedata = getFaceDataFromSQLite(dbfile,face_id)
facedata = struct();
facedata.pts = struct();
facedata.pose = struct();
facedata.image = struct();
mksqlite('open',dbfile);
fidQuery = ['SELECT file_id FROM Faces WHERE face_id = ' num2str(face_id)];
file_id = mksqlite(fidQuery... |
% [ic_sep]=Separate_networks(ic);
function [ic_sep]=Separate_networks(ic);
side_a=[1 2 3 7 8 9 10 15 16 17 18 23 24 25 26 31 32 33 34 39 40 41 42 47 48 49 50 55 56 57];
side_b=[4 5 6 11 12 13 14 19 20 21 22 27 28 29 30 35 36 37 38 43 44 45 46 51 52 53 54 58 59 60];
place=[];
for i=1:size(ic,2)
if size(find(side_a... |
function [gbnds,sout,sossol,info]=pcontain(p1,p2,z,opts)
% function [gbnds,s,sossol]=pcontain(p1,p2,z,opts)
%
% DESCRIPTION
% This function maximizes g subject to the set containment constraint:
% { x : p2(x)<= g } is a subset of { x : p1(x)<= 0 }
% The set containment constraint is relaxed using a gener... |
load 'cam.mat'
f = 500;
d = 1000;
img = double(rgb2gray(imread('pillars.jpg')));
MAT = [tx' ty' tz' rx' ry' rz'];
AA = unique(MAT,'rows');
ww = zeros([size(AA,1),1]);
for i = 1: size(AA,1)
k = 0;
for q = 1:size(MAT,1)
if(AA(i,:) == MAT(q,:))
k = k + 1;
end
... |
% Set Public Global Params
% DO NOT MODIFY THESE VALUES UNLESS ANNOUNCED IN GROUPS!!!
% NYX modified 12/01/2017 17:08;
global Params;
% Define traffic dynamics
Params.nominal_speed = 25;
Params.min_speed = 20;
Params.max_speed = 30;
Params.num_env_cars = 25;
% Define action consts
Params.accel_mild = 2.5;
Params.d... |
function refocusApp(rgb_stack, depth_map)
% Initialization
[y_max, x_max] = size(depth_map);
cur_img_idx = 1;
imshow(rgb_stack(:, :, 1 : 3));
while (true)
% Get user input position
[x, y] = ginput(1);
x = round(x);
y = round(y);
% If outside the boundary, break;
if (x < 1 || x > x_max || ... |
l1=100000
po=l1/2;
pn=1;
n=round(log(po/pn));
numeroopt=round(2*n*nthroot((po/pn),n)+1)^2
numerosin=(l1/pn+1)^2 |
function y = f(x)
y = log(1 + x) / 1000;
|
function PreX = Pre(Omega,Ups,sys)
% Get sizes
nx = size(sys.A,2);
nu = size(sys.B,2);
nw = size(sys.E,2);
% Step 1: Calculate the projection of \Upsilon onto (x,u)
Y = [];
for i = 1:length(Ups)
Y = [Y, projection(Ups(i),[1:nx+nu])];
end
% Step 2: Calculate the inverse map
Phi = [];
for i = 1:length(Ups)
for... |
function [out, transformInfo] = plotStackedTraces(tvec, data_txcxl, varargin)
% data is time x channels x layers
p = inputParser();
p.addParameter('style', 'traces', @(x) ischar(x) || isstring(x));
p.addParameter('transformInfo', [], @(x) isempty(x) || isstruct(x));
p.addParameter('colors', [], @(x) true); % over ch... |
function [up,vp,wp,H] = agw(x,y,u,v,w,xp,yp,H)
% function [up,vp,wp,H] = agw(x,y,u,v,w,xp,yp,[H])
szu = size(u);
szx = size(x);
if (any(size(x) ~= size(y))),
error('x and y matrices must be the same size.');
end;
if (any(size(u) ~= size(v))),
error('u and v matrices must be the same size.');
end;
if (any(szu(... |
function [im, ii_im] = LoadIm(im_fname)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
im = imread(im_fname);
im = im2double(im);
im_vec = im(:);
mu = mean(im_vec);
sigma = std(im_vec);
if sigma == 0
im = (im-mu);
else
im = (im-mu)./sigma;
end
ii_im = cumsum(cumsum(im,2),1)... |
function new_centroids = reassign_centroids( M, data )
% takes an d by n matrix M of points belonging to centroids
% and an N by d matrix of data points and
% returns a d by n matrix of new centroids
% based on the mean of the points
d = size(data,2);
N = size(M,1);
n = size(M,2);
new_centroids = zeros(d,n);
for i =... |
graphics_toolkit gnuplot;
clc;
clear;
tau = 60.0;
T = 60.0;
k = 1.0 / 6.0;
alpha = 0.2;
beta = 0.1;
gamma = 0.06;
mu = 0.03;
n_1 = 9.0;
n_2 = 1.0;
N = 501;
N_full = 750;
M_1_min = 0.0;
M_1_max = 1.002;
M_2_min = 0.0;
M_2_max = 1.002;
M_1_left = 0.0;
M_1_right = 1.0;
M_2_left = 0.0;
M_2_right = 1.0;
hat_M_a... |
function horizontalSeam = Min_horizontal_seam(cumulativeEnergyMap)
horizontalSeam = Min_vertical_seam(cumulativeEnergyMap');
horizontalSeam = horizontalSeam'; |
function subplottight(n,m,i)
[c,r] = ind2sub([m n], i);
subplot('Position', [(c-1)/m, 1-(r)/n, 1/m*0.9, 1/n*0.9]) |
function calculateSlope(calInfo, calInfoFile)
output = calInfo.output;
slope = calInfo.slope;
pressurePoint = [0, 8, 16, 24, 32];
for i =1:32
for j=1:32
temp_s = slope{i,j};
temp_o = output{i,j};
for k = 1 : length(temp_o)-1
... |
% Copyright 2014
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writin... |
function watchFreqReceiveNewData(packetPort, packet, h)
%watchFreqReceiveNewData(packetPort, packet, h)
%
%This function is called by the packetPort event handler.
%It is passed the handle of the WATCH figure to plot to, and is given the received packet
%
%The data is extracted from the packet and added to the figure.
... |
function scans_to_process = lzDTI_coregisterWarpedT1sUsingLongitudinalRegistration( scans_to_process )
%lzDTI_coregisterWarpedT1sUsingLongitudinalRegistration- coreg warped T1s
% Creates an array of objects of the class lzDTI_participant
%
% Syntax: participants_to_process =lzDTI_coregisterWarpedT1sUsingLongitudinalRe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.