text stringlengths 8 6.12M |
|---|
function [match] = lbpmatch(I1,I2)
% LBP Calculation
%
% Input:
% - I1,I2: Binary image
%
% Output:
% - match: Binary value, 1 if 2 image matches 0 otherwise
%
% Author:
% - Alessandro Fornasier (alessandrofo@edu.aau.at)
if size(I1) == size(I2)
[r,c] = size(I1);
match ... |
function in_ms = index2ms(in_index,samplingrate)
in_ms = in_index/(samplingrate/1000);
end |
%A基本关联矩阵 D为管段长度 Re雷诺数 u粘合数 p密度 S阻力系数 e精度
function [G_New,P] = hydraulicCalculation(A,D,Re,u,p,S,e)
%A的行数为管段数 列数为节点数
[m,n]=size(A);
%拟定初始管段流量G
G=Re*(u*pi*D)/(4*p);
k=0;
while(1)
k=k+1;
%计算Q节点流量
Q=A*G;
%计算P节点压力 和管段流量绝对值对角矩阵
G_Abs=diag(abs(G));
r=S*G_Abs;
P=inv(A*(inv(r))*(A'))*Q;
%计算管段压降P_Drop
P_Drop=(A')*P;
%计算新流量G
... |
function [EVs, EC] = EvalObjGA( D,S,S_,Px,Pm,Pl,Cd )
%{
Evaluate solutions
INPUT:
D: decision rules to be evaluated - Nsol x Nx matrix
S: survival nodes identified by RDA = Ncut x 1 cell
S_: failed nodes identified by RDA - Ncut x 1 cell
Px: probability matrix for comp's (failure only)
Pm: probabili... |
classdef MDL_obj
% LINE_OBJ_SEFF defines the LINE object that processes the models, calling
% the necessary scripts to parse the XML description, solve the performance
% model, and export the resuls to an XML file
%
% Properties:
% myCluster: cluster to solve models in parallel
% myJobs: list of jobs submitte... |
clear;close all;clc;
img = imread('Project4_Defect.jpg');
imc = imcrop (img,[16,18,size(img,2)-35,size(img,1)-35]);
gray = rgb2gray(imc);
thresh = mean(img(:));
thresh_img = (gray>thresh);
filter1= fspecial('average',10);
filtered = imfilter(thresh_img,filter1);
sobeled = edge(filtered,'sobel');
se... |
% plot dataset size vs humanbehavioral grades
% for generated images
%% parameters:
n_case = 8; % num of GAN curves
%% (1) biggan FLOWER:
x1 = [1000, 2000, 4000, 6000, 8189]; % dataset size
xtick1 = 1000:1000:9000;
y1 = [3.44778, 2.35556, 2.44778, 2.27264, 2.58111]; % average rating
yconf1 = [3.58004,2.45782,2.5374... |
function plotseries(X, segments, colour, missing)
if (~exist('missing', 'var'))
missing = [];
end
nmissing = setdiff(1:size(X,1), missing);
hold on;
q = size(X,2);
mask = segments-1;
mask(find(mask == 0)) = [];
if (q == 2)
dX = X(2:end,:) - X(1:end-1,:);
dX(mask,:) = zeros(length(mask),q);
dX = [dX; [... |
clear
clc
n = 100;
A = rand(n) + n*eye(n);
b = ones(n,1);
b = b/norm(b);
m = 20;
V = zeros(n,m+1);
V(:,1) = b;
H = zeros(m+1,m);
for j = 1:m
% Pick a vector from V
vj = V(:,j);
% Apply A
u = A*vj;
% Gram-Schmidt => Make sure every previous vector is orthogonal with
% the current vector ... |
function h = filled_ellipse(ra,rb,varargin)
% wrapper for ELLIPSE.M, written by KJ Schlesinger, June 2017
patchColor = varargAssign('ellipseColor',[1 1 1],varargin{:});
patchAlpha = varargAssign('ellipseAlpha',1,varargin{:});
h = ellipse(ra,rb,varargin{:});
x = get(h,'Xdata');
y = get(h,'Ydata');
hold on;
patch(x,y,p... |
clear all;
% close all;
warning('off','MATLAB:scatteredInterpolant:DupPtsAvValuesWarnId');
addpath('kml_lib');
addpath('emag_lib');
addpath('plotGen');
dtime=datetime(2013,11,23,0,0,0,'TimeZone','UTC');
etnaSetupAll; %Initialize sim, vents and DEM
%Plume
% Based on
plumeLoc = copy(sec); ... |
% function that takes a translation vector from frame A to B and gives back a
% spatial vector transformation from the corresponding 6-D space A to B
% that is a direct result of the translation represented by r
% this is for force type vector's transformation
function res = xltFMat(r)
res = [ eye(3) -vecX3D(r... |
function [result] = resolve_multiple_param_string(values)
if ischar(values)
values = strsplit(values,' ');
end
if (ischar(values) || isnumeric(values)) && length(values) == 1
result = num2str(values);
elseif iscell(values) && length(values) == 1
result = num2str(values{1});
elseif ~iscell(values) && length... |
function [W, H, cost] = nmf(V, num_basis_elems, config)
% nmf Decompose a non-negative matrix V into WH using NMF [1] by minimizing
% a chosen divergence. W is a basis matrix and H is the encoding matrix that
% encodes the input V in terms of the basis W. This function can output
% multiple basis/encoding matrices for ... |
load('/home/beviszhang/Documents/WorkSpace/IEEE/competition_data/DATA_10_TYPE02.mat');
load('/home/beviszhang/Documents/WorkSpace/IEEE/competition_data/DATA_10_TYPE02_BPMtrace.mat');
num = 1;
frame = getFrame(sig,num);
ppg1 = frame(3,:);
%%%%%%%%%%%%%%%%%%%%%%
level = 7;
method = 'db1';
%%%%%%%%%%%%%%%%%%%%%%
fsuspect... |
% Purpose of this function is to organaze data about net.
% Main assumption - there is only one arc between any two nodes.
% Input:
% G_matrix: matrix of connectivity
% Output: number of each arc in the shortest path in right order, time sum
function [net_full_information] = net_data_input(G_matrix)
[mas... |
function [Flag] = Get_Velocity(Orientation,Out_File_Name,Out_Put)
[Num,a] = size(Orientation);
Orientation_Velocity = zeros(Num,3);
f=fullfile(Out_Put,Out_File_Name);
fid_Velocity = fopen(f,'wt');
for i = 2:1:Num
Orientation_Velocity(i,:) = Orientation(i,:)-Orientation((i-1),:);
fprintf(fid_Vel... |
% plot results of calculations from crustalfluidmodel.R
strsplit = @(str,delim) regexp(str,regexptranslate('escape',delim),'split')
% one-line replacement function for strsplit: https://stackoverflow.com/a/35325913
%% Load Model OUtput
fid = fopen('logaeq2e.csv'); % even numbered
hdr = textscan(fid,'%... |
function Save(obj)
%
% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences
% mail4ywu@gmail.com/mail4ywu@icloud.com
if obj.readonly
errordlg(['DataViewer running on read only mode.'],'Error!','modal');
return;
end
handles = obj.uihandles;
if isempty(handles)
... |
function [Tn,Wn] = mTrapecio(f,y0,I,h)
%mTrapecio Método de Trapecio 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_Trape... |
function Validation_level( obj, id1, id2 )
MeasureLevel =[ fileparts( mfilename('fullpath') ), '/tide/MeasureLevel.txt'];
% MeasureLevel ='I:\MeasureLevel.txt';
Mlevel = load(MeasureLevel);
time = ncread('Sanya2k_0613.1-1.nc', 'time');
Clevel = obj.PostProcess_level;
x1 = Mlevel(:,1);
y1 = Mlevel(:,id1+1);
x2 = time(... |
function [result, computationCost] = ifft(signal)
[result, computationCost] = common.fftInner(signal, 0, true);
end |
function ShowProcrustes()
% function ShowProcrustes()
% minimize || A - BQ ||_F where A and B are the same size and Q is
% orthogonal.
clc
fprintf('The Orthogonal Procrustes Problem\n\n')
m = 7;
n = 4;
A = randn(m,n);
[Q0,R] = qr(randn(n,n));
B = A*Q0 + .01*(-1+2*rand(m,n));
Q = Procrustes(A,B);
fprintf('... |
clear all; rehash;
front_addr_ = 'tcp://125.64.36.26:52213';
broker_id_ = '2001';
investor_id_ = '8880000052';
investor_password_ = '123456';
ret = mdlogin(front_addr_, broker_id_, investor_id_, investor_password_);
if ret
% a[0] = Asset("180ETF¹º6ÔÂ2905A", "11000613");
% a[1] = Asset("180ETF¹º6ÔÂ2954A", "11... |
function P = dfs_visit(A, E, u, v, color)
function w = caclPathFlowWidth(path, E, theta)
% 计算通路的最小流量宽度
% theta -- 误差(可根据实际情况设定,例如0.1)
q = [];
for e = path
q = [q E(e,3)]; % 提取分支的流量
end
% q = q(find(q>theta));
w = min(q); % 求最小的流量
end
func... |
clear; clc; close all; config_re_tx;
%% * Load batch data
indexSet = 1 : nBatches;
reAoSet = cell(nBatches, length(Variable.nTxs));
reLcSet = cell(nBatches, length(Variable.nTxs));
for iBatch = 1 : nBatches
try
load(sprintf('../data/re_tx/re_tx_%d.mat', iBatch), 'reAoInstance', 'reLcInstance');
reA... |
function [month_indices month_indices_in_days number_of_months] = get_month_indices(DATA,day_indices)
if ~exist('day_indices','var')
day_indices =get_day_indices(DATA);
end
month_indices = cell(1,1);
month_indices_in_days = cell(1,1);
Z = size(DATA,1);
D = length(day_indices);
M = zeros(D,1);
for d=1:D
ti... |
function [errorCode,errorMsg,packet] = queryAccount(self)
%QUERYACCOUNT 在CounterHSO32中重新包装函数QueryAccount
% --------------------------
% 程刚,20160201
connection = self.connection;
token = self.token;
accountCode = self.accountCode;
combiNo = self.combiNo;
[errorCode,errorMsg,packet] = QueryAccount(connectio... |
function dmin = mindist(G)
% function dmin = mindist(G)
% G is an NxK matrix
%
% Compute the minimum distance of a binary code
% by exhaustive checking. (Therefore, only good for codes up to
% moderate sizes
% Copyright 2004 by Todd K. Moon
% Permission is granted to use this program/data
% for educational/research ... |
%Lotanna Ezenwa, Problem Set 4, #2
%PS4_2.m
%% Due Wednesday, April 20th, 2016
clear
me = LotaEzenwa();
code = me.id;
clf
PS_4_2
|
% curb parking
% three kinds of spaces:
% white - available
% gray - parking
% black - obstile
clear all
clc
format longg
rng(123); % creating a single seed for repetetivity
% Define street
L_street = 150; % [meters]
L_street_binning = L_street*100; % [cm]
global White_space Gray_space Black_space
Wh... |
%Example 3.26
%
clf;
figure(gcf)
setfsize(300,300);
echo on
clc
% SOLVEHOP - 设计Hopfield网络
% SIMUHOP - 对Hopfield网络进行仿真
pause % Strike any key to define the problem...
clc
T = [+1 +1;
-1 +1;
-1 -1];
plot3(T(1,:),T(2,:),T(3,:),'r*')
axis([-1 1 -1 1 -1 1])
xlabel('a(1)')
ylabel('a(2)')
zlabel('a(3)')
tit... |
% 论文代码主程序1
clear
clc
fd = 10;
fc = 1000;
fs = 10000;
data = bingen(1000);
C = mseq(5);
% data1 = ds_mod(C,data);
% [t,Y] = BPSKmod(data1,fd*length(C),fc,fs);
% Z = BPSKdemod(Y,fs,fc,fd*length(C));
% Z1 = ds_demod(C,Z);
data1 = ds_mod(C,data);
[t1,y1] = BPSKmod(data1,fd,0,fs);
[t2,y2] = BPSKmod(data1,f... |
%ass 2.2 1
%position pid for the hub position (collocated control)
%we_are_in_a_simulation = 0; %0 = WE ARE NOT IN A SIMULATION
%stop_time = 10;
if exist('we_are_in_a_simulation','var') == 1
else
disp("can't find we_are_in_a_simulation... assuming we_are_in_a_simulation = 1")
we_are_in_a_simulation = 1;
end
... |
qwe=10:10:250;
res=[];
for iqwe=1:numel(qwe)
param.K=qwe(iqwe);
s = RandStream('swb2712','Seed',1);RandStream.setGlobalStream(s);
[rDs rYs]=nnsc(rXs(:,drtrn),param);
res(iqwe)=norm(rDs*rYs-rXs(:,drtrn),'fro');
end |
function [ output_args ] = neurIO_nev( input_args )
%NEURIO_NEV Summary of this function goes here
% Detailed explanation goes here
end
|
function FN = get_FN(N)
F = [1,0;1,1];
FN = zeros(N,N);
FN(1:2,1:2) = F;
for i = 2:log2(N)
FN(1:2^i,1:2^i) = kron(FN(1:2^(i-1),1:2^(i-1)),F);
end
end |
function statsClusterMenu(~,~,fig)
%statsClusterMenu - draw the menu for cluster analyses
disp('Not available');
return
% Get the guidata
sts = guidata(fig.fig);
if isempty(sts)
return
end
% Draw the window to help control the colours / groups / etc
[window] = manipulateWindow(fig,sts);
% Set the callback for t... |
function [ bets ] = choose_bet( )
%CHOOSE_BET Make a random selection of numbers to bet on
% This is an approximation of real moves - we don't verify for instance
% that a choice of three numbers are in sequence.
choices = [1, 2, 3, 4, 6, 12, 18];
available = linspace(0, 36, 37);
choice_idx = round... |
function y = dReLU(x)
% derivative of the ReLU function
y = 1./(1 + exp(-x));
end |
Config();
% 2D geometry descriptor
geom{1} = EntCirc([0,0], .1);
geom{2} = EntCirc([0,0], .2);
figure;
for i= 1:length(geom)
plot(geom{i}.points(:,1), geom{i}.points(:,2),'k.-')
hold on;
end
axis equal; axis tight; |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FRE 6251 Numerical and Simulation Techniques in Finance
% Assignment #5
% Name: Surya L Gurung ID: 0449604
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Y, error1] = ImportanceSampling(So... |
function [x,fval,exitflag,output] = RHC_NN(x0)
%% This is an auto generated MATLAB file from Optimization Tool.
%% Start with the default options
options = psoptimset;
%% Modify options setting
options = psoptimset(options,'Display', 'off','timelimit',400);
options = psoptimset(options,'PlotFcns', { @psplotbestf });
[... |
% Image Compression using DCT for 10% quality and 90% quality
clc;
clear all;
close all;
a=imread('cameraman.tif');
%a1=im2bw(a);
a2=double(a);
[r,c]=size(a2);
% subplot(2,1,1);
% imshow(a);
% subplot(2,1,2);
% imshow(a2);
%shifting level from (0 to 255) to (-127 to 127)
a3=0;
for i=1:r
for j=1... |
somcount=100
digitsize = 8
digitdimension = digitsize * digitsize
for s=0:(somcount-1)
filename = sprintf("9_%d.som",s)
mapdim = dlmread(filename, ' ', [0,0,0,1]);
Mosaic=[]
alldata = dlmread(filename,' ', 1,0);
border = (max(max(alldata)))
for i=1:mapdim(1)
MosaicRow=[]
for j=1:mapdi... |
function [x1,x2] = quadrat(coeffs)
%
% Solves the quadratic formula for function with coefficients specified
% in coeffs
%
x1 = (-coeffs(2) + sqrt(coeffs(2)^2 - 4*coeffs(1)*coeffs(3)))/(2*coeffs(1));
x2 = (-coeffs(2) - sqrt(coeffs(2)^2 - 4*coeffs(1)*coeffs(3)))/(2*coeffs(1));
end |
function icl = segmentICLCirc(bscan, params, rpe, medline)
% SEGMENtICLCIRC Segments some inner retinal layers from a BScan.
% Intended for use on
% circular OCT B-Scans.
% BSCAN: Unnormed BScan image
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PARAMS: Parameter struct for the autom... |
function dpnManipulateCallback(~,~,fig,mode,man)
%dpnManipulateCallback - change the ion image in the axes depending on the
%options specified in the mini window...
% Get the main figure's guidata
dpn = guidata(fig.fig);
if isempty(dpn)
return
end
% Determine ion mode
switch mode
case 'pos'
dx = dpn.d... |
function [finalA, finalE] = robustpca(tagmatrix, lambda1, lambda2, tagCorrelation, contentCorrelation, maxIters, stopPrecision, mu)
% initialization, see Algorithm 2 [zhu2010]
[m,n] = size(tagmatrix);
X_km1_A = zeros(m,n);
X_km1_E = zeros(m,n);
X_k_A = zeros(m,n);
X_k_E = zeros(m,n);
b_k = 1;
b_km1 = 1;
... |
function varargout = clusterRDM_imana(what, varargin);
%%
% Access to:
% - glm directory
% - surface caret directory
% - pre-calculated distance result
% - region of interest directory
% -
% Does:
% - clustering using RDM (or second-moment matrix)
% - some visualization
%
%
% ayokoi (Jul 2018)
%% Da... |
function [x, y] = BackwardEular(init, left, right, h)
MAX = 100;
eps = 10e-8;
x = left:h:right;
y = zeros(size(x));
y(1) = init;
for i=1:length(x)-1
tmp = y(i) + h*(y(i) - 2*x(i)/y(i));
prev = tmp;
for j=1:MAX
y(i+1) = y(i) + h*(tmp - 2*x(i+1)/tmp);
if abs(y(i+1) - prev) < eps
... |
function [M,Start_ratio,Gr,Final_ratio,T1,T2,T3,T4]=EngineData(x,M_v,M_d);
if x==1 %First engine one piston
M_eng=30; %%engine mass [kg]
M=M_v+M_d+M_eng; %%total mass [kg]
Start_ratio=76/31;
Gr=[2.5714 1.8824 1.4737 1.1818 0.958 0.807]; %% Gear ratio
Final_ratio=27/11;
T1=680; %% First momen... |
function [respuesta] = householder(matriz,b)
[largo,ancho] = size(matriz);
U = zeros(largo,ancho);
R = matriz;
for j = 1:min(largo,ancho)
aux = R(j:largo,j);
nu = norm(aux);
if nu ~= 0
u = aux/nu;
u(1) = u(1) + sign(u(1)) + (u(1) == 0);
u = u/sqrt(abs(u(1)));
else
u = ... |
clear all
% load('simulations/simul_susc_fit.mat')
load tester
[t,y,t_short,refin] = model_HK(simulength, susc, cont_mat, agg_istat_pyr, tau, delta_E, prob_symp, gammaI, gammaA, initS, initE, initI, initA, initR, firstDay);
lastDay = simulength*refin + simulength + 1;
initS_lock = y(lastDay,1:6);
initE_lock = y(lastD... |
function H = getH(A,B)
% returns the 3x3 Homography for the 2 point correspondence matrices A and B:
% A: 4 points from source image
% B: 4 points from transformed image (camera view)
% A = [x1 x2 x3 x4 B = [x1' x2' x3' x4'
% y1 y2 y3 y4] y1' y2' y3' y4']
% Create matrix C
C = [];
for j=1:4
part = [... |
% Set average weights for CV SVM models across all iterations.
% it gives the normalized average of normalized weights.
%% Set the decoder weights for each SVM model
wNsHrLrAve_train_alls_dataVSshuff = cell(1, length(dataType));
for id = 1:length(dataType)
cnt = 0;
wNsHrLrAve_train_alls_dataVSshuff{... |
% input = load('6pointsinputs.txt');
% output = load('6pointsoutputs.txt');
input = load('fg_inputs.txt');
output = load('fg_outputs.txt');
input(:,4) = output;
positive = input(input(:,4)==1,:);
negative = input(input(:,4)==-1,:);
figure;
plot3(positive(:,1),positive(:,2),positive(:,3),'+');
hold on;
plot3(negative(:... |
clear all global
colors = 'rgbk';
dotstyles = '*.^+';
collations = {'individual', 'species', 'family', 'family-s'};
%collations = {'species', 'family-s'};
figure;
h = [];
for ci = 1:length(collations)
[bvols, ccas, gmas, gmvs] = ris_collate(collations{ci});
[ntot, ncc, nintra] = predict_nfibers(predict_brwt(b... |
function [hScale,hLabel] = scalebar(hAxis,dist,units,axis,pos)
%===============================================================================
% SCALEBAR Generates a scalebar according to x or y data or both x and y data.
%
% PARAMETERS:
% hAxis Axis in which to draw scalebar.
% [dist] Distance in units of x or y data... |
% mps: sequential simulation of mulitple points statistical model
%
% Very simple 2D implementation of the MPS approach
% described by Guardiano and Srivastava (1993)
%
% Call
% [out,options]=mps(TI,SIM,options)
%
%
% TI: [ny,nx] 2D training image (categorical variables
% SIM: [ny2,nx2] 2D simulation grid. 'NaN... |
%
% Extract requested image image. Returns a single-precision grayscale
% image.
%
%@
% Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"... |
function warped_img = ComputeFlowWarpFrame(img0, img1, u0, v0, t)
% Use forward flow warping to compute an interpolated frame.
%
% INPUTS
% img0 - Array of size h x w x 3 containing pixel data for the starting
% frame.
% img1 - Array of the same size as img0 containing pixel data for the
% ending frame.
%... |
function eig=SolveSecularEqNeg(D,w,Dsort)
%%
% SolveSecularEq in Treften Page 231, (30.12) With negative case
%
m=size(w,1);
eig=zeros(m,1);
for i=2:m
eig(i)=(Dsort(i-1)+Dsort(i))/2;
left=Dsort(i-1);
right=Dsort(i);
while true
if (abs(left-right)<10e-... |
function get_headers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% get_headers.m
%
% open data files and read headers for making an ltsa file
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global PARAMS
m = 0; ... |
function [SPnew, MZnew, bin, SizeMZ]=workflowDESI(PathName,sample)
%% workflow applys preprocessing on DESI imaging, thermo, centroid mode data
%% Input: PathName: directory of the imzML files
% sample: name of the imzML file
% ppm - part per million error of the instrument
% binO... |
%% Get a set of initial datatau = 20
tau = 15;
rho = 0.01;
%Firstly indicate those variables based on the calculation, and are needed
%in later result
global g_etau g_dev_etau g_lr_pass g_lr_tran g_lr_stop g_gradient_lr_pass g_gradient_lr_stop
%Then indicate those variables that pre-set to this IIR filter, including
%p... |
function [delta, ind] = purepursuitcontroller(state, cx, cy, pind, k, lfc, L)
ind = findMIN(state, cx, cy, k, lfc);
if pind >= ind
ind = pind;
end
if ind < length(cx)
tx = cx(ind);
ty = cy(ind);
else
tx = cx(1);
ty = cy(1);
ind = length(cx... |
function data = createFeatureData(files)
%CREATEFEATUREDATA Function for creating feature vectors from multiple
% files and storing them in a vector.
%
% D = createFeatureData(FILES) will return a vector containing
% 'FeatureVector' type objects.
%
% FILES is a vector of dir type structures that contains am... |
function [bodyForce_data] = connectForces2Bodies(structData, body);
%connectbody2Forces() assigns forces to body rather than forceplates.
% OpenSim connects bodies to forces using an external loads file. However
% it can be easier if we allocate the external forces to bodies,
%... |
function plot_mean_and_var(x, y, i, clrB, clrF, plot_title, ylab)
% Create figure
figure1 = figure(i);
% Create axes
axes1 = axes('Parent',figure1);
% Final
dy = std(y)';
y = mean(y)';
x = x';
fill([x;flipud(x)],[y-dy;flipud(y+dy)], clrB,'linestyle','none');
hold on
... |
clear all;
close all;
image=imread('image.jpg');
filter=lofg(1.4,9);
answ=operation(image,filter);
%zero crossing thing
final=zcross(answ);
output_image=im2uint8(final);
figure;
imshow(image);
title('Original Image');
figure;
imshow(output_image);
title('After applying Marr-Hildreth algorithm');
figure;
imshow(ans... |
function [t_sim,x_sim,j_sim,y_sim] = simulate_model(tspan,x0,p,p0,u,m)
%% states
if isfield(m.info,'mexfile')
[t_sim,x_sim] = feval(m.info.mexfile,tspan,x0,p,u,[1e-6 1e-8 10]);
else
[t_sim,x_sim] = ode15s(m.info.odefile,tspan,x0,m.info.ode_options,p,u,m);
t_sim = t_sim';
x_s... |
function obj=obj_fun(x,varargin)
% This is a example of optimizing a cardboard box
% 3 design variables and 2 responses.
% Design variables: DV1 = W - width of a cardboard box
% DV2 = H - height of a cardboard box
% DV3 = D - depth of a cardboard box
% Responses: R1 = V - Volume of a cardboard box
% ... |
function p =tofChirpCommand(varargin)
%p =tofChirp(numChirps, moteID, context)
%
%This packet will make a mote with TOF_RANGING install chirp
%a packet and sound at the same time
%
%Adjust the relevant global parameters listed below before calling this function.
% "Copyright (c) 2000 and The Regents of the Univers... |
function [Z,Y,details]=Dual_GlobalFBE(obj,x0)
%
% This function calculate the optimal solution using the
% APG algorithm on the the dual problem for the system at the
% given initial point
%
% INPUT: x0 : initial point
%
% OUTPUT: Z : primal solution
% Y : dual solution
% details : str... |
function [spikeRate, spikeMat, timeOut, indBase] = makeSpikeRatesSI(foo, range , bin, filtWidth)
clCell = foo;
time = range(1):bin:range(2);
filtSize = round(filtWidth./bin);
filter = gausswin(filtSize)./sum(gausswin(filtSize));
%%
nTrials = length(clCell);
for n = 1:nTrials
thistrial = clCell{n};
[N,edges... |
function [rseq_data,gene_symbols,sample_conditions] = readrseqdata(file_name)
tmp_data = readtable(file_name,'ReadVariableNames',false);
gene_symbols = table2cell(tmp_data(2:end,1));
sample_conditions = table2cell(tmp_data(1,2:end));
clear tmp_data;
rseq_data = csvread(file_name,1,1);
return;
end |
%% General System Parameters ===============================================
% Mooring options
startEquil = true;
seafloorConstraint = false;
MWL = 60;
rho_f = 1020; % [kg/m^3]
tf = 30; % s
tStep = 0.02; % s
domain = [-20 140 -20 80 0 40];
perspective = [105 10]; % [Azimuth, Elevation]
DynamicModel = false;
Slackline... |
function res = rotateY(degs)
rads = deg2rad(degs);
res = [ cos(rads) 0 sin(rads);
0 1 0;
(-sin(rads)) 0 cos(rads) ];
end |
%MOISES BARBERA RAMOS
%13-11-2018
clear all
close all
clc
%FILTER 2mm - used for the first set to analyse
M = csvread('2mm filter day 2.csv')
%PEAK 1
theta1 = M(14:37,1);
I1 = M(14:37,2);
%PEAK 2
theta2 = M(41:52, 1);
I2 = M(41:52, 2);
%PEAK 3
theta3 = M(93:110, 1);
I3 = M(93:110, 2);
%PEAK 4
the... |
function [channels, clips, timesUsec, labels] = f_loadDataClips(dataset, params, runDir)
% Usage: f_feature_energy(dataset, params)
% Input:
% 'dataset' - [IEEGDataset]: IEEG Dataset, eg session.data(1)
% 'params' - Structure containing parameters for the analysis
%
% dbstop in f_loadDataClips at 18
... |
%check for connectivity for directed graph
%13.10.2013 Ershov Egor (Ershoff)
%Description information about graph is in connectivity
%matrix. Scale of the matrix is doesn't matter.
function [bitwise_answer] = check_connectivity(G)
n = length(G);
I = zeros(1,n);
I(1) = 1;
count = 1;
while ( sum(I)... |
% Script to compute HOG2x2 or SIFT features
%
%
% NOTE: This is adapted from Aditya's feature-extraction codes.
%
% Copyright Aditya Khosla http://mit.edu/khosla
%
% Please cite this paper if you use this code in your publication:
% A. Khosla, J. Xiao, A. Torralba, A. Oliva
% Memorability of Image Regions
% Adva... |
% Example of using lmdb and caffe protobuf (datum) in matlab.
%
% by Jiayu, July 1, 2015.
%
% NOTE 1. start matlab with a specified libtiff.5.dylib.
% DYLD_INSERT_LIBRARIES=/usr/local/lib/libtiff.5.dylib /Applications/MATLAB_R2012b.app/bin/matlab &
%
% 2. install matlab-lmdb
% https://github.com/illidanlab... |
N = 512; % number of samples
T = 20; % meaning??
K = 120; % used to represent a sample
x = zeros(N,1);
q = randperm(N);
x(q(1:T)) = sign(randn(T,1)); % 设置一个标准? 与恢复的结果做对比??
disp('Creating measurment matrix...');
A = randn(K,N); % A is a matrix of training samples, a sample is K-dim
% can be considered ... |
clc
clear
%% PCA
A = rand(100,20); %input
B = pca(A); %coeff
C = B(:,1:10); %choose how big your matrix number
D = A*C; % output
|
function [track,track_index]=Mintrack_1505032(A,B)
%disp('trackmin A is:');
%disp(A);
%disp('trackmin B is:');
%disp(B);
[a,~] = size(A);
%disp('trackmin A row is:');
%disp(a);
ratio=intmax('int64');
if(A(1)~= 0)
ratio=B(1)/A(1);
end
track=A(1);
track_index =1;
for k=1:(a-1)
if((B(k)/A(k))<ratio&&... |
function RGB = irpThresholdsGray2RGB(I, low, high)
% RGB = irpThresholdsGray2RGB(I, low, high)
% Konvertiert ein Graustufenbild in ein RGB-Bild mit folgenden
% Farbwerten (R,G,B):
% - (0, 0, 255) Hintergrund (blau)
% - (0, 255, 0) Bauteile (grün)
% - (255, 0, 0) Schlitten (rot)
% - (0, 0, 0) Sonst (schw... |
clear,clc;
disp('************************For partial derivative calculation************************')
Solver = EllipticProblemCalculatePartialDerivative3d(1,1,50,5);
Solver.EllipticProblemSolve;
clear;
disp('************************End partial derivative calculation************************')
disp('********************... |
function [] = reportWord(xlsFilename, period)
% 给excel版本nav数据,自动生成word报告,评价单nav
% 具体细节见FAQ
% [] = reportWord(xlsFilename, period)
% 输入:
% xlsFilename: excel文件的名字(含路径),输入的nav数据在里面
% period:数据周期, d245/d360/d365/w/m/q/y
% 输出:
% 一篇word文档,在当前路径下
% ---------------------------------------
% 唐一鑫,20150730,出版本,建立在陈思思... |
function createfigure(xdata1, ydata1, zdata1, cdata1, X1, Y1, Z1, S1, c1)
%CREATEFIGURE(XDATA1, YDATA1, ZDATA1, CDATA1, X1, Y1, Z1, S1, C1)
% XDATA1: surface xdata
% YDATA1: surface ydata
% ZDATA1: surface zdata
% CDATA1: surface cdata
% X1: scatter3 x
% Y1: scatter3 y
% Z1: scatter3 z
% S1: sc... |
clear all close all;
load fakedataEPfits_1
load fakedataEPfits_2
load fakedataEPfits_3
load fakedataEPfits_4
load fakedataEPfits_5
diff_AIC_LL = [diff_AIC_LL_1; diff_AIC_LL_2; diff_AIC_LL_3; diff_AIC_LL_4; diff_AIC_LL_5];
diff_AICc_LL = [diff_AICc_LL_1; diff_AICc_LL_2; diff_AICc_LL_3; diff_AICc_LL_4; diff_AI... |
% Nithilam Subbaian MatLab assignment One
%Question 1
a = 5.7 * pi / 6.9;
b = 239 + exp(5) - 2.5*10^(23);
c = log(exp(4.23))* asin(0.7);
z = (3+2j) * (4+5j);
%Question 2
real_z = real(z);
imag_z = imag(z);
magnitude_z = abs(z);
phase_z = angle(z);
complex_z = conj(z);
%Question 3
aVec = [3.14 15 9 26... |
folder ='C:\Users\hp\Desktop\project on watermarking\comparison_plots\tables.xls';
% % jpeg
x = [70, 50, 40, 30, 20, 10, 5];
our = [0.9997, 0.9996, 0.9996, 0.9995, 0.9994, 0.9993, 0.9992];
one = [0.9940, 0.9900, 0.9880, 0.9870, 0.9830, 0.9720, 0.9520];
two = [0.9990, 0.9990, 0.9990, 0.9980, 0.9980, 0.9950, 0.986... |
% defining relevant parameters
T= 1;
T1=1/4;
N=10;
a=-T1;
b=T1;
t1=-0.5:0.001:0.5;
% defining relevant expressions
syms t;
xt = 1/4 - abs(t); % triangle wave
% function call to fourierCoeff which returns array of fourier coefficients
F = fourierCoeff(N,T,t,xt,a,b);
%function call to partialfouriersum which returns ... |
function add_processed_signals(varargin)
% ADD_PROCESSED_SIGNALS -- Save SignalContainer objects for each active
% epoch, as defined in dsp2.config.create().
%
% IN:
% - `varargin` ('name', value) -- Optionally pass in a config file
% with 'config', conf
defaults.config = dsp2.config.load();
d... |
function [name, links, joints, transmissions] = ros_load_urdf(urdf_file, N)
% This function parse the ROS URDF file
%
% @note At this moment, this parser only support the 'link' and 'joint'
% elements in the URDF file. More options are coming soon ...
%
% Return values:
% name: the name of t... |
%% tfSettings.m
%
function settings = tfSettings()
pathToDMF = which('tfSettings');
pathToDM = regexprep(pathToDMF,'tfSettings.m','');
load([pathToDM,'.tfSettings.mat']); |
function [pm,path]=calculatecylindermoves(sqnum,movepoints,obstacles)
ylen=25;
xlen=25;
pm{1}=sqnum;
pm{2}=[];%1 movepoint
pm{3}=[];
pm{4}=[];
path=[];
offset=[1 -1 0 0
0 0 -1 1];
for i=2:movepoints+1
for j=1:length(pm{i-1})
[x,y]=getxy(pm{i-1}(j));
for k=1:4
xnew=x+offs... |
% nice_aparc_plotter.m
%
% Code here to make a nice aparc connectivity parcellation
% Assumes that you have 82 regions i.e. 34 Desikan killany regions Left: 7 Subcortical regions (from aparc) for each hemi
%
% 2020
% Kevin Aquino <aquino.km@gmail.com>
%
function [square_mat,inds,total_order,all_regions,cmap] = nice... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.