text stringlengths 8 6.12M |
|---|
clear;clc;
asset_ret=readtable('dataset2_monthlyreturns.xlsx','Sheet','%ret');
asset_ret=table2array(asset_ret);
[p, n_assets]=size(asset_ret);
f=readtable('dataset2_monthlyreturns.xlsx','Sheet','f%ret');
f=table2array(f);
[p,m_factors]=size(f);
%---------remove later, for sake of generating F and D ------... |
function sensor_mean_readings = calibrateIR(h,tests_count,sensor_id)
% CALIBRATEIR Runs a calibration sequence for the infrared sensors given number of times. As a result returns the mean readings from the trials
% and the standart deviation for the specified sensor.
%
% sensor_mean_readings = CALIBRATEIR(h,tests_coun... |
function V_batt = SPM_17(theta, data, SOC0)
%% Parameters
% Universal Parameters
R = 8.314;
F = 96485;
T = 298;
% Design parameters
Ln = theta(1);
Lp = theta(2);
Rn = theta(3);
Rp = theta(4);
Acell = theta(5);
eps_sn = theta(11);
eps_sp = theta(12);
Asn = 3*eps_sn/Rn;
Asp = 3*eps_sp/Rp;
% Concentration Parameters
... |
%% Systems of linear equations
% At its heart, the subject of linear algebra is concerned with how to
% solve the seemingly simple equation:
%
% $${\bf{A}}x=b$,
% where $${\bf{A}}$ is a matrix and $$x$ and $$b$ are vectors.
%%
%
% This might seem surprising, but this problem is right at the heart of
% almost a... |
function [abbreviatedNames, timestepNames, timesteps] = ...
collectModelProperties(modelResults)
modelResults = collapseResults(modelResults);
modelPrefixes = {'rnn', 'hop', 'rnn4', 'rnn1', 'caffenet_relu7-libsvm'};
typeAbbreviations = getModelLabels();
uniqueNames = sort(unique(modelResults.name));
modelOccurrence... |
function [s,fit,a] = kalmanspeedestc(p,Aw,fs,th)
%
% [s,fit] = kalmanspeedestc(p,Aw,fs,th)
% EXPERIMENTAL !!
% Estimate the swim speed of a whale with given depth profile, p, in m, and
% accelerometer vector Aw, sampled at rate fs, Hz. th is a censoring threshold
% in g. Process is a 2-state Ka... |
function data=filter_array(data,datafield,range)
L=datafield>=range(1)&datafield<=range(2);
data=data(L);
end |
function AllFragIons=compileFrags(protProd,glyBion,glyYion,pepBion,pepCion,pepIion,pepYion,pepZion)
%COMPILEFRAGS: Generate 'AllFragIons' by appending the structures protProd, glyBion,
% glyion, pepBion, pepCion, pepIion, pepYion and pepZion.
%
% Syntax:
% AllFragIons=compileFrags(protProd,glyBion,glyYion,pepBion... |
function track_comp(K,mu,gam,tf)
dt = 1e-2;
[xtracknv,ztracknv] = waves_over_vortices_tracks(K,mu,gam,0,tf,dt);
[xtrackwk,ztrackwk] = waves_over_vortices_tracks(K,mu,gam,.02,tf,dt);
[xtrackst,ztrackst] = waves_over_vortices_tracks(K,mu,gam,.2,tf,dt);
figure(1)
hold on
plot(xtracknv(1,:),ztracknv(1,:),'k--',xtrackwk... |
function res = control_system(ref,theta_ref,nr)
global odometry;
global x_real;
global y_real;
global number
nr = number;
%tuned parameters
K1 = 0.025;
K2 = 0.5;
K3 = 0.05;
v_max=50;
w_offset = 0;
x=x_real;
y=y_real;
if odometry(3)<= 2048
theta = ((2*pi) / 4096) * odometry(3);
else
theta = (((2*pi) / 4096) ... |
addpath (genpath(pwd)); |
% File: Example1_2.m for Example 1-2
clear;
% Apply Eq (1-8)to a Binary problem. Therefore m=2 in Eq (1-8)
% Examine how the entropy changes as a function of P1.
i = 0;
for (loop = 0:0.05:1)
i = i+1;
P1(i) = loop;
if P1(i) == 0 | P1(i) == 1
H(i) = 0;
else
H(i) = -1/log(2) * (P1(i)*log(P1(i)) + ... |
function [idx, C, D, DX] = diffusion_kmeans(X, k, phi0, Niter, epsilon)
% DIFFUSION_KMEANS diffusion K-means clustering
% function [idx, C, D, DX] = diffusion_kmeans(X, k, phi0, Niter, epsilon)
%
% Input:
% X(n,d) --- diffusion coords (right eigenvecs rescaled with
% eigenvals, skip first trivia... |
function score = scoreFeatures(x, y)
score = zeros(size(x, 1), size(x, 2));
|
function [S,C,SSE,varexpl]=PCHAkernel(K,noc,I,U,delta,varargin)
% Kernel Principal Convex Hull Analysis (PCHA) / Kernel Archetypal Analysis
%
% Written by Morten Mørup
%
% Usage:
% [S,C,SSE,varexpl]=PCHAkernel(K,noc,I,U,delta,opts)
%
% Input:
% K Kernel Matrix
% noc number of components
% I ... |
function func = objP( variable,lamda,Nsi,Nid,Nsd,M,SNR )
%多基站,多中继的适用于遗传算法的目标函数
% Detailed explanation goes here
%-------SR,RD链路中断概率(链路2通)--------------------%
a=zeros(1,M);
b=zeros(1,M);
E=zeros(1,M);
E_sd=zeros(1,1);
E_sr=zeros(1,M);
%sum1=zeros(40,M);
func=ones(1,1);
func_1=ones(1,1);
func_sr=ones(1,1);
%sum2=zeros... |
% [x,P] = rndddgp(K,n,U,s)
% generate a random realization in [-U,U] in R^K and a
% partial nxn euclidean distance matrix P with given density s in [0,1],
% guaranteed to be a DDGP instance
function [x,P] = rndddgp(K,n,U,s)
x = 2*U*(rand(K,n) + (-0.5)*ones(K,n));
P = eucldist(x);
for i = K+1 : n
count... |
% K-MEANS - SCRIPT
% Load an example dataset (X will be loaded to the environment)
load('ex7data2.mat');
% Select an initial set of centroids (K = 3 Centroids)
K = 3;
initial_centroids = [3 3; 6 2; 8 5];
% Find the closest centroids for the examples using the initial_centroids
idx = findClosestCentroids(X, initial_... |
function [B,Wstar,T,P,Q,W,R2X,R2Y]=plsnipals(X,Y,lv)
% Function to predict using PLS regression using the NIPALS algorithm.
%% Copyright
% Carlos Alberto Duran-Villalobos June 2020 University of Manchester.
% Data provided by UCL and Sutro
% Copyright (c) Future Targeted Healthcare Manufacturing Hub
% Reference: "Multi... |
function handles = osc_get_targetparameters(osc_message,handles)
% OSC_GET_TARGETPARAMETERS - Get target analysis parameters
%
% Usage: handles = osc_get_targetparameters(osc_message,handles)
%
% Check that a session is opened
if isempty(handles.session)
error('orchidee:osc:osc_get_targetparameters:UexpectedMessa... |
function [features] = get_features(clean_data,fs)
%
% get_features_release.m
%
% Instructions: Write a function to calculate features.
% Please create 4 OR MORE different features for each channel.
% Some of these features can be of the same type (for example,
% ... |
function [NMRsp_dp,phc0,phc1]=ACME(NMRsp,phcf)
% Chen Li's automatic spectrum phasing function
%
% [NMRsp_dp,phc0,phc1]=ACME(NMRsp,phcf)
%
% Original function by Chen Li
%
% input NMRsp - NMR spectral data (complex row vector)
% phcf - initial estimates of phc0 and phc1, usually phcf is set ... |
function [stats, meanRanks] = multCompStatsTable(data, varargin)
% statsTable = multCompStatsTable
% Creates and prints table with multicomparison statistics, such
% as F_F values and mean ranks from Friedman or Iman-Davenport test.
%
% Input:
% data - cell array of data
% settings - pairs of property (string... |
clearvars
close all
% Connection capacity (Gb/s)
ul_speed = 2;
dl_speed = 2;
% Data parameters (Mb/s)
ul_rate = 603.2;
dl_rate = 279.2;
frequency = 30;
% Processor speed in Tflops
processor_speed = 0.01 : 0.01 : 3;
% Neural network complexity (Gflop)
complexities = [24, 8];
delay_local = zeros(2, length(processor_... |
% ------------------------------------------------------------------------
% Jordi Pont-Tuset - http://jponttuset.github.io/
% April 2016
% ------------------------------------------------------------------------
% This file is part of the DAVIS package presented in:
% Federico Perazzi, Jordi Pont-Tuset, Brian McWi... |
function [out1, out2]= greaterthan2(in1,in2,in3)
% Modify the above code so that it now takes three inputs, 2 vectors (in 1 and in 2)
% and a number (in 3). and should output 2 vectors (out 1 and out 2.) It should find
% all the elements in the first vector (in1) that are
% greater than the number (in 3) and out... |
% scan.m
%
% Scan the path provided for data files and call the reporting function
% when they are found. This script is intended to be used with the IRQ
% reporting and box plot generation.
function [data, labels] = scan(path, report_function)
files = dir(path);
data = {}; labels = {};
for ndx = 1:lengt... |
function rateValue = iNaThresholdDetectorSubtracted(v, thr, a, q)
% This is taken from the `trap0` of the original code for the following paper:
%
% - Reference: "Krishnan GP, Chauvette S, Shamie I, Soltani S, Timofeev I, Cash
% SS, et al. Cellular and neurochemical basis of sleep stages in the
% thalamocortica... |
function [B, k2] = pa_spk_shiftmatc(A, k1)
% B = IC_SHIFTMATC(A,K)
%
% Shift matrix peak to centre
%
% Huib Versnel/John van Opstal
% Copied 2012 Marc van Wanrooij
% e-mail: marcvanwanrooij@neural-code.com
lcol = size(A,1);
k2 = mod(k1,lcol);
B = [A(end-k2+1:end,:); A(1:end-k2,:)];
|
tic
format long g
clc ;
clear ;
close all ;
addpath Functions
c = 299792458 ; % 光速(m/s)
lambda = c /(1575.42*10^6) ;
Data = 0116 ;
obs_flag = 1 ; % 0=epr, 1=pr, 2=dsc, 3=csc
converge_time = 900 ;
initial_time = converge_time + 20 ;
smaller_th... |
function savevtkvector(mesh, X, Y, Z, filename)
% savevtkvector Save a 3-D vector array in VTK format
% savevtkvector(X,Y,Z,filename) saves a 3-D vector of any size to
% filename in VTK format. X, Y and Z should be arrays of the same
% size, each storing speeds in the a single Cartesian directions.
delX = ... |
%% =======================================================================%
% fill_holes.m %
%=========================================================================%
% Function: fill_holes %
% Author(s): ... |
function eventId = eventClassifier(acc, acc_fs, baro, baro_fs, temp1, temp1_fs, temp2, temp2_fs)
% input: acc: 4xN 2D-array (first column is the time stamps, columns 2-4 are the x,y,z acceleration measurements)
% acc_fs: acceleration sampling frequency (in Hz)
% baro: 2xN 2D-array (first column is... |
addpath RWTHMindstormsNXT;
%establish memory map to status.txt.
fstatus = memmapfile('status.txt', 'Writable', true, 'Format', 'int8');
wait = memmapfile('wait.txt', 'Writable', true, 'Format', 'int8');
u1 = memmapfile('u.txt', 'Writable', true, 'Format', 'int8');
fstatus.Data(2) = 49;
global fstatus
%open... |
function [mdvec, mdval, mdamp, mdcomp] = eof1d(x, neofs)
%
%
% inputs
% - x
% - neofs
%
% inputs
% -
% -
% -
%
%
%
% Variance explained by each mode is mdvar.^2 ./ sum(mdvar.^2).
%
% Olavo Badaro Marques, 03/Nov/2017.
%%
%%
[U, S, V] = svd(x, 'econ');
% Amplitudes:
mdamp = S * ... |
clear all, close all
try
matlabpool(8)
end
addpath('~/Dropbox/workonline/progs/matlab/gpml');
startup
sinc = @(x) sin(x)./x;
width = 30;
x = -width/2:.11:width/2;
y = sinc(x);
N = 20;
xsamp = width*(rand(N, 1)-.5);
ysamp = sinc(xsamp) + randn(N, 1)*.1;
[ww, ssigf] = meshgrid(.01:.25:6, .1:.1:3.4);
wwShape... |
function varargout = GUI(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_OpeningFcn, ...
'gui_OutputFcn', @GUI_OutputFcn, ...
'gui_LayoutFcn',... |
function [V] = vandermonde(x,degree)
%helper function to create a vandermonde matrix for me (im too lazY)
for i=1:size(x)
for j=0:degree
V(i,j+1) = x(i).^j;
end
end
end
|
function out = analysis__outcome_subtraction(obj)
sb = subtract_within(obj.only('self'), obj.only('both'), 'outcomes', 'selfMinusBoth');
on = subtract_within(obj.only('other'), obj.only('none'), 'outcomes', 'otherMinusNone');
out = [sb;on];
end |
function A = diff_ker(M,sigma)
l = zeros(2*M-1,1);
A = zeros(M,M);
for i=1:2*M-1
l(i)=exp( -abs(i-M)^2/sigma^2);
end
for i=1:M
A(:,i)=l(i:i+M-1);
end
A = rot90(A);
end |
function [note_volume] = noteVolume(transit_count,array_index)
%soundVolume returns a scalar magnitude (i.e volume) to correlate to the
% number of transit vehicles (transit_count) at a given time
% point(denoted by array_index).
% Example:
% [sound_volume] = soundVolume(transit_count,a... |
function fh = im_cube_slicer(im,lambda,s_factor,method)
%fh = im_cube_slicer(im,lambda,s_factor,method)
%
% Implementation of an image cube slicer + spectra visualizer for
% multi-channel images. The rectangle shown in the image view (left)
% illustrates the area corresponding to which data is averaged and
% visuali... |
fin_save=fopen('SaveAllDate.txt','w');
%获得全部节点坐标
fem_read=fopen('LIST ALL SELECTED NODES.txt','r');
counter=1;
node=[];
buff=fscanf(fem_read,'%s',1);
while ~feof(fem_read)
if(strcmp(buff,'THZX')==1) %NODE X Y Z THXY THYZ THZX 数据上第一行最后一个单词
while(strcmp(bu... |
% Transformiere die EE-Trajektorie ins Basis-KS des Roboters
% Die Roboter-Funktionen sind alle mit X in Basis-Koordinaten definiert.
%
% Eingabe:
% R
% Roboter-Klasse. Enthält Basis-Transformation des Roboters (T_W_0) sowie
% die vorgegebene Euler-Winkel-Konvention zur Orientierungsdarstellung.
% Traj_W
% Robot... |
clear; close all;
foldersNameExp = 'g*';
a=dir(foldersNameExp);
for i=1:size(a,1)
if a(i).isdir==1
[spec,sgnl] = getMat(a(i).name);
end
end
|
function [ranking]=rank_merge(individual, data)
%MERGE Merge two clusters in an individual
%
%mergeFName : name of the function used to assess pairs of clusters to merge. Possible values are: 'cor', 'over'
%mergeOpName : name of the operator that merge the clusters. Possible values are: 'simple'
global DEBUG;
[... |
load results;
figure;
hold on;
plot(rb(:,3), rb(:,2), 'k', 'LineWidth', 3);
plot(cf(:,3), cf(:,2), 'r', 'LineWidth', 3);
plot(cb(:,3), cb(:,2), 'g', 'LineWidth', 3);
plot(hy(:,3), hy(:,2), 'b', 'LineWidth', 3);
legend('RB', 'CF', 'CB', 'HY');
xlabel('Recall (%)', 'FontSize', 18);
ylabel('Precision (%)', ... |
function plt3(data)
plot3(1:length(data),real(data),imag(data),'.');
end
|
clearvars
clc
% e = y - T(n)
% delta w = e * [x1 x2]
% wb = wb + e
weight_function = @(w1,w2,wb,x,y) signum([w1, w2] * [x; y] + 1 * wb);
%another set of points
PositivePoints = horzcat ([-5; 1] ,[-6; -2], [0; -5], [3; -7], [4.5; 1.3]);
NegativePoints = horzcat ([-18; -0.76], [-12; -12], [-19; -10.5], [-17; -10.5], [-... |
clear all
close all
r = randn(10000, 1);
k1 = 0.9;
k2 = 0.5;
k3 = 0.05;
rnoise = r * k1;
hdl = load('handel');
y = hdl.y;
Y = y(1: 10000);
sound(Y + rnoise);
|
% process_qsos: run DLA detection algorithm on specified objects
% load redshifts/DLA flags from training release
prior_catalog = ...
load(sprintf('%s/catalog', processed_directory(training_release)));
if (ischar(prior_ind))
prior_ind = eval(prior_ind);
end
prior.z_qsos = prior_catalog.z_qsos(prior_ind);
pr... |
function [ ] = clearres( )
%CLEARRES Summary of this function goes here
% Detailed explanation goes here
global result;
result = [];
end
|
function [f,s] = is_planar(V,epsilon)
% IS_PLANAR Return whether the 3D mesh is planar
%
% [f,s] = is_planar(V)
% [f,s] = is_planar(V,epsilon)
%
% Inputs:
% V #V x 3 matrix of vertex coordinates
% epsilon optional parameter used as threshold for smallest eigen value of
% pca, {1e-10}
% Ou... |
trials = 10;
LP_MSE = zeros(trials, 1);
LSQ_MSE = zeros(trials, 1);
DB_NAME = '04-computer_activity';
load(['../uci-regression-data/' DB_NAME]);
for i=1:trials
data.x = xtrain{i}; data.y = ytrain{i};
MLM = MinimalLearningMachine(data, data);
yhLP = MLM.predict(xtest{i}, 'LP');
yhLSQ = MLM.predict(xtes... |
classdef T4Resolve
%% T4RESOLVE
% $Revision$
% was created 28-Feb-2016 12:20:59
% by jjlee,
% last modified $LastChangedDate$
% and checked into repository /Users/jjlee/Local/src/mlcvl/mlraichle/src/+mlraichle.
%% It was developed on Matlab 9.0.0.307022 (R2016a) Prerelease for MACI64.
properti... |
%% ffdDrag
% Get drag value of FFD deformation of RAE2822 foil
function [cD, cL, deformedFoil] = ffdDrag(deformation)
% deformation - [1X10] between 0 and 1 (0.5 == no deformation)
deformedFoil = ffdRaeY(deformation);
[cD, cL] = xfoilEvaluate(deformedFoil);
end |
%% Least Squares (sum of error squares) classifier
clc
dimensions = 41732;% 72259;
w = mse_classifier('/home/sasha/Desktop/icop/50K/filenames.xml.train.csv',dimensions);
%% Least Mean Squares (Widrow-Hoff) algorithm
clc
dimensions = 72259; %41732;
%rho=1:-0.1:0.1;
%rho=0.1:-0.01:0;
rho=10:-1:1;
%rho=100:-5:10;
for i=... |
fs = 1e2;
h = fir1(256,1e-9/fs);
x = [zeros(1,2*fs),ones(1,5*fs),zeros(1,4*fs)];
y1 = filtfilt(h,1,x);
[H,f] = freqz(h,1,1024,fs);
plot(f,abs(H));
h2=fir1(128,30/fs,'high');
y2 = filtfilt(h2,1,x);
v1 = exp(1j*pi*50/fs);
v = [v1 conj(v1)]; h3=poly(v);
H = freqz(h3); h3 = h3/max(abs(H));
n = .1*cos(2*pi*50/200*(1:length... |
% ASTROTIK by Francesco Santilli
%
% Usage: R = rotation(angles,axs)
% R = rotation(angles)
%
% where: angles(k) = rotation angle [rad]
% axs(k) = rotation axis (1,2,3) [3 1 3]
% R = rotation matrix [-]
function R = rotation(angles,axs)
if (nargin < 1) || (nargin > 2)
erro... |
% WIRE_MESH Construct a "wire" or "wireframe" or "strut" surface mesh, given a
% one-dimensional network of straight edges.
%
% [V,F] = wire_mesh(WV,WE)
% [V,F,J] = wire_mesh(WV,WE,'ParameterName',ParameterValue, ...)
%
% Inputs:
% WV #WV by 3 list of vertex positions
% WE #WE by 2 list of edge indices into WV
%... |
StoreVariables
Export
timeScale = imlook4d_time';
duration = imlook4d_duration';
activity = zeros( size(imlook4d_time))';
[file,path] = uiputfile( {...
'*.sif', 'Turku (blood/weight) (*.sif)' ...
}, ...
'Export times to sif file', 'TACT.sif');
[pathstr,name,ext] = fileparts(file); % T... |
function [ F, J, H ] = F( x )
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
F = [x(1)^2 + x(2)^2 - 2; exp(x(1)-1)+x(2)^3 - 2];
J = [2*x(1),2*x(2);exp(x(1)-1),3*x(2)^2];
H = [2,2;exp(x(1)-1),6*x(2)];
end
|
function a = alpham(v)
a = 0.1 * (v + 40) ./ (1 - exp(-(v + 40) / 10));
end |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% INPUT: Diameter in nm and an array of constants (which includes the )
% OUTPUT: Settling velocity of the charged particle
function Vts = Dp2Vts(Dp_nm,rho_p,K)
x=Dp_nm*1e-9*sqrt(rho_p/1000); %changing to [m]
for i=1:length(x)
Cc(i)=1... |
% Compute NMI between different solutions
load label_corr_norm
load label_corr_pca
load label_nmf_lf4
load label_nbs_lf4
load label_nbs_lf2
load label_nbs_lf3
load label_nbs_lf10
load patient_label
load data_pheno
for i = 1:length(patient_label)
if patient_label(i) == 0
patient_label(i) = 2;
end
end
... |
function make_coilset_bila_03_stelsym
import_coils_from_mgrid_input_format('make_plots', 1, 'coils_file_in', ...
'coils.bila_03', 'save_mat_data', 1, 'output_mat_filename', ...
'coilset_bila_03_stelsym', 'winding_factors', [1], ...
'coil_order', {'Mod'},'make_stellarator_symmetric', 1, ...
'coil_... |
function store = SignalObject__mean_across_pairs(obj, label1, label2, replacewith)
first = obj.only( label1 );
second = obj.only( label2 );
assert( count(first,1) == count(second,1), ...
'Unequal number of items in first and second objects' );
assert( all( [~isempty(first), ~isempty(second)] ), 'At least one obje... |
%% 目的:仿真实现肺部信号的解调
% By Luoshutu
clear; clc;
%% 设置起始信息
Start = 3;
Num = 1;
% figure;
% hold on;
for cir_map = Start:Start + Num -1
%% 参数设置
f0 = cir_map*(1e6);
% f0 = 7e6; % 换能器中心频率 [Hz]
fs = 100e6; % 仿真使用的采样频率
c = 1540; % 声速 [m/s]
lambda = c/f0; % 波长 [m]
prf ... |
function pc = construct_point_cloud(depth_ims, do_remove_plane, do_remove_pot, depth_thresholds, bounding_box)
% Constructs a point cloud from a set of depth images
is_first_plant = true;
is_first_scene = true;
pc_count = 0;
foreground_cutoff = depth_thresholds(1);
background_cut... |
wr=2*8000*tan(2*pi*2000/(2*8000));
wt=2*8000*tan(2*pi*1200/(2*8000));
%J-OMP
[N1, wn1]=buttord(wt,wr,0.5,40,'s')
[B1, A1]=butter(N1,wn1,'low','s');
[num1, den1]=bilinear(B1,A1,8000);
[h1, w]=freqz(num1,den1);
%M-OMP
[N2, wn2]=cheb1ord(wt,wr,0.5,40,'s')
[B2, A2]=cheby1(N2,0.5,wn2,'low','s');
[num2 ,den2]=bilinear(B2,A2,... |
function [INDEX_LIST3D_1 INDEX_LIST3D_2 INDEX_LIST3D_3 INDEX_LIST3D_4 INDEX_LIST3D_5 INDEX_LIST3D_6 INDEX_LIST3D_7 INDEX_LIST3D_8 slopex slopey slopez] = build_3Dinterp_indexarrays(X, Y, Z, DX,DY,DZ, x, y, z)
% should use identical increments for each scale
pindexx=zeros(length(x),1);
indexx=zeros(length(x),1);
slope... |
function [ ] = clearclpr( )
%CLEARCLPR Summary of this function goes here
% Detailed explanation goes here
global classes prpr;
classes = [];
prpr = [];
end
|
%art_advec_fitting_f.m written 2-2-18 by JTN to fit numerical model to
%artifical data from u_t+(g(x)u)_x=0.
function [q_ols,J_ols,q_autoreg,J_autoreg,phi1,phi2,num_it,num_it_auto] = autoreg_art_advec_fitting_f(xni,m,num_meth,IC_str,model_str,data_str)
simnum = 5;
lambda = 1/2;
%initial condition
... |
function [T,I,Y]=naivePerfusionResponsepotent1P2X4coop(ton,toff,Ttot)
ode=modelODEpotent1P2X4coop(ton,toff);
naive=zeros(21,1);
naive(1)=1;
setAuxiliarypotent1P2X4coop(naive);
[T,Y]=ode15s(ode,[0 Ttot],naive,odeset('NonNegative',1:21));
I=getTotalCurrentpotent1P2X4coop(Y);
end |
function h = circle(v,r,c,n)
%
% circle(v,r,n)
%
% Plot a circle
%
% v - center (either 2 or 3 dimensional vector)
% r - radius; default = 1
% c - color; default = white
% n - number of plot points; default = 20
%
% See also TRIANGLE
if nargin < 2, r = 1; end
if nargin < 3, c = 'w'; end
if nargin ... |
function [der] = d(f, x0, h)
temp = x0 + h;
h = temp - x0; % elimina la propagación de los errores debidos
% a la no exacta representación de h a la hora de
% evaluar en f
der = ((f(x0+h) - f(x0-h))./(2*h));
end |
function [ Srgb, Wrgb, Prgb, Sdep, Wdep, Pdep ] = RGBDGraphConstruct2( group_img_info, group_sup_info, Img_num )
% RGBD Graph 2017.12
% compute the feature (mean color in lab color space) for each superpixels
theta = 10;% (1/sigma^2)=10,sigma^2=0.1
alpha = 0.99;
Srgb = cell(Img_num,1);
Wrgb = cell(Img_num,1);
Prgb = ce... |
%% subTriCentre
% Below is a demonstration of the features of the |subTriCentre| function
%%
clear; close all; clc;
%%
% Plot settings
fig_color='w'; fig_colordef='white';
fontSize=10;
faceAlpha=1;
edgeColor=0.3*ones(1,3);
edgeWidth=1.5;
%% SPLITTING A SELECTION OF TRIANGLES
%%
% Building example pat... |
%% prep1_setParameters.m description
% In this file you are able to set parameter values to run the
% simulation(s) in the correct set-up.
% It contains no functions or files.
%% Parameters.
% Number of simulation runs.
nSimulations = 50;
% Coordination on or off. (for CNP)
coordination = 0;
% Communication on or... |
save(DataPath, name);
|
function [sndng] = IGRAimpf(input_file)
%IGRAimpf
%Function to import IGRA v1 files. Given a .dat file of
%soundings data, returns a structure ('sndng') which contains the following
%fields:
%valid_date_num - a MATLAB date vector
%year
%month
%day
%hour
%level_type - major level typ... |
function dist = getDistance(this,first_point,second_point)
if this.getNPoints < 2
dist = NaN(this.getNFrames,1);
return
end
if nargin < 2
first_point = 1;
end
if nargin < 3
second_point = 2;
end
if numel(first_point)>1 && numel(second_point)... |
function Randomize(obj,shuff)
% #mosttrivialmethodever
if(nargin>0)
rng('shuffle');
end
obj.c = obj.dist();
end |
function output = get_a_imu(self)
self.a_imu.topicName="tello/imu";
self.a_imu.yUnit="m/s^2";
self.a_imu.showName="a_{imu}";
self.a_imu.readFromSensor_Imu(self);
output = 1;
end |
close all
clc
name = [ "Ax" , "Ay" , "Pz" , "Wx" , "Wy" , "Vz" , "Px" , "Py" , "Vx" , "Vy" , "IA" , "IB" , "IC" , "Za" , "Zb" , "Zc" , "Zd" , "Ze" , "Zf" , "FA" , "FB" , "FC" , "VA" , "VB" , "VC"];
units= ["angle(rad)" ,"angle(rad)" , "position(m)" , "vitesse angulaire (rad/s)" , "vitesse angulaire (rad/s)" , "vit... |
% --------------------------------------------------------------------
% function processDynamic
%
% Technical note: PROCESSDYNAMIC assumes that specific Arbin test
% scripts have been executed to generate the input files.
% "makeMATfiles.m" converts the raw Excel data files into "MAT" format
% where the MAT files ha... |
clf;
D = load('expt2_results');
data = load('gp_data');
dim = size(D);
title ('For 3 classes; all hyps from same distribution; nfactor = 4');
xlabel ('Hyps mean');
ylabel (strcat(['Correct results out of ', int2str(size(data,1))]));
hold on;
errorbar(D(:,1), D(:,2), D(:,3), D(:,3));%, '-2;correct hyps;');
plot(D(:,1),... |
function [ W,H ] = conCMF( V,k,num_experiment)
tic
% initt = cputime;
[m,n]=size(V);
loop=1;
while loop<=10
if loop==1
Hinit=complex(randn(k,n), randn(k,n));H = Hinit;
Winit=complex(randn(n,k), randn(n,k));W=Winit;
tol=0.1;
else
W=(pinv(V)*V)*pinv(H);
end
VtV = V'*V;
... |
clear;
format long;
load SYSdata;
load SYSdata1;
load INITdata;
jj=0;
epsilon=0;
% interval=0.0125; %primal
interval=0.0415;
%这里的抽样是因为ode解出来的时间间隔较杂乱,如t=0, 0.1, 0.25, 0.3, 0.31...,
%这里抽样后可以使得时间在数值上(较为)均匀增加,(当然损失一些精度);而
%第五个文件是在此基础上在时间t的编号如t(jj)上再次采样,使得曲线不那么密,时间在数值
%上仍然均匀增加
sndsizey=size(y)
for ii=1:... |
%% This script is designed to look at saved images containing bullseyes as well as data files containing information about these images
% l.hamm@auckland.ac.nz and kmis...@aucklanduni.ac.nz
% specific to confidential data, tricky to know how it might be useful to others, or if others could collaborate
% Tidy up
clear... |
clear all;
clc;
close all;
F1=input('Enter the frequency of carrier=');
F2=input('Enter the frequency of pulse=');
A=3;%Amplitude
t=0:0.001:1;
x=A.*sin(2*pi*F1*t);%Carrier Sine wave
u=A/2.*square(2*pi*F2*t)+(A/2);%Square wave message
v=x.*u;
subplot(3,1,1);
plot(t,x);
xla... |
disp('Input Signal :::');
N=17;
N_irr=9;
x=[0 1 2 3 4 2 0 2 4 2 0 2 4 3 2 1 0];
x_sub=[0 2 4 0 4 0 4 2 0];
x_irr=[0 1 4 0 2 2 3 2 0];
%x=[1 1 1 1 1];
disp('Time :::');
t=[-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8];
t_sub=[-8 -6 -4 -2 0 2 4 6 8];
t_irr=[-8 -7 -4 -2 -1 1 5 6 8];
%t= [ 0 1 2 3 4];
myDiscreteFourierT ... |
clf
R=((x-x_ori).^2+ (y-y_ori).^2).^0.5;
a1=0.1;
a2=0.5;
a3=1;
sum1_low=sum(R<(dds-a1),2);
sum1_high=sum(R>(ddl+a1),2);
sum2_low=sum(R<(dds-a2),2);
sum2_high=sum(R>(ddl+a2),2);
sum3_low=sum(R<(dds-a3),2);
sum3_high=sum(R>(ddl+a3),2);
sum_21_low=sum1_low-sum2_low;
sum_21_high=sum1_high-sum2_high;
sum_... |
function t2 = T2()
%t2 - The pairs of spherical locations that the T2 affine group spans
d = ejovo.golden.path;
load(d, 'T2_CONSTANT')
t2 = T2_CONSTANT;
end |
%% ITeRATIVE OPTIMIZATION OF PARAMETERS
addpath('D:\CODE\MariusBox\SpikeDetection')
%
% find_kernel;
%%
load('D:\CODE\MariusBox\BigNeuralCode\results\driv1112.mat')
% load('D:\CODE\MariusBox\BigNeuralCode\results\driv1112F.mat')
cd D:\CODE\MariusBox\SpikeDetection
%
addpath('D:\CODE\MariusBox\SpikeDetection')
Params =... |
classdef Point < handle
% point object
properties
x
y
end
methods
function self = Point(x, y)
self.x = x;
self.y = y;
end
end
end
|
%% OPENMAS EVENT HANDLER (OMAS_eventHandler.m) %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This function is designed to handle an event occuring between objectA and
% objectB. An EVENT object is created at the current time, based on the two
% objects and the enumerated event type.
% Author: James A. Douthwaite 06/10/17
function... |
function bbox2 = bboxRelative2Real(bbox1, imsize)
bbox2 = CoordRelative2Real(reshape(bbox1,[2,2])',imsize);
bbox2 = bbox2';
bbox2 = bbox2(:)';
|
function [cyear cmonth cday chour cminute csec cmsec] = unix2matlab(tu)
tm = datenum('1970', 'yyyy') + tu / 864e5;
cyear = year(tm);
cmonth = month(tm);
cday = day(tm);
chour = hour(tm);
cminute = minute(tm);
tmp_sec = second(tm);
csec = fix(tmp_sec)
cmsec = (tmp_sec - csec)*1000;
en... |
function varargout = plot_error(varargin)
% PLOT_ERROR M-file for plot_error.fig
% PLOT_ERROR, by itself, creates a new PLOT_ERROR or raises the existing
% singleton*.
%
% H = PLOT_ERROR returns the handle to a new PLOT_ERROR or the handle to
% the existing singleton*.
%
% PLOT_ERROR('CALLBACK'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.