text stringlengths 8 6.12M |
|---|
clear all;
close all;
clc;
% Set parameters and initialise matrices
L=12; M=16; % lengths along x and y (transverse) directions
k=0.0; % |k| should be less that Pi
m0=-1; B=0.7; m2=-m0; m1=m2; A=1;
% initialising
N=L*M;
Rcutsq=1.5; % to find nearest neighbors
H=zeros(4*N,4*N);
eigenvalues=zeros(4*N,1);
coords=zeros(... |
function plot_sequence(teacherSequence, predictedSequence, nPoints, caption)
% PLOT_SEQUENCE plots each dimension from the both the teacherSequence and
% the sequence predicted by the network. The first nPoints values from each
% sequence are plotted.
%
% inputs:
% teacherSequence: matrix of size nDataPoints x nDimen... |
close all
clear
clc
load paths.txt
hold on
% 49 paths with 50 points each
% paths(1,1),paths(2,1) is (x,y) for t=0
start_1 = [0.8; 1.8];
start_2 = [2.2; 1.0];
start_3 = [2.7; 1.4];
dest = [8; 8];
axis([0 12.5 0 12.5])
% % Show all path starting points
% for i=1:2:size(paths,1)
% plot(paths(i,1),paths(i+1,1
% C... |
function [PCF, r, error] = RandomGeneratedUnNormalizedPCF (x_side_nm, y_side_nm, n_of_particles, average_diameter, r_step, n_of_generated_distributions, avoid_overlap, avoid_borders)
% disp('*** RandomGeneratedUnNormalizedPCF')
newl = '\n';
tab = '\t';
verbose = 1;
if verbose
fprintf(['GENER... |
% run for figs 2-3
clear all;
close all;
restoredefaultpath;
addpath ./1Dmodel
addpath ./utility/
for scen = 1:3
clearvars -except scen
if scen == 1
strscenario='default'
elseif scen == 2
strscenario='PSIonly'
elseif scen == 3
strscenario='MLDonly'
end
bgcparams=set... |
function loadConfigurationSettings(obj, varargin)
% loadConfigurationSettings Method to read Cloud Storage Account
% configuration settings from a file, by default named
% cloudstorageaccount.json or the name can be specified as an argument. If
% account configuration settings are not provided the locally hosted
% deve... |
function s = UpdateNeurons(s, w, time)
N = length(s);
p = length(s(1,:));
for l = 1:time
temp = zeros(N,p);
for k = 1:p
for i = 1:length(s)
for j = 1:length(s)
temp(i,k) = temp(i,k) + w(i,j)*s(j, k);
end
end
en... |
% [Tp_floor, T_floor] = get_nosie_floors(Tvolt, Tpcoef)
% Input:
% Tvolt: Raw temperature voltage time series
% Tcoef: Temperature calibration coefficient
% Tpcoef: Tp calibration coefficients
% Fs: sampling frequency
%
% Output:
% Tp_floor: spectral level floor
% T_floor... |
function [e, f, a] = test1(cleanup, level)
%TEST1 Check installation and report any missing or extra files that are
%installed. If you edit the .m files in MATLAB then you may get extra .asv
%temporary files.
%
% extra values returned here
% f is the extra files
% a is the missing files
% Thomas Ruark, 03/09/2010
... |
function [T] = mergeFactors(Factors)
nFactors = numel(Factors);
T = Factors{1};
for j = 2:nFactors
% Here, I use a example to illustrate the following steps
% T{1} = {A, B, D},
% Factors{j}{1} = {C, D, E, B},
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
... |
function[QP] = ForwardEM(~,param)
S.x=0; %x-coordinate receiver (m)
S.y=0; %y-coordinate receiver (m)
S.z=0; %z-coordinate receiver (m)
S.height=0.16; %Height of transmitter (m)
S.freq=9000; %Frequency (Hz)
S.mom=1; ... |
% Pulizia ambiente
clear
% Pulizia console
clc
% Pulizia figure
clf
% Impostazione dell'intervallo
x = -1:.1:1
% Funzioni
u = x.^2
v = x.^3
w = sin(x)
% Modalitá 1: HOLD ON
figure(1) % Prima finestra di disegno
hold on % Attiva HOLD
plot(x, u, 'r')
plot(x, v, 'g')
plot(x, w, 'b')
hold off
% Modalitá 2: MULTIPLOT
fi... |
%%% Computes the approximation of the Asian call option price using Monte
%%% Carlo and the lower bound of the asian call option as a control variate
function [MCstd, MCAsianArithPrice, MCConfInt,exec_time] = asianMC(S0, K, sigma, r, T, dt, n, M,alpha)
tic;
C = zeros(1,M);
for j = 1:M
S = [S0 zeros(1,n)];
fo... |
function p = predictOneVsAll(all_theta, X)
% PREDICT Predict the label for a trained one-vs-all classifier. The labels
% are in the range 1..K, where K = size(all_theta, 1).
% p = PREDICTONEVSALL(all_theta, X) will return a vector of predictions
% for each example in the matrix X. Note that X contains the ex... |
%{
This is a simple script to load the data set for the base radial
neural network.
This program analyzes a data set and makes the base radial neural
network learn, in order to get a good model at the end.
@ Elkin Javier Guerra Galenao - EIA University
%}
% Clean up the Matlab workspace
clear ; c... |
%generate_objects
n_meas = length(clusters_gr);
objects_2={}
for i=1:7278
%for i=1:n_meas
% i
objects_2 = update_objects(clusters_gr{i}, objects_2);
end
|
classdef tFourierTransform < matlab.unittest.TestCase
methods (Test)
function tFourier4Qubit(testCase)
n = 4;
randomRegister = randRegister(n);
qftMatrix = testCase.Fn(n);
expectedState = qftMatrix * randomRegister.getState();
% A... |
function net = resnet52_market_stn_res_fine()
if(~exist('net_align.mat'))
%------------main identification stream (Base Branch in paper)
%netStruct = load('/home/zzd/re_ID_gan_uts5/data/resnet52_2stream_drop0.9_baseline_batch32_gan24000_all/net_single.mat') ;
netStruct = load('/home/zzd/re_ID_gan_uts5/da... |
% daqSessionDeleteBackup.m deletes the backup file that was logging the
% data
global session % our global variable to store everything
if exist([session.dataFilename '_backup.txt'],'file')
delete([session.dataFilename '_backup.txt'])
end
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK #4.B %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Javier Lobato, created on 2018/04/15
close all; clear all; clc
% Mode of vision f... |
%This file helps to determine tau and delta for delta for CUSUM
data = dlmread('172.16.11.229-cont-135.csv');
dataSize = size(data);
n = data(2:end,2:end);
s = 25; %% detected through cross-corelation
sl1 = data(:,s);
f_z = find(sl1==0);
sl = sl1(1:f_z(1)-2150);
predata = 2000;
Mdl = arx(s25,[1]); % declare model
... |
% holdhalf 本脚本作用是由原网格参数,给出新网格的法向长度,计算新网格的jn和bkn,以保持前半段网格不发生变化
% 使用时需要先运行ct_setinput以输入旧网格参数,之后运行本程序,运行结束后得到新网格参数yl,bkn,jn
% yl2为新网格的法向长度
% 2015-06-14 lmy
%% 输入新法向长度
yl2=input('new yl= ');
%% 计算新网格参数
a=yl2/yl;
bb1=(sqrt(1+8*bkn)-3)/4;
bb2=(sqrt(1+4*a^2*bb1*(bb1+1))-1)/2;
x=a*bb1/bb2;
jn2=round(jn/x);
bkn2=((4*bb2+3)^2... |
function [Dc_hat_mod,alphac_hat_mod,Da_mod,KF_start_out,t_NoACK_mod,...
got_ACK] = JLSJumpEstimator(Dc_hat_mod,PI_C,Da_mod,alpha_c,...
alphac_hat_mod,PI_A,T_S,alpha_a,t_sim,TAU_M,TAU_C,TAU_A,TAU_AC,...
N_controls,N_HORIZON,t_NoACK_mod,N_ACKHISTORY,print_debug_JE)
% Jump estimator and prep for (lossy,delayed... |
function behav = CGNG_baseline_breakup(trialseq,id)
blocks = trialseq(end,id.block);
for ib = 1:blocks
blocktrials = trialseq(trialseq(:,id.block) == ib,:);
baseline_theta = CGNG_baseline_breakdown(blocktrials,id);
eval(['behav.block' num2str(ib) '= baseline_theta']);
... |
function obj = addCost(obj, label, nodes, cost_array)
% Add NLP object functions
%
%
% Parameters:
% label: the label name (column) of the cost @type char
% nodes: the node list of the variable @type rowvec
% cost_array: an array of structures that could be used to construct
% the NlpFun... |
function [phasespike,mu,unwrappedout,pval,pvalori,r] = op_ts_LFP_phase_CircStat2(LFP,tsLFP,ts,Fs)
% 输入LFP为输入的piece,tsLFP为piece截取的时间点
% Compute phase and amplitude using Hilbert transform
Numpiece = numel(LFP);
% PhaseOri = zeros(Numpiece,LFPlong);
phasespike = [];
unwrappedout = [];
for i_piece = 1 : Numpiece
if i... |
%-------------------------------------------------------------
% plik menu Metody matematyczne
%-------------------------------------------------------------
% Hubert Gawryś 2014-03-16
% Instytut Zarządzania w Budownictwie i Transporcie (L-3)
% Wydział Inżynierii Lądowej
% Politechnika Krakowska im. Tadeusza Ko... |
function phi = chain_featuremap(param, x, y)
% phi = chain_featuremap(param, x, y)
% computes the joint feature map phi(x,y). [param is ignored]
%
% It is important that the implementation is consistent with the chain_oracle.m!
% The model is a standard chain graph, with discrete unaries and pairwise features. Additio... |
% See notes April 12, 2018
clear;
% close all;
clc;
figure(1);
clf;
L = 7;
range = -(L-1) : (L-1);
[ell2, ell1] = ndgrid(range);
% Start by keeping only shifts such that all three signals overlap
M = (abs(ell2 - ell1) <= (L-1));
% Reject biased terms
M = M & (ell1 ~= 0);
M = M & (ell2 ~= 0);
M = M & (ell1 ~= ell2);... |
function plot_dec_regions(net, lh, uh, lv, uv, rh, rv)
%lh: lower horizontal
%lv: lower vertical
%uh: upper horizontal
%uv: upper vertical
bouH = lh:rh:uh;
bouV = lv:rv:uv;
[m1, m2] = meshgrid(bouH, bouV);
m = [m1(:) m2(:)]';
imagesc(bouH, bouV, reshape(net(m), size(m1)));
%colors
cmap = [0.9 0.9 1; 1 0.8 0.8];
colo... |
clear, clc, close all
% This is a FDN-based reverb test script.
% Input signal
au = audioinfo('Drums.wav');
##au = audioinfo('ElecGtr.wav');
switch au.NumChannels
case 1
[audio,Fs] = audioread(au.Filename);
case 2
[audio,Fs] = audioread(au.Filename); audio = mean(audio,2);
end
... |
% ML_Lab0_irisdataset
% Exploratory data analysis
% VV Aug 2018
clear all
close all
% READ DATASET
load my_iris_dataset.mat ;
x = irisInputs ;
y = irisTargets ;
% number of classes and features
[N_feat,n1] = size(x);
[N_class,n2] = size(y);
% number of samples
N_data = n1;
% labels
Labels = (1*y(1,:)+2*y(2,:)+3*y(3... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% filterDesignMain.m
%%%% CIC filter design, generate filer coee and test signal in file
%%%% that can be called by quartus.
%%%% ZHAOCHAO
%%%% ... |
% Script to exercise the DIRECT optimization Algorithm with ADVISOR.
%
% 1) initialize workspace
% 2) define the problem
% 3) run optimizer
% 4) save results
%
%Pass the small electric vehicle
input.init.saved_veh_file='sm_ev_auto_in';
[error,resp]=adv_no_gui('initialize',input);
% %Modify the vehicle Mass
% input.m... |
%DIVIDE Performs per-element division of two arrays or a scalar by an array
%
% dst = cv.divide(src1, src2)
% dst = cv.divide(src1, src2, 'OptionName',optionValue, ...)
%
% ## Input
% * __src1__ first input array.
% * __src2__ second input array of the same size and type as `src1`.
%
% ## Output
% * __dst__ outp... |
oldSigma=sigma;
for iMix=1:mixNum
sigma(:,:,iMix)=(sigma(:,:,iMix)+sigma(:,:,iMix)')/2;
end
for iMix=1:mixNum
gconst(iMix)=log(w(iMix))-l/2*log(2*pi)-0.5*log(det(sigma(:,:,iMix)));
invSigma(:,:,iMix)=inv( sigma(:,:,iMix) );
end
preProb=liklihoodProb/numOfSeg;
curProb=0;
fprintf(1,'initialProb %f\n',preProb... |
function [results] = mil_kNN( data, par )
% bags: name inst_name inst_label instace label
X = data.X;
y = data.y;
bag_dist_type = par.bag_dist_type; % 'max' or 'min'
inst_dist_type = par.inst_dist_type; % 'euclidean' or 'cosine'
num_ref = par.num_neighbor; % number of neighbors
rank_citer = par.... |
function config = guiConfig()
configF = figure('Name','Config',...
'NumberTitle','off','units',...
'normalized','outerposition',[0 0.2 0.4 0.8]);
set(configF,'ToolBar','none','MenuBar','none');
uicontrol('Parent',leftPanelData,'Style','text',...
'String','Detector pixel size, [... |
function [M1,M2,M3,M4,M5,M6,M7,M8,M9,X,count, r_pack]=Max_Energy_Nodes(S,n)
x(1)=0; x(2)=0; x(3)=0; x(4)=0; x(5)=0; x(6)=0; x(7)=0; x(8)=0; x(9)=0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Eelec=Etx=Erx
ETX=50*0.0000000001;
%ETX=50*0.000000001;
ERX=50*0.00000000001;
%ERX=50*0.000000000001;
%Transmit Amplifier types
E... |
function n = dataSplit(filename)
% tells from where to where the data has to split for anylizing
filename = '../../data/raw/behaviour.csv';
obsIDs = sortObsIDs(filename);
data3 = FileToCells('../../data/accelerometer_supervised/acc_supervised.csv',',');
superIDs = str2double(data3(:,1))
i = 1;
n = zeros(leng... |
function event = NewEvent(time, passenger_segment)
% =========================================================================
%
% DESCRIPTION
%
% usage: event = NewEvent(time, passenger_segment)
%
% Generates a "passenger_segment" event that occurred at "time"
%
% --------------------------------------------... |
cwd=pwd;
ndcells = nptdata('SessionsFile','longmoviesessions.txt');
clist=get(ndcells,'SessionDirs')';
num_sessions=size(clist,1);
SS=[];
for a=1:num_sessions
cd(clist{a});
%WriteGroupMUAFiles;
%StimInfo('auto','redo','save');
S=ProcessSession(sparsity,'auto','redo','Rate','ISpikes');
SS=[SS;S.data.... |
function carte_distance = initiate_carte_distance(list_coord_ville, coord_villes)
% Cette fonction renvoie la carte des distances des villes entre elles pour
% accélerer le calcul de la distance totale d'un chemin
nb_ville = size(list_coord_ville, 2);
carte_distance = zeros(nb_ville);
for k=1:nb_ville
for j=1:nb... |
% Algunos valores para probar:
%
% f = 0.1, 0.5, ...
% s = 0, ...
% [px, py] = [0.5, 0.5], ...
% theta_x = pi/2; %-3*pi/4;
% theta_y = 0;
% theta_z = 0; %pi/4;%0;
% C = [3 10 3]'; % enfrentado
% C = [5 10 5]'; % de costado
% f -> Distancia focal (e.g. 0.1, 1.5, etc...)
% s -> Skewness (e.g. 0)
% px, py -> Punto princi... |
function varargout = NetworkSimulator(varargin)
% NETWORKSIMULATOR MATLAB code for NetworkSimulator.fig
% NETWORKSIMULATOR, by itself, creates a new NETWORKSIMULATOR or raises the existing
% singleton*.
%
% H = NETWORKSIMULATOR returns the handle to a new NETWORKSIMULATOR or the handle to
% the exis... |
function C=SuperShape2D(N,p,vis)
% Generate contour of a 2D shape using the super formula
% R(t,p)=(abs(cos(m*t/4)/a).^qa + abs(sin(m*t/4)/b).^qb).^(-1/q)
% parameterized by t and p.
%
% INPUT:
% - N : number of points. N=100 is default.
% - p : shape parameters, p=[a b m q qa qb]. Default setting is
% ... |
function gran = mtime2airs_gran(mtime)
% function gran = mtime2airs_gran(mtime)
%
% Compute the matching AIRS L1B granule for a givem matlab time,
% accurate to 1/1000th of 6 minutes (granule size) - which is 0.36s.
% This is necessary because of innacurate decimal matlab times
% representing precise time frac... |
function dydt = quadcopter_ode(t,y,u)
[H,Ts,drone1_info, drone2_info] = drones_info;
[mass,inertia_moment,arm_moment,gravitational_acceleration] = parameters;
%% Unpack the state and input vectors
%states drone 1
position_x_d1= y(1);
position_z_d1= y(2);
pitch_d1= y(3);
velocity_x_d1= y(4);
velocity_z_d1= y(5);
vel... |
function [amps,sigmas,profiles,grids] = gather_data_fit(parent, parameters)
% input: parent - app for console output, parameters - fitting parameters
% output: amps - amplitudes of diffusion images, sigmas - sigma values of
% diffusion images, profiles - y values of diffusion images, grids - x
% values of diffusi... |
function [ Vg ] = assessGaugeInterpMatrix( obj )
Vg = cell(obj.Ng, 1);
for n = 1 : obj.Ng
cellId = obj.gaugeCell(n);
m = obj.gaugeMesh(n);
mesh = obj.phys.meshUnion(m);
if (mesh.cell.type == enumStdCell.Tri)
[rd, sd] = accessTriLocalCoor( mesh, obj.xg(n), obj.yg(n),... |
clear all
addpath(fullfile('~/workspace/relative_pose/forms', 'helpers/combinator_update/combinator'));
addpath(fullfile('~/workspace/relative_pose/forms', 'probs'));
cd('~/workspace/gaps/');
setpath;
cd('~/workspace/Automatic-Generator/');
setpaths;
prob_fn = @prob_pc_relpose_3prast0_sir2;
prob_fn = @prob_pc_relpose_... |
function [y,zi] = multi_OSC(f0,fs,N,wf,zi)
%%
% Input:
%f0 - fundamental frequency from the note
% fs - sampling frequency
% N - length of the time vector t
% zi - matrix that stores the previous values of the output.(3 x 2) ( 1strow - Oscillator, 2nd row - lowpass filter, 3rd row - sawtooth waveform )
% wf - integer ... |
% % Ex 1: load poiss.mat.
% Let the discrete random variable $X$ be the number of customers visiting
% ABC Bank in a hour. We know that $X ~ Poiss(lambda).
% The poiss.mat stores such information: 1000 records.
% 1.1) Estimate lambda;
% 1.2) Based on the computed lambda, randomly generate 500 data samples from
% Poi... |
function [X_out,N_out,fvalopt]=piMF(C_RV,S_set,R,A,K,Dia,W_in)
%%%% piMF provides the extents of reactions (X) and reaction network (N)
%%%%% Inputs %%%%%
% C_RV: n X m dimensional reaction variants concentration matrix
% S_set: Set of integer the stoichiometric matrix can take as a vector from
% the lowest to the... |
clear
clc
close all
%tau = 3.17008; % periodic
tau = 3.17009; %
tau2 = 3.16; %
sol = dde23(@LDDE,tau, 52,[1, 9000]);
sol2 = dde23(@LDDE,tau2, 52,[1, 9000]);
figure('position', [100 200 860 280])
subplot(121)
tint = linspace(1, 9000, 1000);
yint = deval(sol, tint);
plot(tint(1:10:600), yint(1:10:600), 'b-',... |
image_folder = 'G:\javaAgaintry\training_tp';
filenames = dir(fullfile(image_folder, '*.png')); % read all images with specified extention, its jpg in our case
total_images = numel(filenames); % count total number of photos present in that folder
Resultados1='F:\Java_Dataset\All107_images_of_interest\training... |
function [PC_back,intmem_back,cycle_back,idatax_back]=LCALLaddr16(PC,intmem,promem,cycle,idatax)
intmem_back=intmem;
idatax_back=idatax;
addr1=promem(PC+1,1);
addr2=promem(PC+2,1);
PC=PC+2;%jump will add 1
%load sp
SP=intmem(130,1);
%%%%%%
SP=SP+1;
% if(SP<128)
% intmem_b... |
classdef RFSignal < Ray3D
%RFSignal RF Signal Path
% 3D representation of an RF Signal
properties
scale = 1; % (m/pixel)
end
methods
function obj=RFSignal(scaleIn, originENU, azIn, elIn)
%RFSignal Constructor for RF Signal
% Input: ... |
function [w]=rand_init(X,m,sed)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FUNCTION (auxiliary)
% [w]=rand_init(X,m,sed)
% This function chooses randomly m vectors from the smallest hyperrectangular
% whose edges are parallel to the axes and contains all the vectors of
% a given data... |
function [x,s] = fun_SPI_R_SC(kernels,patterns, y,signal, rho_0,rho_factor,rho_max,maxinter_in,...
maxiter_out,lambda,verbose)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Inputs:
% kernels: convolutional filters (patch * patch * numbers)
% patterns: illumination patterns (pixe... |
%Nhom 1
%53
%Pham Ba Tung
%B15DCDT221
I = imread('peppers.jpg');
Ihsv = rgb2gray(I);
Ir = zeros(size(I,1),size(I,2),3);
for i=1:size(I,1)
for j=1:size(I,2)
if( (I(i,j) > I(14,221) - 20) && I(i,j) < I(14,221)+20)
Ir(i,j,:) = [255,255,255];
end;
end;
end;
Irf=uint8(Ir);
%Ik=double... |
% Balanced Clustering with Leas Square Regression
% Main function
close all;
clear all;
globals;
%% initialization
display('Initializing data...');
initialization(data, tmp_dir, infRes);
load([tmp_dir 'init.mat']);
[d,n] = size(X);
StartInd = randsrc(n,1,1:c); Y0 = TransformL(StartInd, c); save([tmp_dir 'Y0'], '... |
clear all
close all
clc
addpath(genpath('./libs'))
openR;
% evalR('install.packages("glasso")')
evalR('library("glasso",lib.loc="C:/Users/matineh/myFiles/projects/TBI/graphical_model/libs/")')
measurementType = 'fa';
subjectType = 'hs';
HS = readTbiPdf(measurementType, subjectType);
subjectType = 'nc';
NC = readTb... |
function dXdt = f(t, X)
x = X(1);
y = X(2);
vx = X(3)
vy = X(4);
ax = fx(t, x, y, vx, vy)
ay = fy(t, x, y, vx, vy)
dXdt = [vx; vy; ax; ay];
end
function a = fx(t, x, y, vx, vy)
a = 0
end
function a = fy(t, x, y, vx, vy)
a = -9.8
end
|
clear all;
close all;
addpath(genpath('./chipod_gust/software/'));
% find ganges on computer (This assumes you operate on ganges)
% if you are not on ganges set path2ganges manually
path2ganges = get_ganges_path;
path2database = [path2ganges '/work/database/omg.sqlite'];
%_____________________get info from... |
function rot_q8()
%% SETUP:
xunits = "rad";
DOF = 2; % Number of degrees of freedom in the system.
test = 1;
while test <= 5
disp("Test " + test + " . . .");
response = input('Skip this test? Y/N', 's');
if isempty(response) || upper(response(1)) == 'Y'
test ... |
function monitor_book_risk_txt( obj, S_low, S_high )
% multi book的总体监控与txt输出
% monitor_book_risk_txt( obj, S_low, S_high )
% TODO: 加入printtype
nCount = obj.optstraddletrading_multi.Count;
if nCount == 0
return;
end
if ~exist('S_low', 'var')
S_low = 2.15;
end
if ~exist('S_high', 'var')
S_high = 2.5;
end
%... |
function gout = Ggen(shape,G,r,f,gap,dt);
% G in G/cm
% r raise time, in ms
% flat time, in ms
% gap before, after and between gradients, in ms
% dt in us
% Jia Guo, 2011@ucsd
dt = dt*1e-6; % convert temporal resolution from us to s
% convert ms to s
r = r/1000;
f = f/1000;
gap = gap/1000; % pad with 0 a... |
%% Ryan Fahrenkrug
%MECH 105
%Homework 18
%11/3/2017
clc
clear
close all
%% Initialization
h=[140:1:149]'; % Time of Fermentation [h]
% Carbon Dioxide Evolution Rate [g/h]
cde=[15.72 15.53 15.19 16.56 16.21 17.39 17.36 17.42 17.60 17.75]';
% Oxygen Uptake Rate [g/h]
our=[15.49 16.16 15.35 15.13 14.20 14.23 14.29 12.7... |
files = dir(fullfile('C:\\Users\\Haotian\\Desktop\\datalabel','*.png'));
lengthFiles = length(files);
s=1;
for k = 1:lengthFiles;
imglabel = imread(strcat('C:\Users\Haotian\Desktop\datalabel\',files(k).name));%文件所在路径
% A=sparse(img)
imshow(imglabel)
% pause(1)
for i=1:512;
for j=1:512
... |
function p = predict(Theta1, Theta2, X)
%PREDICT Predict the label of an input given a trained neural network
% p = PREDICT(Theta1, Theta2, X) outputs the predicted label of X given the
% trained weights of a neural network (Theta1, Theta2)
% Useful values
m = size(X, 1);
num_labels = size(Theta2, 1);
% You need ... |
clc
clear all
x0 = [2 1 0 0];
v0 = [0 1 0];
eta0 = [1 0 2 1 0 2];
x_hat0 = [3 1 0 0];
x_0 = [x0 v0 eta0 x_hat0]';
tspan = [0 20];
[t,X] = ode45(@canonical, tspan, x_0);
figure
plot(t, X(:,1)-X(:,5), 'b', 'LineWidth',1.5);
hold on
plot(t, X(:,2), 'r', 'LineWidth',1.5);
title('Tracking error e(t)'... |
function cora_tt_param_experiments()
HA = two_tanks_ha();
options.enclosureEnables = [1];
options.guardIntersect = 'polytope';
Zdelta = [0.5;0];
% options
Zcenter = [2;1];
options.R0 = zonotope([Zcenter,diag(Zdelta)]); %initial state for reachability analysis
options.x0 = center(options.R0); %initial state for simula... |
function perf = marginSummary(perf)
% perf = marginSummary( perf)
% if iscategorical(response)
% response = removecats(response);
% end
mTbl = table(perf.response, perf.margin, 'VariableNames', {'Class', 'Margin'});
statvars ={'mean','std', 'min', 'max','median'};
mgnTbl = groupsummary(mTbl,"Class",statvars,... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% berechne reduzierten Beobachter
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% führe zuerst calc_regler_polbereichsvorgabe aus um die benötigten
% Parameter in den Workspace zu laden
%% berechne Systemmatrizen
sys = system;
sys.L = system.currL;
[matA_g, matB_g, ~, ~, ~] = ca... |
clear all; close all; clc
%% inputs
Slope=1000; % Stiffness
Strength=0.1; % interfacial strength
Eng=0.005; % Fracture energy
Ratio=0.3; % Trapezoid shape related ratio
%% Calcilation of 3 dels (separation)
dp=[]; ds=[]; Dp=[]; Ds=[]; D=[]; ss=[];
c=Slope;
s=Strength;
Gc=Eng;
r=Ratio;
d1=s/c;
d3=2*Gc/(s*(1+r));
d2=... |
function [kount,orbit]=orb(z)
phi=inline( 'z^2 -1.25');
fxpt1 = -0.724745;
fxpt2 = 1.72474;
zk = z;
iflag1=0;
iflag2=0;
kount =0;
orbit=ones(1,100);
while kount < 100 && abs(zk)<= 100 && iflag1<5 && iflag2< 5
kount =kount +1;
zk=phi(zk);
orbit(kount)=zk;
err1=abs(zk-fxpt1);
if err1 < 10^(... |
function [rate_all,numberspikes,imp,pulse_duration,pause_duration,delay,increments,currents,pf_all,threshold,avg_voltage,avg_voltage_trunc,pf_supra_iv]=...
fV_rate_leak_and_subtraction(module,recdate,cellnum,trials,points,sample_rate,shouldplotFV,noise)
% MODULE is the name of the rtxi module used (e.g. 'fi_curves'... |
function [ output ] = PN_sequence_gen( )
output = zeros(1,31);
register = ones(1,5);
for i = 1:length(output)
temp = double(xor(register(2),register(5)));
output(i) = register(5);
register(5) = register(4);
register(4) = register(3);
register(3) = register(2);
register(2) = register(1);
regi... |
function yv = dif_vals ( nd, xd, yd, nv, xv )
%*****************************************************************************80
%
%% DIF_VALS evaluates a divided difference polynomial at a set of points.
%
% Licensing:
%
% This code is distributed under the GNU LGPL license.
%
% Modified:
%
% 23 May 2011
%
% A... |
function CC_split_clusters(varargin)
H=varargin{1};
handles=guidata(H);
rootFolder=handles.rootFolder;
spikeData=handles.spikeData;
spikeMatrix=handles.spikeMatrix;
ClusterAllocation=handles.ClusterAllocation;
selected_cluster=handles.selected_cluster;
cluster_vector=handles.cluster_vector;
parameters=handle... |
function [result] = removeFile(filename)
r = input('Could not read in file...Enter ''1'' to delete it: ');
if r == 1
delete(filename);
delete(sprintf('%s%s', filename(1:end-3), 'mat'));
result = 1;
else
disp('Well...you may want to delete it later...peace and love!')
result = 0;
end
end |
function createrotatedmovie(degreeStep, createGIF)
% Rotates the camera around the z axis and creates an output.gif file.
%
% CREATEROTATEDMOVIE(degreeStep, createGIF)
%
% degreeStep = The number of degrees per step (larger degreeStep will ...
% increase the speed of the rotation around the z axis, ...... |
format short g
n = 1000; % The number of function evaluations
%---- Generate vectors of random inputs
% r = ( randn(n,1) * sd ) + mean
%---- Generate n samples from a uniform distribution
% r = minimum + rand(n,1) * (maximum-minimum)
ninp=C-2;
if ninp==1
as=( randn(n,1) * 0.20) + 0.5;
Mdata=[as]';
e... |
function [PC_back,cycle_back,intmem_back]=PopDir(PC,cycle,intmem,idatax,promem)
intmem_back=intmem;
%load SP
SP=intmem(130,1);
addr=promem(PC+1,1);
% if (SP<128)
% data=intmem(SP+1,1);
% else
% data=idatax(SP-127,1);
% end
data=intmem(SP+1,1);
SP=SP-1;
intmem... |
res = 100;
p1 = Polynomial2D( [ ...
0 -1 1 0.5; ...
-1 0.1 0.5 0; ...
1 0.5 0 0; ...
0.5 0 0 0 ...
] );
%imtool( p1.draw( res ) );
p2 = Polynomial2D( [ ...
0 -0.1 0 1; ...
0.25 -1 0 0; ...
-1 1 0 0; ...
0 0 0 0 ...
] );
%imtool( p2.draw( res ) );
p3 = Polynomial2D( [ ...
0... |
% Clear all info
clear
% Retrieve important info from task 1
res_path = get_res_path();
load(strjoin({res_path 'pca.mat'}, filesep));
load(strjoin({res_path 'partitioned.mat'}, filesep));
% Create appropriate S2_eig_val that is correct from ui = A * vi
% Normalise!
S2_eig_vec_adj = A * S2_eig_vec;
S2_eig_vec_adj = no... |
To=5e-3; time=0.05; timeminus = -0.05; Tu=1/10000; t=timeminus:Tu:time; % freq and time vectors
w=sinc(t/To); % create sine wave w(t)
M=10; % take 1 in M samples
wk=w(1:M:end); % the "sampled" sequence
ws=zeros(siz... |
%% PACK_one_iteration.m
function [these_results,archs] = PACK_one_iteration()
TEST = 0;
%% SEARCH
disp('Search...');
% select architectures to mutate or improve
PACK_choose_archs_for_local_search;
jess focus SEARCH-HEURISTICS;
jess run;
if ~TEST
% NRANDOM = 50;
NRANDOM = 50;
PACK_assert_random_archs(NRAND... |
% Lec 8.2 : Stiff System & Solution using ode15s
function favl = multiVarFun(t,y)
A = [-5.7,1.85;13.2,-4.3];
favl = A*y;
end |
%% VVX-lab.
%% Derivatafil med n st T (i vvx) + ipart för regulator
%%
function der = labtest(t,in,flag,regpar,vvxpar)
rho = vvxpar(1);
cp = vvxpar(2);
Fk = vvxpar(3);
Fv = vvxpar(4);
k = vvxpar(5);
Tkin = vvxpar(6);
Tvin = vvxpar(7);
Atot = vvxpar(8);
Vtot = vvxpar(9);
regk = regpar(1);
itime = regpar(2);... |
clear all
cd('/Users/xiaolidong/Dropbox/myPublications/2020/2_EE_model/MatCont7p1_2019-10-04')
systemSize = 100;
sys = zeros(systemSize,systemSize);
occupyRate = 0.8;
occupySite0 = randsample(systemSize^2,systemSize^2*occupyRate);
year = 2000;
numt = year;
G = zeros(systemSize^2,numt);
C = zeros(systemSize^2,num... |
function Hcg = CalibrateHandEyeNaive(Hgi, Hci)
obj = @(x) computeResidual(x, Hgi, Hci);
x0 = [0 0 0 0.1 0 0 0 0 0 0.1 0 0]';
opts = optimoptions('lsqnonlin');
opts.Algorithm = 'levenberg-marquardt';
opts.Display = 'iter';
x = lsqnonlin(obj, x0, [], [], opts);
Hcg = buildTransform(x(1:3), x(4:6));
end
function r... |
%
% irpCreateOBJ creates OBJ data (=triangle meshes) from the 3d points
% generated by irpGetObject3D.
%
% Usage:
% DataOBJ = irpCreateOBJ(Points3D); (to create a variabel which can be
% visualized within Matlab with irpVisualizeOBJ)
%
% irpCreateOBJ(Points3D,'filename.obj');... |
function P_E = percent_error(Approx,Experimental)
% P_E = percent_error(Approx,Experimental)
% Inputs:
% Approx = Approximate value
% Experimental = actual value to be found
% Outputs:
% P_E = percent error
% Info:
% By: Matthew Luu
% Last Edit: 5/17/2020
% Percent error of a value
% Begin Code
P_E = (abs(Approx ... |
conf = dsp2.config.load();
io = dsp2.io.get_dsp_h5();
epoch = 'targacq';
measure = 'coherence';
p = dsp2.io.get_path( 'measures', measure, 'complete', epoch );
p2 = dsp2.io.get_path( 'behavior' );
behav = io.read( p2 );
days = io.get_days( p );
key = io.read( io.fullfile(p2, 'Key') );
date_dir = dsp2.process.forma... |
%% testConvertMultispectralToRGB
%
% Description:
% Little test program to call our core routine converMultispectralRGB and make
% sure it works as intended.
%
% We have a test image to use with this program. It lives in directory
% getpref('VirtualWorldPsychophysics','testImageDir');
%% Clear
clear; clos... |
%KALMAN DATA CREATOR
%sharmaabhinav@cmu.edu
%Abhinav Sharma
%Carnegie Mellon University
%3:55 PM OCTOBER 3rd 2016
%DETECTS FRAME IN ALL POSSIBLE CONDITIONS AND BOUNDING BOXES
%The angle correction for the front foot classification has also been
%inserted
%THIS VERSION WORKS FOR RED FEET ONLY, FOR GREEN THE CONDI... |
function [TS]=ThetaTS(start,stop)
%% Eularian Stream function timeseries
cd /noc/altix/scratch/hb1g13/Nautilus/alltopo/grid
global lm;
lm=ncread('grid.nc','HFacC');
cd /noc/altix/scratch/hb1g13/Nautilus/alltopo/glued_state_files
%Define outputmatrix size (no. years,5 yearly avs per file)
TS=zeros((stop-start)/5,1);
%... |
function Networld(Data_Name)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Main program: Uses the rest of the functions to compute the finale data.
% The programa repits the process starting with N nodes, Beta (beta factor)
% and T_Max (Max. allowed steps)
%Input vars:
% D... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.