text stringlengths 8 6.12M |
|---|
function rate = testsoftmax2(w, ex, ey)
exnum = size(ex, 1);
numError = 0;
for i = 1 : exnum
x = [1, ex(i, :)]';
y = w*x;
[~,pr] = max(y);
if ey(i, pr) ~= 1
numError = numError + 1;
end
end
rate = numError / exnum; |
% Test the conversion of 257 to 204 electrodes
clc
clear all
close all
addpath("/Users/annavybornova/EPFL/Master_4/GEM/GEM_part2/02_Matlab_code/01_Pre-processing")
FileNameChan257 = '/Users/annavybornova/EPFL/Master_4/GEM/01Data/HUG_Seizure_Epochs_V04_05/EGI 257.Geneva Average 13.10-10.xyz';
FileNameChan204 = '/Us... |
function data = bell(amplitude, len, fixedAmplitude)
% data = cylinder(amplitude, len, fixedAmplitude)
SetDefaultValue(3,'fixedAmplitude',0);
if fixedAmplitude
randAmp = amplitude;
else
randAmp = amplitude + randn(1);
end
inc = randAmp / len;
data = (0:inc:(randAmp-inc))';
data = data + randn(len,1);
data = [... |
a = 0:11;
b = [2, 1.125, 0.75, 0.375, 0.125, 0,0,0,0,0,0,0];
figure
scatter(a,b, 'ro','filled');
hold on
plot(a,b,'--black');
hold off
c = normpdf(a,5.5,1);
figure
scatter(a,c, 'ro','filled');
hold on
plot(a,c,'--black'); |
function [V,HDR,EMPTY] = read_cats_csv(fname,maxsamps)
% [V,HDR,EMPTY] = read_cats_csv(fname,maxsamps)
% Read a CSV file with sensor data from a CATS tag. CATS CSV files can be
% very large and a number of steps are taken here to maximize speed and avoid
% memory problems. This function is usable by... |
function savevtk(ver,fac,filename);
fid=fopen(filename,'wt');
fprintf(fid,'%s\n','# vtk DataFile Version 2.0');
fprintf(fid,'%s\n','Send complaints about this file to guillem');
%---
fprintf(fid,'%s\n','ASCII');
%fprintf(fid,'%s\n','BINARY');
%---
fprintf(fid,'%s\n','DATASET POLYDATA');
fprintf(fid,... |
clear all
gt_path = '/usr/not-backed-up/1_DATABASE/UCSD_Anomaly_Dataset.tar/UCSD_Anomaly_Dataset.v1p2/VideoSequences/UCSDped2/Test_gt';
save_path = '/usr/not-backed-up/1_DATABASE/UCSD_Anomaly_Dataset.tar/UCSD_Anomaly_Dataset.v1p2/VideoSequences/UCSDped2/Test_gt_location';
if ~exist(save_path,'dir'), mkdir(save_path),el... |
function [rushOutLine, rushOutLineNumber] = DefineRushOutLine(pe,obstacle,obstacleNumber);
rushOutLineNumber = 2;
num = 1;
d=obstacle(2).corner(1)-pe(1);
a=obstacle(1).corner-pe;
y=pe(2)+d*a(2)/a(1);
x=pe(1)+d;
rushOutLine(num).distance = 6;
rushOutLine(num).r2l=obstacle(1).corner;
rushOutLine(num).r1l=[x;y];
num = 2... |
TD_vs_BU('TD', 0.05, 1, 19930203);
TD_vs_BU('TD', 0.05, -1, 19930203);
TD_vs_BU('TD', 0.5, 1, 19930203);
TD_vs_BU('TD', 0.5, -1, 19930203);
TD_vs_BU('TD', 1, 1, 19930203);
TD_vs_BU('TD', 1, -1, 19930203);
TD_vs_BU('cheltonLikeTD', 0.05, 1, 19930203);
TD_vs_BU('cheltonLikeTD', 0.05, -1, 19930203);
TD_vs_BU('cheltonLikeT... |
z=[-5,-40];
p=[0,0,-200,-1000];
k=0.2*0.025/0.005/0.001;
sys=zpk(z,p,k);
nyquist(sys);
axis([-0.02,0.02,-0.04,0]);%axis([xmin,xmax,ymin,ymax])
grid on;
S=solve('-0.5*pi+atan(0.2*w)+atan(0.025*w)-atan(0.005*w)-atan(0.001*w)','w');
n=length(S);
for i=1:n
wn=str2double(char(S(i)));
[Re,Im]=nyquist(sys,wn);
A(i... |
function [ y ] = function_( x )
%function_ ´ý»ý·Öº¯Êý__f(x)=sin(x)/x
% Author: Amoiensis
% Email: Amoiensis@outlook.com
% Date: 2019.11.05
% Course: Computationlal Method
% Method: Romberg quadrature formula
%%
if x~=0
f=@(x)(sin(x)/x);
y = f(x);
else
y = 1;
end
end
|
function sgm_corr = XuExtrapSgmCarm(sgm, s_config_preprocessing, s_config_fbp,mu_water)
if nargin ==3
fbp_para = XuReadJsonc(s_config_fbp);
mu_tissue = fbp_para.WaterMu;
else
fbp_para = XuReadJsonc(s_config_fbp);
mu_tissue = mu_water;
end
preprocessing_para = XuReadJsonc(s_config_preprocessing);
% det... |
%% Element manipulation
%
%%
% <matlab:doc('isatelem') isatelem> - Tests if an input argument is a valid AT element
%
% <matlab:doc('atguessclass') atguessclass> - Tries to determine the class of an element
%
% <matlab:doc('atshiftelem') atshiftelem> - Set new displacement parameters
%
% <matlab:doc('attiltelem') atti... |
clear all, close all, clc
% AUTHOR:
% STUDENT NUMBER:
%% LOAD DATA
load('data.mat')
% The file contains three arrays
% score: prediction scores obtained using fisher classifier
% gt: ground truth labels
% predicted: predicted labels using the threshold w'*(mu0+mu1)/2
p = precision(predicted, gt)
r = r... |
%--------------------------------------------------------------------------
% 读取examp09_03.xls中数据,进行变量系统聚类
%--------------------------------------------------------------------------
%*************************读取数据,并转为距离向量***************************
[X,textdata] = xlsread('examp09_03.xls'); % 从Exc... |
classdef CbProPrivate < CbProPublic
properties
apiKey
secretKey
passPhrase
end
methods
function CbPro = CbProPrivate(apiType, apiKey, secretKey, passPhrase)
% Init Public API
CbPro = CbPro@CbProPublic(apiType);
% Set needed auth ... |
function [workingData, percentRemoved] = removeArtifacts(file, numWindows)
page_screen_output(0);
page_output_immediately(1);
if (nargin != 2)
error('Too few input arguments. Usage: cleanedData = removeArtifacts(dataFile, numWindows)');
end
% NOTE: requires Octave 'signal' package (which requires the 'cont... |
clear all
close all
% -------------------------------
% PARAMETERS
% -------------------------------
% % odo noises
sigmaX = 0.003; % m
sigmaTH = deg2rad(0.02); % rad
PARAMS.Q= [sigmaX^2 0; 0 sigmaTH^2];
% % observation noises
sigmaR= 0.01; % m
sigmaB= deg2rad(0.01); % rad
PARAMS.R= [sigmaR^2 0; 0 sigmaB^2];
% NU... |
function tema1_ex2()
fs = 2000;
t = 0:1/fs:100;
x2 = sawtooth(0.4*pi*t, 0.5);
plot(t,x2);
xlabel('Timp (sec)')
ylabel('Amplitudine')
title('Triunghiular')
end |
function y = OLA(x, shift, dim)
%
% Performs the reconstruction of a signal that was buffered with the overlapp-and-add (OLA) method.
%
% Y = OLA(X, shift, dim);
%
% OUTPUT:
% Y: output reconstructed vector
%
% INPUTS:
% X: input matrix, containing the buffered signal to be reconstructed
% Shift: step size... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ----------------- Model GSM-SOCONT -------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This model simulates daily discharge from partly glacierized catchments.
% Citation:
% S... |
function SWLS260 = IDestimates
% SWLS modelling I=260 Amp
% Fit curve to data where user chooses equation to fit.
clear all
% Define function and starting point of fitting routine.
fun = @IDfun
IB = xlsread('IB260Amp.xls');
s = IB(:,1);
slength = length(s);
By = IB(:,2);
% Use rand(1,length(parms)) as starting poin... |
% MyDate
function res=MyDate()
nowNum=now;
mytime=datestr(nowNum,15);
res=sprintf('%s%s%s_%s%s',datestr(nowNum,7), datestr(nowNum,5), datestr(nowNum,11),mytime(1:2),mytime(end-1:end) ); |
function synth_image = mergeImages(I_L,I_R,p)
%MERGEIMAGES Summary of this function goes here
% Detailed explanation goes here
%holes1 = I_L == 0;
%holes2 = I_R == 0;
if(p <= 0.5)
synth_image = I_L;
%synth_image(holes1) = I_R(holes1);
else
synth_image = I_R;
%synth_image(holes2) = I_L(holes2);
end
... |
clear;
clc
|
%Works Local v2.1
classdef StreamlineSorter
%UNTITLED This class will delete and truncate Streamline so that they
%are an appropriate size for the cell. If a streamline does not reach
%the outlet, it is deleted. When a streamline is truncated to the point
%where it reaches the outlet of the cell
... |
clear all
t = [0:1e-4:0.1]; % time array, s
f = 60; % frequency, Hz
Vin = 1*sin(2*pi*f*t) + 1.0*(rand(1, length(t))-0.5); % input voltage signal plus some noise
% Vin = 1*sin(2*pi*f*t);
Vout1 = zeros(1, length(t)); % initialize output voltage for the simple zero-level-detector
V... |
%% SYS800 - Reconnaissance de formes et inspection
% M'Hand Kedjar - December 2016
% Download the MNIST data from: http://yann.lecun.com/exdb/mnist/
var_vect = [0.001 0.01 0.05 0.08 0.1 0.15 0.2 0.3 0.4 0.5 0.7 1];
error_per_n_comp = zeros(numel(var_vect), 5);
t_per_n_comp = zeros(numel(var_vect), 6);
optim_par... |
function [ Ret ] = fCalculateReturnOffset( X, Freq, Scale, OffsetAmt, OffsetBase)
% X = time base
% S = Number of 1/8 wavelengths to offset
% Freq = sinc wave frequency
% Calculate offset in time base units
Offset = OffsetAmt * (1/OffsetBase) * (1/Freq);
% Find out how much to truncate at end. Trunc is index of last ... |
% th
function [sc,V,dis_mat,ang_mat] = compu_contour_SC( cont, n_dist, n_theta, bTangent)
if ~exist('bTangent') bTangent = 0; end
%------ Parameters ----------------------------------------------
n_pt= size(cont,1);
X = cont(:,1);
Y = cont(:,2);
V = cont;
%-- Orientations and geodesic distances between ... |
function [a,a2,redpoints]=resAresTplot_hold(resA,resT,ttext,isq,showcloud,allowoutlier)
if nargin<6
allowoutlier=1;
end
if nargin<5
showcloud=1;
end
if nargin<4
isq=0;
end
%outidx=outlier(resA,0.005,20);
%if ~(isempty(outidx))
%resA(outidx)=[];
%resT(outidx)=[];
%end
if (showcloud)
%plot(resA,resT,'.','ma... |
tic
pre_test
% pre_test_even
% pre_test_odd
post_test_even
post_test_odd
toc |
close all, clear all
addpath('./pref')
addpath('../Matlab_Network/')
addpath('./reps_demo/')
addpath('./gp/')
warning('off')
ridge = 1e-4;
fixedActivation = 0.2;
userData;
for j =1:length(user.names)
load(['HandoverLearningOrientation_', user.names{j}, '.mat'])
clf,
plot(data.meanR), hold on
p... |
%USER
%Graph Plotter for User's Choice
%
%user(X_coordinates,Y_coordinates_Polar,Y_coordinates_BiPolar,number_of_bits,user_input_bit_rate_for_Polar,user_input_bit_rate_for_BiPolar,input_streat_bits)
%
%takes the mentioned parameters and plots Polar RZ and Bipolar Pseudoternary Graphs for the User inputs.
%
%RET... |
function [ edges, borderIn2Out ] = applySegEquiv2BorderAdj( eClasses, edges, borders, borderAdj )
%APPLYSEGEQUIV2BORDERADJ Calculate agglomerated borders from a segment
%equivalence class using a borderAdjacency graph.
% INPUT eClasses: [Nx1] cell
% Each cell contains the ids of one segment equivalence class.... |
% TETRAHEDRALIZE
%
% [TV,TT] = tetgen(SV,SF)
% [TV,TT,TF,TR,TN,PT,FT] = tetgen(SV,SF,'Flags',flags)
%
% Inputs:
% SV #SV by 3 list of input vertex positions
% SF #SF by 3 list of face indices into rows of SV
% Optional:
% 'Flags' followed by TetGen flags to use {'-q2'}
% Outputs:
% TV #TV by 3 list of o... |
function atDisplayVariableChange(ring1,ring2,Variables)
% this functions retrives variable Values for two rings to compare
%
% Variables is a structure array
%
% Variables struct('Indx',{[indx],...
% @(ring,varval)fun(ring,varval,...),...
% },...
% '... |
addpath('C:\Users\Sarwat\Desktop\SCSSP-Algorithm');
clc;
clear all;
disp('loading data')
Data = load('Subject01.mat'); % X = trials x channels x time samples, Y = labels x 1,
X = Data.x;
Y = Data.y
tmin = 0;
tmax = 0.5;
fs = 250;
[mTypeOne, mTypeTwo] = DataTransformation(X, Y,fs, tmax, tmin, -0.5);
% De... |
% CYCLE - 10
% Perform wavelwt transform and inverse wavelet transform in MATLAB.
%cleaning
clc;
clear all;
close all;
%Reading an image
img10 =imread("C:\Users\KUTTUSA\Pictures\Matlab\images\li.jpg");
%saperate componets in image
Red_in_img =img10(:,:,1);
Green_in_img =img10(:,:,2);
Blue_in_img =img10... |
function eigANew = eigfollower(r,Y)
Nch = size(Y,1);
[vecNew,eigNew] = eig(Y(:,:,1));
vecNew = gramschmidt(vecNew);
eigNew = diag(eigNew);
eigANew = zeros(Nch,size(Y,3));
eigANew(:,1) = eigNew;
vecANew = vecNew;
for nn=1:(size(Y,3)-1)
vecAOld = vecANew;
eigOld = eigNew;
[vecNew,eigNew] = eig(Y(:,:,nn+1));... |
function [ sensorData ] = IntSensorData( sensorData, times )
%INTSENSORDATA interpolates sensor data at set times
%--------------------------------------------------------------------------
% Required Inputs:
%--------------------------------------------------------------------------
% sensorData- either a nx1 cell... |
function varargout = DPABI_BrainImageNet_Local(varargin)
% DPABI_BrainImageNet_Local MATLAB code for DPABI_BrainImageNet_Local.fig
% DPABI_BrainImageNet_Local, by itself, creates a new DPABI_BrainImageNet_Local or raises the existing
% singleton*.
%
% H = DPABI_BrainImageNet_Local returns the handle to a... |
%@(#) plotcprmin.m 1.1 09/12/23 12:57:56
%
%function plotcprmin(sourcefil)
function plotcprmin(sourcefil)
cprmin=src2mlab(sourcefil,'cprmin');
for i=1:size(cprmin,2)
figure;
x=str2num(cprmin(i).FLOW);
y=str2num(cprmin(i).TABLE);
plot(x,y)
legend(cprmin(i).ASYTYP);
axis([0 14000 1 2]);
grid;
end
|
function [ R ] = eul2rot( e, seq )
% euler angle is represneted as 3-2-1 body sequence (roll, pitch yaw)
% e is a 3-by-n or n-by-3 matrix
% R returns a 3-by-3-by-n matrix
% seq is the sequence of Euler angles: 'zyx' (default) or 'zyz'
if ~exist('seq','var') || isempty(seq)
seq = 'zyx';
end
% check size
if size(e,... |
function plotCam(R, t, scale, color)
% PLOTCAM Plots n cameras on a circle, given absolute rotations.
%
% Other m-files required: none
% Subfunctions: none
% MAT-files required: none
%
% Author: Gabriel Moreira
% email: gmoreira (at) isr.tecnico.ulisboa.pt
% Website: https://www.github.com/gabmorei... |
function g=uniform_grid(xmin, xmax, ymin, ymax, hx, hy)
%
% g=uniform_grid(xmin, xmax, ymin, ymax, hx, hy)
% generation d'un grille rectangulaire s'étendant de xmin a xmax
% et de ymin a ymax
% entree :
% intervalles xmin, xmax, ymin, ymax
% pas hx, hya
% sortie :
% structure g
% g.Nx et g.Ny nombre ... |
function [dx,dy] = aproksimiraj_z_ravnino(x,y,v,tree,m)
% Opis:
% Izračuna aproksimacijsko ravnino v vsaki znani točki, pri čemer upošteva
% točko in najbližjih m sosedov. Ravnino je oblike ax + by + c = v.
% Koeficienta a in b predstavljata ravno naklona ravnine v x in y smeri,
% kar nato uporavimo za aproksi... |
clc
clear all
close all
format long
k = 1/2;
x_star = 3;
% x_star = 5;
y_star = log(1+exp(x_star));
y_star_inv = 1/(y_star);
% N = [3, 5, 7, 9]; %, 10, 11, 13];
% N = [3];
N = [9];
max_max_delta = [];
for j = 1:length(N)
baseSize = 2*N;
% задаем лин-триг сетку
j = 1:baseSize;
alpha = 2/(2+pi);
... |
% function are called with two types
% either cnn_kitD('coarse') or cnn_kitD('fine')
% coarse will classify the image into 20 catagories
% fine will classify the image into 100 catagories
function cnn_kitD(type, varargin)
if ~(strcmp(type, 'fine') || strcmp(type, 'coarse'))
error('The argument has to be either fi... |
function [ alpha ] = calc_relative_payload( code )
%CALC_CODE_RATE calculates relative payload (1-rate) of a given code.
%
% Tomas Filler (tomas.filler@binghamton.edu)
% http://dde.binghamton.edu/filler
alpha = sum(code.shift)/code.n;
end
|
function [jacob,positionJacobian,rotationJacobian] = jacobian(qMesured, stepSize)
jacob = zeros(6);
Transform = ur5_direct_kinematics(qMesured);
TransformCartesian = [Transform(1:3,4)' rotm2eul(Transform(1:3,1:3),'XYZ')];
for i = 1:6
qTemp = qMesured;
qTemp(i) = qTemp(i) + stepSize... |
% http://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle
function [R] = axis_angle_to_matrix(axis, angle)
x = axis(1);
y = axis(2);
z = axis(3);
s = sin(angle);
c = cos(angle);
c1 = 1 - c;
xc1 = x * c1;
yc1 = y * c1;
zc1 = z * c1;
xyc1 = x * yc1;
... |
%% generate eye inf.
% author: Shuang Wang
% email: shw070@ucsd.edu
% Division of Biomedical Informatics, University of California, San Diego.
function a = eyeInf(len)
a = zeros(len);
a(1:length(a)+1:numel(a)) = Inf;
end |
% Inputs:
% data: an m-by-d matrix, where m is the number of data points to
% cluster and d is the number of dimensions.
%
% label: an m-by-1 indices vector, where each element gives the
% cluser to which the corresponding data point in data
% belon... |
close all;
psi_mix=size_r-4
delta_psi_q1=20
psi_core=round(psi_rank_q1-delta_psi_q1)
psi_outer=round(psi_rank_q1+delta_psi_q1)
load('initialG_alphas_precession_stats.mat')
load('initialG_alphas_pre_collapse.mat');
pphi_ini=alphas_pphi0;
disp('Total number of particles simulates');
Nalphas_simulated=length(alphas_pos... |
function [output] = color_equalize_hist(input)
R=input(:,:,1);
G=input(:,:,2);
B=input(:,:,3);
er=equalize_hist(R);
eg=equalize_hist(G);
eb=equalize_hist(B);
output(:,:,1)=er;
output(:,:,2)=eg;
output(:,:,3)=eb;
end |
%% CENTRAL
clear; close all;
w1 = 10;
w2 = 15;
w3 = 10;
v1 = 50;
Ts = 0.25;
t = timer;
t.Period = Ts;
t.ExecutionMode = 'fixedRate';
t.TasksToExecute = 180;
A = [0 0 0; 1 0 0; 0 0 0]; B = [0 0; -1 0; 1 -1];
C = [0 1 0; 0 0 1]; D = [0 0;0 0];
sys = ss(A, B, C, D); ssd = c2d(sys,Ts)... |
clear;
syms u t y x;
x = 0:1:20;
y = 90*x.^8;
subplot(1,2,1)
plot(x,y)
xlabel('x');
ylabel('y');
title('y=90x^8');
subplot(1,2,2)
ezsurf(t*cos(u), 90*t^8, t*sin(u),[0,2*pi,0,2*pi])
title('Superficie de Revolucion - Rotacion en y') |
function fit = exponential()
%EXPONENTIAL creates a exponential fit object
fit = Fit.FitObject(@(a, b, c, x)a+b.*x.^c);
fit.funcTex = '$a + b \cdot x^c$';
fit.setArgumentValue( ...
{'a', 'b', 'c'}, ...
[0, 1, 1] ...
);
end
|
%% Fast K means Algorithm for clustering a Gray Image or Color Image
% It uses Preallocation and parallel operations to optimize algorithm time.
function [label_im,vec_mean] = kmeans_fast_Color(im,no_of_cluster,varargin)
% IM input Image. NO_OF_CLUSTER is number of cluster.
% VARARGIN will define Colorspace if it i... |
function varargout = SerialSetup(varargin)
% SERIALSETUP MATLAB code for SerialSetup.fig
% SERIALSETUP, by itself, creates a new SERIALSETUP or raises the existing
% singleton*.
%
% H = SERIALSETUP returns the handle to a new SERIALSETUP or the handle to
% the existing singleton*.
%
% SERIALSET... |
function [ y ] = gauss_dist(x,mu,var)
% GAUSS_DIST function for gaussian distribution
y=(1/(sqrt(2*pi*var)))*exp((-(x-mu).^2)/(2*var));
end |
function test = createTestingAir_real(ID)
load('dataAnom.mat');
seq_anom_ind = 101:300;
seq_norm_ind = 1:100;
%the result will be written to
loc = strcat('../../libdai/examples/data/HSMMtesting_',num2str(ID),'.txt');
fidhsmm = fopen(loc, 'w');
%% ========================= NORMAL DATA ==============================... |
%% display the scale fitting result
% original data
[ex, ey] = load_data();
plot(ey, abs(ex), 'k+');
hold on;
% best observation
x = [-30:2:30];
plot(x, abs(x), 'g-');
% scale and translation x' = scale*(x+b)
scale = 2.87309;
b = 0.64167;
ex2 = scale * ex + b;
plot(ey, abs(ex2), 'b*');
% dyn... |
clear All
clc
A = [0 1 0 0 0 0 0 0 1 0 0 0 0 0 0;
0 0 1 0 1 0 1 0 0 0 0 0 0 0 0;
0 1 0 0 0 1 0 1 0 0 0 0 0 0 0;
0 0 1 0 0 0 0 0 0 0 0 1 0 0 0;
1 0 0 0 0 0 0 0 0 1 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 1 1 0 0 0 0;
0 0 0 0 0 0 0 0 0 1 1 0 0 0 0;
0 0 0 1 0 0 0 0 0 0 1 0 0 0 0;
0 0 0 0 1 1 0 0 0 1 0 0 0 0 0;
0 0 0 0 0... |
function hand_trajectories = find_hands_in_sequence(depth_frames, parameters)
% function hand_trajectories = find_hands_in_sequence(depth_frames, parameters)
global debug;
depth_frame = double(depth_frames{1});
% detect the face and initial body position
initial_track = initial_tracking_info(depth_frame, parameters)... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Cahn-Hilliard Equ with mechanical effect %
% Linear stability analysis %
% Dispersion Relation & Phase diagram %
% %
% ... |
classdef UmapDirector < mlpipeline.AbstractDirector
%% UMAPDIRECTOR
% $Revision$
% was created 01-Jan-2017 01:52:11
% by jjlee,
% last modified $LastChangedDate$
% and checked into repository /Users/jjlee/Local/src/mlcvl/mlraichle/src/+mlraichle.
%% It was developed on Matlab 9.1.0.441655 (R2016b) f... |
function ICA_PCA_array(filenum)
pth = [pwd '/'];
files = dir([pth '*_rois.mat']);
if ~isempty(files)
% try
rois = load([files(filenum).folder '/' files(filenum).name]);
a = rois.rois;
if ~exist([files(filenum).folder '/' strrep(files(filenum).name, 'rois', 'ica_pca_trace')], 'file')
try
... |
%----------------------------QRtoSTL-----------------------%
% -Input one or two qr codes to be converted into an 3D matrix of cubes in
% stl format
% -If only one embedded code is desired then name the false QR "ONLYONE"
% -If two embedded codes are desired, they must have the same
% cellsize, cell dimension, and qui... |
function varargout = ZaberTemp(varargin)
% ZABERTEMP MATLAB code for ZaberTemp.fig
% ZABERTEMP, by itself, creates a new ZABERTEMP or raises the existing
% singleton*.
%
% H = ZABERTEMP returns the handle to a new ZABERTEMP or the handle to
% the existing singleton*.
%
% ZABERTEMP('CALLBACK',hO... |
%% Unscented Kalman Filter (UKF) Code [nonlinear system, linear measurement] for ATC
function [x, P, LH] = ukf_atc_imm(x, z, P, xNon, xNon0, C, Q, R)
% a) Iniitalize stage
n = size(x,1); % Defines number of states
m = size(z,1); % Defines number of measurements
kappa = 1e-3; % Defines kappa value (user defined)
sqrtnkp... |
clear all ; close all;
currs = {'AUDCAD','AUDCHF','AUDJPY','AUDNZD','AUDUSD','CADCHF','CADJPY','CHFJPY','EURAUD','EURCAD','EURCHF',...
'EURGBP','EURJPY','EURUSD','GBPCHF','GBPJPY','GBPUSD','NZDCHF','NZDJPY','NZDUSD','SGDJPY','USDCAD','USDCHF','USDJPY','USDSGD'} ;
spreads = [ 2.5, 2.5, 0.95, 2.33, ... |
function [GSB,SE,ESA,tmp_gg_t,tmp_ee_t] = pp_cont_HEOM(sz_params,...
rho_eg,V_ge_t,V_ef_t,prop_op_gg,prop_op_ee,t2_range,e1,e2,...
av1_g,av1_f,av2_g,av2_f,H_trunc,tol) ;
warning('incomplete')
%Calculated the re/nonrephasing contribution to a 2D signal given the coherence
%part of the de... |
function mytable(input,type)
%--------------------------------------------------------------------------
% Purpose:
% Print outputs in tabular form
% Synopsis :
% mytable(input,type)
% Variable Description:
% input - displacement or Stress matrix
% type = 1 displacemen... |
% This script load building dataset
load building_dataset
data = buildingInputs';
label_true = buildingTargets(3,:)'; |
%Ruifeng Zhang 861212163
%CS 171 PS1
%15 October 2015
function prob3
X=[0;2;2;3;-1;1]
Y=[1;-3;-2;-3;-1;-1]
Xw=[1,0;1,2;1,2;1,3;1,-1;1,1]
A=Xw'*Xw
c=Xw'*Y
w=inv(A)*c
w2=inv(A+5*eye(2))*c
plot(X,Y,'o');
hold on;
syms x y;
f(y)=w(1)+w(2)*x^3
ezplot(f,[-1,4]);
f(y)=w2(1)+w2(2)*x^3
ezplot(f,[-1,... |
function [Xd] = rangeDiscretize(xmin, xmax, numdx)
for i = 1:1:2
step = (xmax-xmin)/numdx(i);
xsequence{i} = xmin(i):step(i):xmax(i); %step(i) by XD
if xmax(i) > xsequence{i}(end)
xsequence{i} = [xsequence{i},xmax(i)];
end
end
t = 1;
for m = 1:length(xsequence{1})-1
for n = 1:length(xsequenc... |
%Prints out epsilon vs population proportion
%Whale Group at MTBI
%created by Ivan E. Cao-Berg
%"And you take YOUR LIFE in your hands.
%And what happens?
%SOMETHING TERRIBLE!!!!
%No one else to blame.
%-Erica Jong
function epsilon( betax, betay, muj, mux, muy, px0, x0, y0, c, step )
if nargin == 0
opt... |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
% DTFT properties
% Differentiation in frequency
syms n
x=0.8.^n
L=symsum(n/j*x*exp(-j*w*n),n,0,inf);
subplot(211);
w1=-pi:.01:pi;
Li=subs(L,w,w1);
plot(w1,abs(Li));
legend('magnitude of DTFT of left p... |
%Class to store all analysis about a particular scan and color
classdef scanClass
properties
scanNum = NaN;
colorStr = '';
colorNum = NaN;
gutRegionsInd = NaN;
saveLoc = '';
clumps = clumpSClass.empty(1,0);
totVol = NaN;
... |
function [db_s] = FputMelFixInDBstruct(db_s, pos_v, handles)
if nargin < 3
handles = [];
end
LOGDIR = '/tmp/';
filename = [LOGDIR '/' 'log_' mfilename '_' inputname(1) '_' datestr(now, 'dd-mm-yyyy_HH-MM-SS') '.txt'];
fid = fopen(filename, 'w');
if fid == -1
error('Can''t open log file')
end
loudnes... |
function addHelpSearch
%% Make help files searchable
mfilePath = mfilename('fullpath');
gibbonPath=fileparts(fileparts(mfilePath));
gibbonHelpPath=fullfile(gibbonPath,'html');
builddocsearchdb(gibbonHelpPath);
|
function [flag] = visibility_checkSelfOcclusion(vertex,vertexPrev,vertexNext,x)
%VISIBILITY_CHECKSELFOCCLUSION Determines if the visibility from vertex to
%x is blocked via self occlusion by the polygon vertex lies on
%vertex is a 2x1 vector containing the x,y pair of the vertex of interest
%vertexPrev is a 2x1 vector ... |
% Figure 3.34 Feedback Control of Dynamic Systems, 6e
% Franklin, Powell, Emami
% script to generate Fig. 3.34
clf;
zeta =.5;
num=1;
k =1/zeta;
den1=[1 2*zeta 1];
a=100;
den2=[k/a 1];
den=conv(den1,den2);
t=0:.1:10;
y1=step(num,den,t);
a=5;
den2=[k/a 1];
den=conv(den1,d... |
function z=solenoid(fname,L,KS,method)
%SOLENOID Creates a solenoid element in old AT versions (Obsolete)
% z=solenoid('FAMILYNAME',Length [m],KS,'METHOD')
% creates a new family in the FAMLIST - a structure with field
% FamName family name
% Length length[m]
% KS solenoid strength KS [rad/m]
% ... |
function [word_positions] = word_histogram(line_bin)
% the function takes a line from the original image.
% it returns a array, each row of which has the start and end
% indices of the words
d_1 = imerode(line_bin, strel('rectangle', [3, 1]));
H = size(line_bin,1) - sum(line_bin, 1);
... |
%% SYS800 - Reconnaissance de formes et inspection
% M'Hand Kedjar - December 2016
function data_projected = get_acp_projection(data , vec_p, M, n)
[n_samples , ~] = size(data);
% Projection on the n first eigen vectors
data_projected = (data - ones(n_samples , 1) * M) * vec_p(:, 1:n);
end |
function tiffTileProd(input,output_dir,varargin)
%TIFFTILEPROD create image tiles (small) from a high resolution tiled Tiff image
%Information of the tiles is found in the metadata of the Tiff image
%
%Syntaxis: tiffTileProd(input,tiles_dir,output)
%
%Required input arguments:
% -- input : string. high resol... |
function [xsave] = sampleTrajectoryGPU3(px, hyp, ...
mean_factor, var_factor, start_states, polpar, s, steps)
%
% Matrix multiplication version of trajectory sampling with a SPGP model on GPU.
%
% Inputs:
% px: pseudo inputs [m, d]
% hyp: log hyper parameters (b, c, sig) [d+2, dim]
% mean_factor: parameters for... |
clear;
close all;
load('AllResults.mat');
x=6:20;
y=x;
subplot(2,2,1);
plot(YtestPaxton(1:3:300),Yhat1ARIMAPaxton(1:3:300),'dg');
hold on
plot(YtestPaxton(1:3:300),Yhat1ANNPaxton(1:3:300),'pc');
plot(YtestPaxton(1:3:300),Yhat1SVRPaxton(1:3:300),'o','Color',[1 0.5 0.2]);
plot(YtestPaxton(1:3:300),Yhat1GPRPaxton(1:3:300)... |
function docNode = create_trans_bot_xml_node(trans_obj,docNode,file_id,ver)
% input parser
p = inputParser;
addRequired(p,'trans_obj',@(obj) isa(obj,'transceiver_cl'));
addRequired(p,'docNode',@(docnode) isa(docNode,'org.apache.xerces.dom.DocumentImpl'));
parse(p,trans_obj,docNode);
% intialize bot_xml structure
idx_... |
function r = vergversion()
r = 'verg.82.85708f7';
|
%% Author: ield
% Description: Plot made to see the resembplance point of s1 and s2 for
% exercise 5.2.9 in task 5.2
f1 = 200;
f2 = 400;
fc = 2000;
fs = 8000;
T = 0.02;
t = 1/fs:1/fs:T;
s1 = cos(2*pi*f1*t);
s1Phase = 0.25*(cos(2*pi*(f1+20)*t)+cos(2*pi*(f1-20)*t));
s2 = -sin(2*pi*f2*t);
s2Phase = -0.25*(sin(2*pi*(f1+... |
%%%% compute prox-mapping given by
%%%% s = \argmin_{x \in X} \langle p, x \rangle + \Omega(x)
%%%% where X is the standard spectahedron and
%%%%% \Omega(x) = Trace((x+\delta I) \ln (x+\deltaI)
function [s] = ProxmappingSpect(data, domain, p)
n = domain.n;
R = domain.R;
%%% do eigenvalue decomposition fo... |
%% Zone-independent synthetic lethal gene pairs
%% Symbiotic
% Get plant and bacteroid genes
isBacteroid = {};
for n = 1:length(model.genes)
if strmatch('Bacteroid', model.genes{n});
isBacteroid{n} = 1;
else
isBacteroid{n} = 0;
end
end
plantGenes = model.genes(~logical(cell2mat(isBacteroid... |
function [success] = minimize_nChargers_with_t0(BusArr,Nmax_soll,arrtime,deptime,withplot)
%MINIMIZE_NCHARGERS Summary of this function goes here
% Detailed explanation goes here
%*****************************Generate Test Data*****************************%
global BusArray dt;
BusArray = BusArr;
goal = 'Nmin';
[~,nr... |
clc;
close all;
%first sequence
x=input('Enter x\n');
l1=input('Enter the lower limit:\n');
u1=input('Enter the upper limit:\n');
x1=l1:1:u1;%limit of sequence x(n)
%second sequence
h=input('Enter h:\n');
l2=input('Enter the lower limit:\n');
u2=input('Enter the upper limit:\n');
h1=l2:1:u2;%limit of sequence ... |
% DOESMODELREQUIREEXTRAINFO checks if a model pdf requires more than data.errors
%
% r = DoesModelRequireExtraInfo(model)
%
% This function is a helper function used by functions that attempt to
% evaluate a model's pdf at specific values independent of the specified
% data. It check if a model.pdf function requires mo... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Emilio and David
%this is our first attempt at implementing a swarm intellegence algorithm
%this work was started on 2/11/2019
%we are implementing the basic particle swarm algorithm found in
%Evolutionary and Swarm Intelligence Algorithms.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.