text stringlengths 8 6.12M |
|---|
% phi_base [3x1]
% Base orientation in world frame. Expressed with XYZ-Euler angles
|
function img_out = skindetnrg(img,hist,raxis,gaxis,thres)
% this is a function that detects the sub region according to the histogram
% in N-RG space
% [row, col] = size(img);
label = hist<=thres;
R = double(img(:,:,1));
G = double(img(:,:,2));
B = double(img(:,:,3));
sum = R+G+B;
r = R./sum; g = G./sum;% b = B./su... |
function varargout = proj2sphere(sph,X)
% PROJ2SPHERE projects a set of points to the surface of a specified sphere
% Xproj = PROJ2SPHERE(sph,X) projects the N points contained in the 3xN
% array X to the surface of a sphere specified as either a 1x4 array or a
% sphereModel object.
%
% X - 3x4 array c... |
function [ dataset ] = Prepare( filepath,varargin )
%PREPARE combine some data together for analysis
% Peichao: Combine Scanbox .mat info, analyzer, spkie2 data and hartely log files if have one
% Detailed explanation goes here
p = inputParser;
addRequired(p,'filepath');
addParameter(p,'SpikeSorting','None')
addPara... |
function plot_hybrid_SC(sim_obj,par)
%This script plots the output of the full metabolism model
figure
subplot(3,1,1);
hold on
if par.N == 1
colors = [1 0 0];
else
colors = distinguishable_colors(par.N);
end
linetypes = {'-','--'};
% Plot the enzymes and metabolites
enzyme_ind = sim_obj.var_id1 == 2;
type1... |
%% Research Segmentation Script
% Author : D Yoan L Mekontchou Yomba
% Lab: Biomage Statistical Pattern Recognition Laboratory
% Date: January 2nd 2017
% Content - Segmenting OCT retinal images
%% Introduction
clear all; close all; clc; % clearing all workspace
warning off; % eliminating warnings
%% Adding... |
function eventInds = eventTimeToIdx(eventTime, traceTimeVec)
% eventInds = eventTimeToIdx(eventTime, traceTimeVec)
%
% eventInds: index of eventTime on array traceTimeVec for each trial.
if iscell(eventTime)
eventTime = cellfun(@(x)x(1), eventTime);
end
% frametimes and eventTime are relatie to bcontro... |
clear all;
close all;
% Modulation 4QAM-Maire
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Paramètres généraux
Maire = 4; % QAM
nbSymb = 8; % Nombre des symboles
Fd = 2000; % Débit symbole
Fe = 16000; ... |
clear all
% Program reads the data from the sme files and writes the data in an
% output file used in carboeuroflux (Michael Boy June 2004)
% Open sme files for every month
YEAR = input('Year: ', 's');
year = eval(YEAR);
day_month_03 = [0 31 59 90 120 151 181 212 243 273 304 334];
day_month_04 = [0 31 6... |
% (1) Open a device handle:
dev = limeSDR(); % Open device
% (2) Setup device parameters. These may be changed while the device
% is actively streaming.
dev.rx0.frequency = 1000e6;
dev.rx0.samplerate = 5e6;
dev.rx0.gain = 30;
dev.rx0.antenna = 2;
% (3) Enable stream parameters. ... |
gui = figure('Position',[((1366/2)-250) ((768/2)-250) 500 500],'Color','w','Name','Ludo','numbertitle','off','menubar','none');
axis([0 500 0 500])
axis off
hold on
p=4;
% Die showing 1
[one, map, alpha] = imread('1.jpg');
hOne = image(one,'XData',[30 160],'YData',[250 380]);
%------------------------------... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Technische Universität Berlin
% Fakultät Verkehrs- und Maschinensystem
% Fachgbiet Kraffahrzeuge
% M.Sc. Osama Al-Saidi
%
% Fahrzeugregelung: Übung - Einführung in Matlab/Simulink
% Aufgabe: Mathematische Operationen
% Datum: 21.10... |
function [positions, time] = tracker(video_path, img_files, pos, target_sz, ...
padding, kernel, lambda, output_sigma_factor, interp_factor, cell_size, ...
features, show_visualization)
%resize the image
resize_image = (sqrt(prod(target_sz)) >= 100);
if resize_image,
pos = floor(pos / 2);
... |
function obj = where(obj, varargin)
% WHERE Method to define the filter expression for the table query
% Copyright 2018 The MathWorks, Inc.
% Pass through to the Java layer.
obj.Handle = obj.Handle.where(varargin{:});
end %function
|
classdef Interop
% INTEROP - A collection of utility functions that support working with other programming languages.
%% CHANGELOG
% Written by Josh Grooms on 20150328
%% UTILITIES
methods (Static)
function PrintArray(x)
% PRINTARRAY - Formats and prints a numeric array in the MATLAB console window for use... |
function val =Homework2_2(a)
%%% %%% Will return value for the function for
%%% a scaler or vector input
val = 1*sin(0.1 + 2*a)./(0.1 + a ); |
clear
clc
% this function returns the mel-capstr coefficients for each sample in the signal
% signal has length, it contains vectors = length (sample size)
% of the sample size, we have to shield knowing the sampling rate and the period that we need
%=====================================================================... |
function plotStressandRot(S,E)
S.S11(isnan(S.GND))= NaN; S.S22(isnan(S.GND))= NaN; S.W21(isnan(S.GND))= NaN;
S.W31(isnan(S.GND))= NaN; S.W32(isnan(S.GND))= NaN; S.S13(isnan(S.GND))= NaN;
S.S23(isnan(S.GND))= NaN; close all; S.S12(isnan(S.GND))= NaN;
O.X = S.X; O.Y = S.Y;
close; S.X = unique(S... |
% PTF_LINE
%
% Function PTF_LINE returns the line descriptopn reached from two points
%
% ptv_line = ptf_line(x,y)
%
% where
% x - is vector of two points positions on X axis
% y - is vector of two points positions on Y axis
% Copyright is with the following author(s):
%
% (c) 2012 Juraj Oravec, Slovak Unive... |
noise_values=0+(0.05:0.15:1.5);
clear E1 E2 E3 M1 M2 M3 f
iters=1;
E1=zeros(2,iters,numel(noise_values));
E2=zeros(2,iters,numel(noise_values));
E3=zeros(2,iters,numel(noise_values));
nodes=16;
modules=2;
[bm , mods] = random_modular_graph(nodes,modules,1,.90);
nel=numel(bm);
mod_matrix = ind2mod(mods,bm);
H=ones(n... |
set_seed_01_chs = imageDatastore('E:\_seed_set_50\01\chs','IncludeSubfolders',true,'FileExtensions','.png','LabelSource','foldernames');
set_seed_01_eng = imageDatastore('E:\_seed_set_50\01\eng','IncludeSubfolders',true,'FileExtensions','.png','LabelSource','foldernames');
set_seed_01_chs.ReadFcn = @(loc)imresize(imre... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CNA 10/10/2016
% Script that integrates the detection, localization and demodulation of
% signal sources for the MASNET project. It integrates codes from Pat
% Chambers and Heba Shoukry.
% The script is organised as follows:
% 1) Generates t... |
classdef Stream
%STREAM Summary of this class goes here
% Detailed explanation goes here
properties
Flowrate % mol/s
Pressure % bar
xA % unitless
xB % unitless
end
methods (Static)
function obj = Stream(Q,P,xA,xB)
%ST... |
classdef AdvAbstractOBFlow2d < AdvAbstractConstFlow2d
methods ( Access = public )
function obj = AdvAbstractOBFlow2d()
obj = obj@AdvAbstractConstFlow2d();
end
function [ fM, fP ] = matImposeBoundaryCondition( obj, edge, nx, ny, fM, fP, fext )
ind = ( edg... |
function stimulusMatrix = EmbedInAnnulus(InnerMatrix,AnnulusWidth, AnnulusColor)
%Given a square annulus pixelvalue matrix, puts a circular matrix in the hole of the annulus ring.
% AnnulusWidth - given in pixels
%Assigning diameter
Diameter = size(InnerMatrix, 1);
stimulusMatrix = InnerMatrix;
for y = 1:Diamete... |
% Runs the small tests for the whole cell simulation.
%
% Author: Jonathan Karr, jkarr@stanford.edu
% Author: Jared Jacobs, jmjacobs@stanford.edu
% Affilitation: Covert Lab, Department of Bioengineering, Stanford University
% Last updated: 8/13/2010
function runSmallTests()
%% initialize
warning('off', 'WholeCe... |
% compute two repeats from sequence of stimuli and responses
% subtracts spontaneous components (nPCspont)
function compileResps(dataroot, matroot, useGPU)
%% contains information about recordings
load(fullfile(dataroot,'dbstims.mat'));
for K = 1:6
clf;
iexp = find(stype==K);
clear respAll;
for k = 1:... |
function a=fexist(filename)
% FEXIST check if a file exists
%
% fexist(filename) checks if a file exists
% and returns 1 if true and 0 if not.
%
% Klaus Hartung (hartung@aea.ruhr-uni-bochum.de)
% Lehrstuhl fuer allg. Elektortechnik und Akustik
% Ruhr-Universitaet Bochum
% 44780 Bochum
%... |
%See FeasibleFuture class for more information.
%This class implements the feasible future as a large set of elements, each one
%being equivalent to a reachable state given an initial set of states and a given
%time slot.
classdef FFDummie < FeasibleFuture
properties(Constant)
tolerance = 1e-6
tolerance_f... |
function G =dictionary_correlation_151202 (x)
% function G = dictionary_correlation_151202(x)
%
% this function takes in a vector of timing parameters and uses it to
% create a dictionary of ASL signals.
% it returns the correlation among the dictionary entries
%
%
% it returns the norm of the correlation matrix of th... |
function this = reduce(this, varargin)
% reduce Reduce algebraic expressions if possible.
%
% Backend IRIS function.
% No help provided.
% -IRIS Macroeconomic Modeling Toolbox.
% -Copyright (c) 2007-2017 IRIS Solutions Team.
persistent SYDNEY;
if isnumeric(SYDNEY)
SYDNEY = sydney( );
end
% @@@@@ M... |
function matrix()
mat = [1 2; 1 8;3 8;4 4]; %;2 10;
[row,col] = size(mat);
for x = 1:row
vecRow=mat(x,:);
plot(vecRow(1),vecRow(2),'o','MarkerSize',5);
hold on;
axis([0 12 0 12]);
%end
end
|
function [F3]=uF3(phi,theta_0,r,varphi,vartheta,rho,pln,Dtg,t,i,Gpoly,kpeo,kpmpc)
f5=uPsi(phi,0,r,varphi,vartheta,rho,pln,Dtg,t,i,Gpoly).*(kpmpc).*uV2(phi,0,r,varphi,vartheta,rho).*r.*sin(phi);
f6=-uPsi(phi,theta_0,r,varphi,vartheta,rho,pln,Dtg,t,i,Gpoly).*(kpmpc).*uV2(phi,theta_0,r,varphi,vartheta,rho).*r.*sin(phi);
F... |
E = corrdim(X(:,1:5000)');
E=sort(E);
ne=size(E,1);
n=[1:ne]./ne;
plot(log(E),log(n));
xlabel('log(n)')
ylabel('log(dist)')
grid on
%x=ginput(2)
%p=polyfit(x(:,1),x(:,2),1) |
function out=add_tign_col(raw,t)
% out=add_tign_col(raw,t)
% Input:
% raw spreadsheed loaded by [num,txt,raw]=xlsread('filename.xls')
% row 1 are headings
% column 1 is latitude
% column 2 is longitude
% t structure created from wrfout as follows:
% t=read_wrfout_ti... |
% Esercizio 1.4
%
% Autore: Tommaso Papini,
% Ultima modifica: 4 Novembre 2012, 11:04 CET
hold on
format long e;
tol = 1e-11;
x = zeros(1, 2);
delta = 2 - sqrt(2);
i = 1;
while(delta > tol)
if(i==1)
x(1, 1) = 2;
elseif (i==2)
x(2, 1) = 1.5;
else
x(i, 1) = (x(i-1, 1)*x(i-2, 1) +2)/(... |
function h = gaussFilter(N, var)
h = fspecial('gaussian',N,sqrt(var)); |
function TDT2mat_raw()
close all;
clear all;
disp('================================');
disp([mfilename,'.m']);
disp(datestr(now));
prm.save_option = 1;
prm.save_type = 'mat'; % h5 or mat
% prm.day = 16;
prm.save_file_dir = 'C:\Takayuki\20151218\block2';
prm.tank_name = 'C:\Takayuki\20151218';
prm.ses... |
% arFitLHS([n], [randomseed], [log_fit_history], [backup_save], [use_cluster])
%
% Multi-Start optimization fit sequence using random sampling from prios
% or latin hyper cube sampling
%
% n number of fits [10]
% randomseed random seed used for initial guesses
% ... |
classdef SimData
properties
X
u
t
dt
end
methods
function obj = SimData(X,u,t,dt)
obj.X = X;
obj.u = u;
obj.t = t;
obj.dt = dt;
end
function s = sigma(obj)
s = obj.X(1:3,:);
... |
function [param] = run_contrasts_one_back_analy_1(param)
%description of first level des mx
%CHAIR/BUILD/SCRCHAIR/(SCRBUILD-only subs1-4)/TARG
curr_sub=param.curr_sub;
%note EVENT DURATION modelled as ZERO
curr_sub_group=param.curr_sub_group; %i.e. SUBJECT GROUP
all_others=zeros(1,11); %i.e. including movt,, 4x bl... |
clear all
close all
Xmin= 1;
Xmax=50 ;
r = Xmin:0.5:Xmax
lam= 7;
pdx= exppdf(r,lam)
m=max(pdx)
i=1
while (i<10000)
t=rand;
x=(Xmax-Xmin)*t +Xmin;
u= m.*rand();
pdxi= exppdf(x,lam);
if u <= pdxi;
sample(i)=x;
i=i+1;
end
end
disp(sample);
%Display sa... |
function subDataset =dataSubset (Data, groupVariables, groupVariablesConditions)
%% Input the Dataset (rows by nCols)
%% give a vector with the group variables (cell array of nominal arrays) of the dataset (cols) and a
%% vector with the conditions to pick up from those variables (cell array with cell arrays of ... |
%% Generate NBI deposition profiles of heat and torque
% by modifying manually-fitted experimental profiles.
% A skewed Gaussian function models the shape of profiles.
%
% The user can choose to set:
%
% -- the beam power with cP = P/P_origDepo, [0;+inf[
%
% -- the launching angle with cl = angle/angle_mag,
% ... |
function MIplot(grandMetrics, grandIX, MI, metricLabels)
genoList = unique(grandIX(:,3));
powerList = unique(grandIX(:,1));
[B, IX] = sort(MI,'descend');
% printMetricLabels(metricLabels, IX);
figure;
plot(B);
% subplot(1,2,1);
% plot(MI);
%
% subplot(1,2,2);
%
... |
function y = mtimes(A,B)
% Note that either A or B is an operator since this function gets
% called for both M*C, C*M, where C is the class and M is a matrix or
% vector. This gives the following options, with S for scalar and C
% for any instance of a classOp
%
% 1) M*C, to be implemented as (C'*M')'
% 2) C*M
% 3) s*... |
function ss=sameside(line,point1,point2)
ss = false;
if isnan(point2(1)) || isnan(point2(2))
return;
end
if (line.k~=Inf)
s1=line.k*point1(1)+line.b-point1(2);
s2=line.k*point2(1)+line.b-point2(2);
else
s1=point1(1)-line.point1(1);
s2=point2(1)-line.point1(1);
end
if s1*s2>0
ss = true;
end
e... |
function yEER = Database5_1_MC
x = 0:2000:60000;
xq = 0:0.5:60000;
y0 = [0 0 0 0 0 0 0 0 0 0 0 0 0.0210526 0.115789 0.257895 0.484211 0.673684 0.826316 0.889474 0.968421 0.978947 1 1 1 1 1 1 1 1 1 1];
yy0 = interp1(x, y0, xq, 'pchip');
y1 = [1 1 1 1 1 1 0.985 0.945 0.875 0.76 0.605 0.425 0.245 0.12 0.04 0.03 0.025 0.0... |
function [posterior,test_label] = calculate_probabilities(xTest,model,xTrain)
w = model.Coeffs(2,1).Linear;
mu = model.Coeffs(2,1).Const;
distance = xTrain * w + mu;
p1 = 0.025;
p2 = 1-p1;
bcoeff1=-log((1-p1)/p1)/prctile(distance,100*p1);
bcoeff2=-log((1-p2)/p2)/prctile(distance,100*p2);
b = (bcoeff1+bcoeff2)/2;
mod... |
function par = simulation_init_downlink(par)
% use runId random seed (enables reproducibility)
rng(par.runID);
% generate reasonable filename
par.simName = simfile_name_downlink(par);
% set up Gray-mapped constellation alphabet (according to IEEE 802.11)
% Gray code ref: https://www.sciencedir... |
img_path = 'your image path';
net_path = 'dbcnn model path';
mode = 'gpu'; %or cpu
dagnet = load(net_path);
dagnet = dagnn.DagNN.loadobj(dagnet.net) ;
move(dagnet, mode)
dagnet.mode = 'test';
dagnet.conserveMemory = 0;
opts.numThreads = 8;
averageImage = reshape(dagnet.meta.meta1.normalization.averageImage,[1... |
function [num_color,colors] = coloring(A)
%number of needed colors
num_color = 1;
colors = [];
A(A~=0)=1;
% C = sparse(zeros(size(A)));
C = sparse(size(A,1),size(A,2));
for i = 1:size(A,1)
for j = 1:num_color
if not (any(C(:,j)+A(:,i)>1))
C(:,j) = C(:,j) +... |
%
% Values from the Schiller and Malpeli paper
%
cd /home/brian/book/04retina/fig/subConduction
parvo = [0 2 7 37 6];
magno = [3 25 14 0 0];
bar(parvo)
set(gca,'ylim',[0 40],'ytick',[0:10:40], ...
'xticklabels',[],'yticklabels',[]);
print -deps parvoLatencies
bar(magno)
set(gca,'ylim',[0 40],'ytick',[0:10:40... |
function [Estimation, Parameters] = AnalyzeMRImages_MarkovField(Sequences,Dico,Method,Parameters,References,Outliers)
if nargin < 3, error('Not enought input arguments'); end
if ~exist('Method','var'), Method = 'RegressionMRF'; end
if ~exist('Parameters','var'), Parameters = []; end
if ~exist('References','var')... |
function J = ComputeCost( X,Y,theta )
m=length(Y);
h=X*theta;
L=length(theta);
%cost
J=(1/(2*m))*sum((h-Y).^2)+((0.00000001/(2*m)* sum((theta(2:L,1)).^2)));
end
|
function [CC,E] = edgeDetect(I)
% edgeDetect Perform basic edge detection with morphological closing excluding borders
%
% Mark Kittisopikul, 2010
% UT Southwestern
% edges with laplacian of gaussian method
E = edge(I,'log',0);
% close gaps
E = imclose(E,strel('disk',1));
% set the outer border as... |
function [ lgth ] = perimLength(x,y)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
% msfc = 25/38;
msfc = 1
for i=1:length(x)-1;
d(i) = sqrt((x(i+1)-x(i)).^2+(y(i+1)-y(i)).^2);
end
lgth = sum(d)*msfc;
end
|
function output = CCM(input)
% output = CCM(input)
%
% CCM computes the composite properties by the composite cylinder model
% from the component level properties.
%
% INPUT is a struct with the following fields
%
% Fiber
% :E23f
% :E12f
% :v23f
% :v12f
% :G23f
% :G12f
% Matrix
% :Em
% :vm
% Volume F... |
function [xn] = metodaHalleya(x,a, d, N)
%Funkcja znajdująca przybliżoną wartość
%miejsca zerowego wielomianu zapisanego
%w postaci wielomianów Czebyszewa przy użyciu
%metody Halleya
%Argumenty:
%x - liczba rzeczywista, punkt startowy z którego będziemy szukali
%miejsca zerowego
%a - niepusty numeryczny wektor wspó... |
classdef (Abstract) IEEGObject < handle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2013 Trustees of the University of Pennsylvania
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
... |
%% Load data
load('bunny.mat');
%% Example: plotting bunny
figure;
imshow(reshape(X(1,:),sz),'initialmagnification','fit');
title('First bunny');
print('first_bunny.png','-dpng');
%% Example: making 3d scatter plot
figure;
scatter3(1:10,1:10,1:10,24,1:10);
colormap('jet')
print('3d_scatter.png','-dpng');
%% plot 'm... |
%
% This function takes two joint configurations and the parameters of the
% obstacle as input and calculates whether a collision free path exists
% between them.
%
% input: q1, q2 -> start and end configuration, respectively. Both are 1x4
% vectors.
% sphereCenter -> 3x1 position of center of... |
function fuseImages(brainData)
if ~isempty(brainData.Data.Functional)
if isempty(brainData.Parameters.Threshold)
brainData.Parameters.Threshold = [0 0];
end
% Pull data from the data object
functionalData = brainData.Data.Functional;
threshold = brainData.Parameters.Threshold;
vert... |
function [X] = MF_MC_2layer(y,M,sizeX,rankr, mu1,mu2, Lr, Lc )%M_te,full,Xbase,alpha,outsweep)
% Matrix Completion via Doubly Fraph regularized Deep matrix Factorization
% Inputs
% X - matrix to be estimated
% M - masking operator, applied to vectorized form of X
% y - sampled entries
X_tr=reshape( M(y,2) ,sizeX);... |
function adjacencyMatrix = RemoveFraction( adjacencyMatrix, f)
nodesToRemove = round(size(adjacencyMatrix,1) * f);
for i = 1:nodesToRemove
index = randi(size(adjacencyMatrix,1));
adjacencyMatrix(index,:) = [];
adjacencyMatrix(:, index) = [];
end
end
|
% plot data
% [~, uniqueInd] = unique(t_rmse);
ax = [];
h2_3 = figure;
ax(1) = subplot(211);
dofsUsedInIOC_plotStack = reshape(dofsUsedInIOC_plot, 1, size(dofsUsedInIOC_plot, 1)*size(dofsUsedInIOC_plot, 2));
hist(dofsUsedInIOC_plotStack(dofsUsedInIOC_plot > 0), 1:length(cost_function_names)); % plot first time to gene... |
%y1'=y2*y3 y1(0)=0
%y2'=-y1*y3 y2(0)=1
%y3'=-0.51*y1*y2 y3(0)=1
%t=[0,12]
syms tt yy1 yy2 yy3;
% yy=dsolve('Dyy1=yy2*yy3','Dyy2 = -yy1*yy3','Dyy3 = -0.51*yy1*yy2','yy1(0)=0','yy2(0)=1','yy3(0)=1','tt');
tspan=[0 12];%变量求解区间
x0=[0 1 1];%初始值
options=odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
[t y]=ode45(@t... |
function y = fn_subsref(x,varargin)
% function B = fn_subsref(A,idx1,idx2,...)
% function indices = fn_subsref(siz,idx1,idx2,...[,'global|local'])
%---
%
% Input:
% - A/siz array, or size of an array (the function guesses that it is
% a size vector if the argument is a vector of size less than
% ... |
%% part 2 of the analys, the T1s need to be manually realigned and saved in a special folder
clear all
%% basic structure
spmfolder='D:\Toolboxes\SPM8\';
addpath(genpath('D:\Toolboxes'))
fs=filesep;
sess_prfx = 'run_';
%the scripts assumes 6 dummy scands and for the full volumes 6 volumes (so
%it deletes5)
... |
% % LAB4 Ex.4
clear all;
close all;
alpha = 0.1;
k = 0.05; % com 50s x não dissona
fs = 100;
n = [0:1/fs:2];
x = sin(20*pi*1*n);
xshifted = sin(20*pi*1*(n-k));
y = alpha*xshifted;
[a,lag] = xcorr(x,x);
tlag = (1/fs)*lag;
[c,lag2] = xcorr(y,x); % Correlação não comuta!, xcorr(x,y)!=xcorr(y,x)
tlag2 =(... |
clear all;
cd ..
setpaths3
cd demos
disp('Warning, the autotuning demonstrated in this demo is still experimental. Updates will follow soon...');
%% load data
try
load bal.mat
catch % if it fails, download it from the web
disp('Downloading data ...');
urlwrite('https://dl.dropboxusercontent.com/u/42847... |
function [ ExpectedPayoff ] = calcExpectedPayoff( obj , ST )
%计算期望的paypff
%输入
% 其中obj可以是单个类也可以是多个的类
% 这个类可以是OptInfo|也可以是OptPricer|也可以是QuoteOpt
%输出
% ExpectedPayoff是每一个期权的期望payoff值
% 吴云峰,20160219
% 如果不存在着ST,则用第一个类的ST进行替代
if ~exist( 'ST' , 'var' ), ST = obj( 1, 1 ).ST; end;
% 判断数据的类型
isOpt = isa( obj , 'OptInfo' )... |
function outImage = myBilateralFilter(A,w,sigma_s,sigma_r)
% A : noisy input image (type: double)
% w : window size for bilateral filter
% sigma_s : spatial standard deviation for bilateral filter
% sigma_r : range standar deviation for bilateral filter
% outImage : bilateral filtered output image (type... |
function [Mdlb, Mdlr, Mdlst, Init] = create_search_trees(AllDataTable)
%
% Creates the samplers used by the Probabilites class
% to sample the run databased based on a set of dependencies
%
addpath('Models/ModelBase')
T = AllDataTable;
T = T(~isnan(T.theta1),:); %Remvoes 5 runs that m... |
% 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 [roc_score,TPR, FPR, cutoffs] = pepROC(lag_range, lagsToPlot, C, names, ...
summer_doy, predictand, predictandName, ...
GHCND_clustered, fig_folder)
makeplots = 0;
cutoffPerc = 0:10:100;
if strcmp(names,'NINO') % calculate for with and without 1988
[roc_score, TPR, FPR, cutoffs] = ... % with 1... |
function dpnRedrawPatch(~,~,fig,type)
%dpnRedrawPatch - re draw the designated annotations, i.e. this function
%needs to be called for each of the three axes as required
% Get the guidata
dpn = guidata(fig.fig);
if isempty(dpn)
return
end
% Check that there are some annotations
if ~isfield(dpn,'anno')
return
... |
function test_proj2metric_orthos(filename)
timestamp = strftime("%Y%m%d-%H%M", localtime(time()));
funcname = mfilename();
prefix = sprintf("%s_%s_%s", filename, funcname, timestamp);
I = imread(filename);
img = I;
if (isrgb(img))
img = rgb2gray(img);
endif
fullscr... |
% Derive Contact-Based dynamics for the rolling disk
%
%
clear; clc;
syms q dq ddq 'real' %Angle state
syms x dx ddx 'real' %Horizontal state
syms y dy ddy 'real' %Vertical state
syms Fx Fy 'real' % Contact forces
syms slope m g r I 'real' % Parameters
% Angle from the center of the disk to the contact point,
% ... |
function rfList = makeDmbs( dmb, data )
%makeDmbs Makes .dmb's based on the user input and arfs data
p = dmb.pack;
p.nReq = str2double(p.nReq);
%% Best frames from EACH cluster
if p.clusterwise && ~data.mtskip
ng = numel(data.clusters); % number of groups
tnc = 0; % total number of clusters
... |
% CEE 530 Final Project
% Author: Haitong Wang
% 2D time-dependent FEM Diffusion problem
clear all;
% Inputs
height = 0.34;% cm; depth of the tissue layer
length = 5; % cm; length of the tissue layer
D_T = 5E-08; % cm2/sec, diffusion coefficient for the tissue
k_B = 0.122 / 3600; % sec-1, damping ratio for blood
c0 =... |
% Cryptographie chaotique
% ***********************
%
% Superposition : Alice
% ---------------------
disp('Alice');
%% 1 - Création du message caché
[Message,msgCache,msgClair] = genMessage(bitRepete,nbrBit);
Message = [zeros(1,nbrBitLock*bitRepete) (Message.*A)'];
%% 2 - Signal porteur et bruit expérimental
glob... |
clear mex
mex endpoint2mex.c
waveFile='D:\users\jang\matlab\toolbox\asr\application\RMC\waveData\ivr辨識音檔-手機\coco1.wav';
waveFile='D:\users\jang\matlab\toolbox\asr\application\RMC\waveData\ivr辨識音檔-手機\soph5.wav';
[y, fs, nbits]=wavread(waveFile);
out2=endpoint2mex(y, fs, nbits)
out=endpoint2(y, fs, nbits)
difference=sum... |
% mylog.m
%
% auxiliary logistic-class function used for ion channels
%
% $Revision:$
%
function ml = mylog(V_m, g, V_h, V_c)
ml = g ./(1+exp((V_m-V_h)./V_c));
|
function t = tsample (tstart, tfinal, N, random)
%% generates a column vector t with constant or non-constant dt for use in test2
% Inputs: tstart - initial time, t_1
% tfinal - end time, t_N
% N - number of entries
% random - Boolean, with true giving t vector of non constant
% ... |
function [T,IDmap]=readOrgData(T)
%% Add counter and IDs to table
%% Input
% T: original OCMA data as importet from CSV
% table with entries TagName, EventTrigger and others
%% Output
% T: preprocessed table with additional entries
% date (numeric), counter, ID (unique ID for unique TagName)
% IDmap: mapping between I... |
function make_slowgama_ofsteps(thisdir,label)
load(thisdir,[label '_replay_seqtimes'],[label '_replay_stnd'],'slowgamma_localspikephase','other_cells','hp_cells','hpinterneurons')
eval(['seqtimes = ' label '_replay_seqtimes;'])
eval(['Cand = ' label '_replay_stnd;'])
clear([label '_seqtimes_btwn'])
clear(... |
% In this demo we run 4 algorithms in a noisy experiment when the block partition is unknown.
clear;
n = 500; % signal length
N = 200; % sensor measurement number
K = 50; % sparsity (nonzero elements in the signal)
q = 6; % group number (number of nonzero blocks)
SNR = 15; % Signal-to-nois... |
function metadata = import_parseMetadata(data, options)
% OME
% See: http://www.openmicroscopy.org/site/support/bio-formats4/developers/matlab-dev.html
% PT: Check later if this is actually useful
if options.loadFromTIFF
% OME metadata is a standardized metadata structure,
% which... |
%Q13
clear; close all;
t = [-4 -3 -2 -1 0 1 2 3 4]';
f1 = [0 0 0 0 0.5 1 1 1 1]';
f2 = [0 0.0025 0.0180 0.1192 0.5000 0.8808 0.9820 0.9975 1]';
Dx = CreateDerivativeOperators1D(length(t));
figure(1);
subplot(221);
plot(t, abs(Dx*f1));
xlabel('x');
title(['||Dx*f1(x)||_1 = ' num2str(sum(abs(Dx*f1)))]);
... |
function single_plane = planedct(direction_matrix)
% function single_plane = planedct(direction_matrix)
%
% PLANEDCT detects if the direction matrix includes a single horizontal
% plane. Then 'single_plane' includes the string 'elev', else the
% string 'none' is returned.
%
% (c) Lehrstuhl fu... |
function y = distance(x1,x2)
y = (x1(1)-x2(1))^2+(x1(2)-x2(2))^2+(x1(3)-x2(3))^2;
end |
% %this is to calculate the power in different faces
importdata;
shape;
diver200=zeros(Nx,Ny);
diver400=zeros(Nx,Ny);
diver600=zeros(Nx,Ny);
diver800=zeros(Nx,Ny);
diver1000=zeros(Nx,Ny);
diver1200=zeros(Nx,Ny);
diver1300=zeros(Nx,Ny);
diver1400=zeros(Nx,Ny);
diver1500=zeros(Nx,Ny);
diver1600=zeros(Nx,Ny);
diver1700=... |
clc
clear all
close all
global Data_save;
%%
parameters;
%%
start_time = 0;
end_time = 4;
dt = 0.005;
times = start_time : dt : end_time;
%%
x = [0;0;10];
xdot = zeros(3,1);
angles = zeros(3,1);
% anglesdot = zeros(3,1);
deviation = 300;
anglesdot = deg2rad(2 * deviation * rand(3,1) - deviation);... |
function hos = bwosSM(data)
% BWOSSM, Terrell's OverSmoothed BandWidth, for 1-d kernel density estimation
% Steve Marron's matlab function
% This is the bandwidth, which maximizes the MISE asymptotically
% optimal representation, modulo "scale", chosen here to
% be "standard deviation".
% Assum... |
function s = any_simil( mat1, mat2, param )
%s = any_simil( mat1, mat2, param )
% Compute a similarity between all the examples of
% mat1 (dim p, n) and mat2 (dim m, m) and returns a matric (p, m)
% Isabelle Guyon -- isabelle@clopinet.com -- May 2012
if nargin<3, param='euclid2'; end
if strcmp(param, 'euclid') || st... |
function plot_time_fft(t, y, varargin)
%PLOT_FFT Plot the power frequency sprectrum of a given signal
% Expected arguments:
% t - The time vector belonging to signal in [s]
% y - The signal under consideration
%
% Note that the plot only includes frequencies up to f_s/2 where f_s
% is the sampling ... |
function handles = guiSF(SFtab,width,height,left1,left2,prepareSF)
% Left panel with a reconstructin parameters SF ###################
uicontrol('Parent',SFtab,'Style','text',...
'String','SF it... |
function FINAL=process(Y,structel,elem,ITER)
d=length(Y);
for j=1:ITER
for i=1:d
CLEAN{i}=preprocessing(Y{i},0.09,structel);
end
%PROCESSED=postprocessing(Y,0.5,elem);
end
%FINAL=PROCESSED;
FINAL=CLEAN;
end
|
function [ Hgw_index ] = Find_Hgw_Index( NLL_GPS_Hgw_pt,NLL_GPS)
pos_error = zeros(length(NLL_GPS),1);
for n = 1:length(NLL_GPS)
pos_err_1(n,1) = sqrt(((NLL_GPS(n,1) - NLL_GPS_Hgw_pt(1,1))*...
(110.575*1000))^2) + sqrt(((NLL_GPS(n,2) - NLL_GPS_Hgw_pt(1,2))...
*(82.4102*1000))^2);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.