text stringlengths 8 6.12M |
|---|
% PART 4
options.MaxIter=1000;
options.Tol=1e-5;
disp("n = 10")
n = 10;
R=rand(n); I=eye(n);b=rand(n,1);x0=zeros(n,1);
disp("lambda = 100")
lambda = 100;
A = R + lambda.*I;
x=Jacobi(A,b,x0,options)
disp("------------------------")
x=Gauss_seidel(A,b,x0,options)
disp("lambda = 10")
lambda = 10;
A = R + lambda.*I;
x=J... |
function varargout = experiment(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @experiment_OpeningFcn, ...
'gui_OutputFcn', @experiment_OutputFcn, ...
'g... |
function correctedspectrum = spectraBaselineCorrection(spectrum)
mask = peakDetect(spectrum);
baseline = estimateBaseline(spectrum, mask);
correctedspectrum = spectrum - baseline;
end |
function rats = TmazeRats
%TMAZERATS Get list of Tmaze rats for that 274th time when you really don't
%feel like typing them all out again
%
% rats = TmazeRats;
% rats = {'R042','R044','R050','R064'};
%
% aacarey Dec 2015
rats = {'R042','R044','R050','R064'};
end
|
function [ optimizedParameter ] = optimizeParameter(parameter, stepNumber, drStartValue, dhStartValue, actualIncrement, lowestIncrement, lambdaStart, lambdaEnd, lambdaStep, geometryTypeShort, numberOfLayers, coreDiameter, claddingDiameter, doping, saveFiles, displayStepWhenCalculatingFiber)
%OPTIMIZEPARAMETER Summary o... |
psi_star_dot_omega_map(:,:)=psi_star_dot_evol(FRAME_NUMBER,:,:);
Efield_phi_map_phi=Efield_X_map_phi*0;
for phi_rank=1:NB_PHI
phi_rank_kinetic_energy=0;
EX_PR_map=squeeze(Efield_X_map_phi(phi_rank,:,:));
EZ_PR_map=squeeze(Efield_Z_map_phi(phi_rank,:,:));
psi_star_dot_PR_map_phi=zeros(NB_THET... |
function [err,groups] = EKSS_wrap(X,n,trueLabels,B,T)
[D, N] = size(X);
[err, groups, ~] = EKSS(X,n,D-1,trueLabels,B, N,T, 0, 1, 'kss');
end |
function [sysest, simout] = MdlFRD(Mdl, varargin)
% MdlFRD runs frequency response analysis of the model
%% define input sine stream
fprintf('Define input sine stream... \n');
[inputCell, SinStrmType, SolvTyp, Ts, FrqLst] = GenInputSineStreamCell(Mdl, varargin{:});
fprintf('Input sine stream is %s with %d amplitude(s... |
function [s, info, dict] = dicm_hdr(fname, dict, iFrames)
% Return header of a dicom file in a struct.
%
% [s, err] = dicm_hdr(dicomFileName, dict, iFrames);
%
% The mandatory 1st input is the dicom file name. The optional 2nd input can be
% a dicom dict, which may have only part of the full dict. The partial dict ca... |
function matlab2hypreIJ(matlab_smatrix,num_procs,matrix_filename,varargin)
%MATLAB2HYPREIJ converts MATLAB matrix to HYPRE IJ format.
%
% This program was tested on Matlab 7.1.
%
% Description:
% matlab2hypreIJ(matlab_smatrix,num_procs,matrix_filename)
% generates hypre input files for sparse matrix
... |
function dydt= well_disturbance_der(t,y,u, D)
[dydt, ~,~,~,~,~ ]= well_disturbance(t,y,u, D);
end |
function [ embeded_blck ] = Embedd_MDE( BFV,expand_blcks,block )
%This function embedds a 6 bit information in the first two expandable
%blocks of the current block of the expnadable blocks.
%inputs of the function are bfv blockno and that particular block
% v0 ¼ u0 þ u1 þ u2 þ u34
%~v1 ¼ 2 v1 þ b1
%~v2 ¼ 2 ... |
function [best_model] = train_binary_model(training_set, labels, varargin)
% TRAIN_MODEL Train a model for binary classification.
%
% Trains a model for binary classification, cross-validating between:
% - Linear Discriminant Analysis
% - Quadratic Discriminant Analysis
% - SVM with rbf kerne... |
function psprint(filename)
% psprint('filename')
% prints current figure with
% the following flags
% -deps2
% .ps will be appended
%
% see also psprintc
filenameps = sprintf('%s.ps',filename);
disp(sprintf('printing to %s.ps',filename));
print(filenameps,'-deps2'); |
function imn = CS4640_add_noise(im,p_min,p_max,noise_type,a,b,mu,sigma2)
% CS4640_add_noise - add uniform or Gaussian noise
% On input:
% im (MxN image): input image
% p_min (float): minimum gray level in noise image
% p_max (float): maximum gray level in noise image
% noise_type (int): 1: uniform; 2: G... |
%=========================================================================
%
% Money demand equation with a floor interest rate
%
%=========================================================================
clear all
clc
RandStream.setGlobalStream( RandStream('mt19937ar','seed',42) );
t = 20;
x = seqa(0,1,t)';
b0 ... |
close all;
R=csvread('CSV/nmse_vs_missing_uniform.csv');
plot(R(:,1),R(:,2),'-o','LineWidth',2,'MarkerSize',4);
ylim([0 100]);
xlabel({'Missing entries uniformly distributed(%) '})
ylabel({'NMSE(%)'})
title('NMSE vs Missing entries for a single day') |
function partition_id = partition_id_from_run_id(run_id)
% convenience function for getting partitions for CV from run_ids
partition_id = floor((run_id - 1) / 2) + 1;
|
function [ ] = showWeights2( )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
global p w d a;
FONTSIZE = 13;
% plot all weights
axes(d.allWeights);
imagesc(a.wts1)
% imagesc(a.identity)
title(d.allWeights, 'weights - from visual to hidden layer', 'fontsize', FONTSIZE)
ylabel(d.allWei... |
function [] = CalibrationCurves(calfilepath, filterfilename, tempStart,...
tempEnd, tempStep, leftStart, rightEnd)
close all
tic
% set order of polynomials for mvs
mvsOrder = 4; %John used 3
% set low and high temperatures in degrees C
tempLow = min(tempStart,tempEnd);
tempHigh = max(tempStart,tempEnd... |
clear; clc;
tspan = 0:0.01:3;
q = [0.2,1];
dq = [0,0];
y0 = [q,dq];
yfinal = [];
% lambda = -9.8;
contactmode = 0;
options = odeset('RelTol',1e-5,'AbsTol',1e-4,'MaxStep',1e-3,'Events',@events);
tstart = 0;
tend = 3;
dt = 0.01;
while tstart<tend
[t,y,te,ye,ie] = ode45(@f,tspan,y0,options,contactmode);
yfinal ... |
function tf = ispsd(filename)
%ISBMP Returns true for an Adobe Photoshop PSD file.
% TF = ISPSD(FILENAME)
% Author: Jeff Mather
% Copyright 1984-2004 The MathWorks, Inc.
% Open the file.
fid = fopen(filename, 'r', 'ieee-be');
if (fid < 0)
tf = false;
return
end
FormatSignature = fread(f... |
function X = GaussJordan(A)
[~,n] = size(A);
X = eye(n);
for j = 1 : n - 1
for z = j + 1 : n
%daca pivotul este 0, fac pivotare cu alta linie
if A(j, j) == 0
t = A(j, :);
A(j, :) = A(z, :);
A(z, :) = t;
s = X(j, :);
X(j, :) = X(z, :);
X(z, :... |
% This function gets the following information:
%
% 1 - downloaded dataset from website
% 2 - The desired sampling time
% 3 - The file name, into which the user wants to save the obtained
% information
%
% The output is an array of all different available signals, where each signal
% has the following fields:
% ... |
function Probs = AverageProbability_PatbyPat(Probs,Nfolds,Npatients)
% average out the predicted probabilities in an object Probs
% to obtain bootstrap average class probability for each instance
%
% input: the Probs object that saves class probability for every training/testing instances in every
% BS/CV folds
% .Pr... |
function [] = AddTrueModelToPlot (mTrue)
hax = flipud(get(gcf,'Children'));
for iax = 1:length(hax)
axes(hax(iax));
hold on;
plot(mTrue(1), mTrue(2), 'k^', ...
'MarkerSize', 10, 'Linewidth', 2);
drawnow;
end
end |
%% The task of the program is to find cell cortex border and determine cell
%% parameters (cell ends, cell length, angle, profile of cell width)
% Result array contains: cell ends(1,2,3,4 (x1,y1,x2,y2)),
% cell axis angle in degrees(5), cell width close to cell end(6), cell length(7)
function [CellParams, CellsPix... |
function [ filtered_signal ] = bandpass_filter( signal, samplerate, M, low_cut_fq, high_cut_fq)
I = 360*0.05;
N = -M:M;
nyq_freq = samplerate / 2;
lowcut = low_cut_fq / nyq_freq;
highcut = high_cut_fq / nyq_freq;
h1p = sin(2*pi*highcut*N)./(pi*N);
h1p(M+1) = 2*highcut;
h2p ... |
% This is material illustrating the methods from the book
% Financial Modelling - Theory, Implementation and Practice with Matlab
% source
% Wiley Finance Series
% ISBN 978-0-470-74489-5
%
% Date: 02.05.2012
%
% Authors: Joerg Kienitz
% Daniel Wetterau
%
% Please send comments, suggestions, bugs,... |
function gotocompile(SubMachine)
if nargin == 0
SubMachine = getfamilydata('Gun');
if strcmpi(SubMachine, 'Gun')
fprintf(' Run cc_gun to compile all the gun applications.\n');
end
end
if strcmpi(SubMachine, 'Gun')
SubMachineDir = 'gun';
else
SubMachineDir = lower(SubMachine);
end
Comp... |
%% SYS800 - Reconnaissance de formes et inspection
% M'Hand Kedjar - December 2016
function [err_KNN , cm_KNN, knnTestRunningTime, prediction_KNN_Test] = Classify_KNN_Test(trainData, ...
trainLabels, ...
testData, ...
... |
function [cost, out, niter, timeperiter] = linp(m, l, s, AP, IP, N, nj, tau, n, na, xd)
%%
% m: number of processors
% l: number of speed levels
% s: vector of speed levels
% AP: vector of active power datas
% IP: idle power data
% N: number of discretization steps
% nj: a vector containing number of deadlines at each ... |
function val = calc_distance(A, B)
val = 0;
n = size(A, 2);
for i=1:n
val = val + (A(i) - B(i))*(A(i) - B(i));
end
val = sqrt(val);
end |
function h=demirel(im,thr,T)
%h=demirel(im,thr);
%im is an input image, thr is a threshold between 0-1, T is the thickness
%of the line to indicate the edge.
%h is an uint8 balck and white image with values of 0 and 255.
%This programme has been written by me, G. Anbarjafari (Shahab) months ago
%but finalized to... |
function h = plotCoarsening(W, status, varargin)
%PLOTLEVEL Plot a level in a multi-level setup.
% H = PLOTLEVEL(SETUP, O, ...) generates a plot of SETUP.LEVEL{L}'s graph
% using the GRAPHVIZ4MATLAB package.
%
% Extra plotting options include:
%
% 'coarsening' Show the next coarse level's aggregates b... |
function [ out ] = totalWave( data )
[dataRow, dataColumn] = size(data);
result = [];
for i = 1:dataColumn
temp = 0;
for j = 1:dataRow
temp = temp + data(j,i);
end
result = [result;temp];
end
out = result;
end
|
function y = laplace(m,n,mu,b)
% This generates a matrix of Laplace noise.
u = rand(m,n) - 0.5;
y = mu - b*sign(u).*log(1 - 2*abs(u));
end |
function line2 = normalizeLine3d(line)
%NORMALIZELINE3D Normalizes the direction vector of a 3D line.
%
% LINE2 = normalizeVector3d(LINE);
% Returns the normalization of the direction vector of the line, such
% that ||LINE2(4:6)|| = 1.
%
% See also
% normalizePlane, normalizeVector3d
%
% ------
% Author... |
%program to plot some interesting output for various estimated models
date_deb = 1992
span=28;
rest_diff=0;
pool=1;
shrink=1;
sg_change=1;
unit_spec_var=1;
perm=0;
File='logit';
DSTruc=0;
S_Logit=1;
Pclas=1;
for cal_beg=[date_deb];
cal_end=cal_beg+span;
for cal_end_Est=[2020.75];
for K=[3];
for lag... |
function varargout = bifurcation(varargin)
% bifurcation M-file for bifurcation.fig
% bifurcation, by itself, creates a new bifurcation or raises the existing
% singleton*.
%
% H = bifurcation returns the handle to a new bifurcation or the handle to
% the existing singleton*.
%
% bifurcation('C... |
%% Initialization
clear ; close all; clc
x = [1, 2104; 1, 1416; 1, 1534;1, 852];
theta = [-40, 200, -150; .25, .1, .4];
y = round(x*theta);
y |
function [x,y]=simulate(a,b,c,d,x0,T)
%Simulation of dynamical system
x(1)=x0;
for t=2:T
x(t)=random('normal',mx(a,x(t-1)),vx(b,x(t-1)));
y(t)=random('normal',my(c,x(t)),vy(d,x(t-1)));
end
|
function [cWWCounts, initialCounts, transitionCounts, coreCounts, initialTransitionCounts] = pExtractSequenceCounts(Text)
cWWCounts = zeros(6,1); %CG,GC,AU,UA,GU,UG
initialCounts = zeros(4,1); %A,C,G,U
coreCounts = zeros(4,1); %A,C,G,U
transitionCounts = zeros(4,4); %(A,C,G,U)^2
initialTrans... |
function [geom,gpflg]=Todas_geom()
lambda=3e8/freq_config;
switch Geo
case 0 % Geometry definition for isotropic element
geom(1:3,1)=[0 ; 0 ;0 ]; %
geom(1:3,2)=[0 ; 0 ;0 ]; %
gpflg=0;
case 1 % Geometry definition for patch element rectangular
% Rectangular patch... |
function [X] = getTargetState(Target, t)
% GETTARGETSTATE Compute the state of the target vehicle given its initial
% condition and the current time
%
% X = getTargetState(Target, t) takes the Target structure, which
% includes the initial state, and the current time, t, and computes the
% output state X = ... |
% structure coursework
clear
clc
%initial setup
F_dot_x0 = 0.4823*1000;
eta_dot_y0 = -0.00002;
F_dot_x90 = 0.0482*1000;
F_dot_x30 = 0.1093*1000;
eps_dot_x0 = 1e-4;
eps_dot_x30 = 1e-4;
eps_dot_x90 = 1e-4;
eps_max = 1e-3;
t = linspace(0,10,200);
width = 25e-3;
height = 1e-3;
cross_area = width*height;
% [0_8]
eps_x0... |
%{
This file is used to plot the energy spectrum observed by RBSP, and
simulate the observation using the result from Trace_magdip_proton_rbsp_case.m
Zefan -- 21-03-18
%}
%% plot the RBSP observation
filename = 'data\rbspb_rel04_ect-hope-pa-l3_20170912_v7.4.0';
info = cdfinfo(filename);
out = cdfread(filename... |
%% summary statistics
clear
clc
load('alldata.mat')
% Descriptive stats on data
% Logistic regression: iv = x-axis, dv = binary
% p(chat = 1) = logistic(b0 + b1*N + b2*C + b3*X)
% where x is the stat of interest
% per subject meaning you do the logistic regression separa... |
function out = sin(in)
for j=1:size(in,2)
for i=1:size(in,1)
out(i,j).value = sin(in(i,j).value);
out(i,j).dV = sparse(1:numel(in(i,j).value),1:numel(in(i,j).value),cos(in(i,j).value))*in(i,j).dV;
jH = Hjacobian(in(i,j).dV,in(i,j).dV);
jH.ddV = sparse(1:numel(in(i,j).value),1... |
addpath('../general_functions')
addpath('../../generally_applicable_code')
T_iter=linspace(0.01,40,300);
w_range=linspace(0,200,10^5);
d=2;
lam=0.9;
A=-1;
tol1=10^(-4); tol2=10^(-4);
MRT=zeros(4,length(T_iter));
for i=1:4
if i==1
w_range=linspace(0,200,10^5);
Gbar=1-erlang_cdf(w_range, 2, 2);
... |
function f = fminGoldStandard(p, xy, XYZ, w)
%reassemble P
P = [p(1:4);p(5:8);p(9:12)];
%compute squared geometric error
n = size(XYZ, 2);
f = 0;
for i = 1:n
repr = P*XYZ(:,i);
repr = repr ./ repr(end);
f = f + norm(repr - xy(:,i))^2;
end
%compute cost function value
end |
function y = DB_ABS_NORM(x)
y = db(abs(x)/max(abs(x(:))));
end |
function [KneePoint,Distance,r,t] = F_kneepoint(FunctionValue,FrontValue,MaxFront,r,t,rate)
% This function finds all the knee points in each front
[N,M] = size(FunctionValue);
% the flag tells that each solution is knee point or not
KneePoint = false(1,N);
% the distance between each solution and the... |
function plot_lines_he(name)
# Function for plotting Helium lines
c = 299792458;
wname = strcat(name, '_wav_he.dat');
iname = strcat(name, '_int_he.dat');
wname = load (wname);
iname = load (iname);
line = [strcat(' 1::',' ',num2str(c/0.2767360E+15,5)); strcat(' 2::',' ',num2str(c/0.5130456E+16,5)); ...
strcat(' 8... |
function [combinedMask, tempMasks] = tracking_cal_constant(Template, TemplateMask, testMask, S0, leafID)
nLeaf = numel(TemplateMask);
tempMasks = cell(nLeaf, 1);
combinedMask = zeros(1,length(testMask(:)));
for i = 1 : nLeaf
if leafID(i) ~= 0
temp = Template{i};
tempMask = TemplateMask{i};
... |
close all;
clearvars;
clc
% % % % % % % % % % % % % % A = [3 3; -1 -1]';
% % % % % % % % % % % % % %
% % % % % % % % % % % % % % % Create rotation matrix
% % % % % % % % % % % % % % theta = 350;
% % % % % % % % % % % % % % R = [cosd(theta) -sind(theta); sind(theta) cosd(theta)];
% % % % % % % % % % % % % % ... |
function out = controller_VFO_path_noparam(in)
global dzeta
F= in(1);
Fx = in(2);
Fy = in(3);
Fxx = in(4);
Fyy = in(5);
Fxy = in(6);
theta = in(7);
x = in(8);
y = in(9);
Kp = 1;
Ka = 2*Kp;
% v_d = dzeta*0.25;
v_d = 0.25;
R = [0 1;-1 0]; % pod (9)
nabla_F = [Fx; Fy];
norm_nabla_F = norm(nabla_F);
w = -nabla_F; %... |
function setoperationalmode(ModeNumber)
%SETOPERATIONALMODE - Switches between the various operational modes
% setoperationalmode(ModeNumber)
%
% ModeNumber = 1. 1.9 GeV, Top Off
% 2. 1.9 GeV, Ramping from 1.353 GeV
% 3. 1.9 GeV, Ramping from 1.230 GeV
% 4. 1.9 GeV, High Tune... |
function ViewHelp(hObject, eventdata)
% TODO: open help file
|
function y=check_constraint(ratio_temp,ratio_main_temp)
global r_tire torque_fit m f
load basedata.mat
% slope=0.3;
% spd_min=5;
% spd_max=100;
% i_max(1)=0.377*rot_fit(1)*r_tire/spd_min/ratio_main;
% i_max(2)=m*9.8*(f*cosd(17)+sind(17))*r_tire/0.85/ratio_main/max(torque_fit);
flag_1=(ratio_temp(1)>m*9.8*(f*cosd(17)+s... |
function [ transBlock ] = flipRNinety( block )
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
transBlock = block';
end
|
%DEMOREMOVEMESHVERTICES Demonstration script for function removeMeshVertices
%
% output = demoRemoveMeshVertices(input)
%
% Example
% demoRemoveMeshVertices
%
% See also
%
% ------
% Author: oqilipo
% Created: 2017-09-17, using Matlab 9.1.0.441655 (R2016b)
% Copyright 2017
%% in & out: faces / vertices
fi... |
a=20;
im1=mat2gray(proj_meta(2).rd(1).template);
im2=0;
imshow(im1)
cells = ginput;
cell_stack = zeros(2*a+1,2*a+1,size(cells,1));
%%
for ii=1:size(cells,1)
cell_stack(:,:,ii)=im1(cells(ii,2)-a:cells(ii,2)+a,cells(ii,1)-a:cells(ii,1)+a);
end
mean_cell =mean(cell_stack,3);
figure;imshow(mean_cell)
%%
d_nu... |
function tri = triangulate(xnod,ynod,nodes)
%
% tri = triangulate(xnod,ynod,nodes)
%
% triangulate the quadrilateral mesh
%
nele = size(nodes,1);
tri = zeros(3,2*nele)';
iv = [];
ii1 = [2 3 1];
jj1 = [4 1 3];
ii2 = [1 2 4];
jj2 = [2 3 4];
nrtri = 0;
for iel = 1:nele
iv = nodes(iel,:);
d1 = norm([xnod(iv(1))-xnod(iv(... |
function batch2d2c(dir_file,isSaveImage,result_file)
%anabatch2d2c.m
%analyzing 2 component 2D space simulation for varying cell size in batch
%mode
%For: nA0B, nApB, nA0B_salt, nA0B_solvent, etc.
%Author: Yi-Xin Liu@Fudan Univ. liuyxpp@gmail.com
%Since 2011.1.25
%batch var can be: e, eA, f, k, and p
%the dir s... |
clear all ;close all ;
subs = {'alex','charest','esteban','fabio','gab','gabriella','genevieve','gina','guillaume','jeremie','julie','katrine','lisa','marc',...
'marie','mathieu','maxime','mingham','patricia','po','russell','sunachakan','tah','vincent'} ;
for sb=1:length(subs); disp(sb) ;
cd(['c:/share... |
%% load dataset
clear;
cd(fileparts(which('prepareClassifyData.m'))); dataDir='../../data/';
posGtDir=[dataDir 'Train_clear' '/annotation'];
posImgDir=[dataDir 'Train_clear' '/image'];
outImgDir=[dataDir '/Classify/train/'];
fs={posImgDir,posGtDir};
fs=bbGt('getFiles',fs); nImg=size(fs,2); assert(nImg>0);
imgSize = ... |
% a and b
A = [-2 4; -1 3];
B = [8 2]';
C = [1 -1];
D = 2;
T = [0 -2; 1 -1];
C_ = C*inv(T);
A_ = T*A*inv(T);
B_ = T*B;
D_ = D;
syms s
%c
H = C*inv(s*eye(size(A))-A)*B+D;
simplify(H,'Steps', 10)
H_ = 3*inv(s - (-1))*2+2e
|
% Region of attraction analysis on the vehicle system with NN controller
clear
%% parameters
% Nominal speed of the vehicle travels at.
U = 28; % m/s
% Model
% Front cornering stiffness for one wheel.
Ca1 = -61595; % unit: Newtons/rad
% Rear cornering stiffness for one wheel.
Ca3 = -52095; % unit: Newtons/rad
% Front... |
ans= Shrodinger(-5,5,20,5,0.1,1000000);
function y=psi0(x)
y=exp(-4*x^2+5*1i*x);
end
function psi = Shrodinger(xL,xR,R,T,h,M)
tau=T/M;
N1=R/h;
N2=(xR-xL)/h;
N=2*N1+N2;
psi=zeros(N+1,N+1);
x=zeros(N+1,1);
x(1)=xL-R;
for j=1:N
x(j+1)=x(j)+h;
end
for j=0:N
psi(j+1,0+1)=psi0(x(j+1));
end
... |
function [chiralWavelength chirality] = chiral_locs(emission, excitation, lim, col3)
%plots and labels theoretical chiral locations based on input
%returns two Nx2 matrices: chiralWavelength stores all the emission and
%excitation points, chirality stores the chiral index associated with each
%plotted point
z=1;
for i... |
% calculate log-likelihood of SBM
% sample
n = 16;
n11 = 8;
n12 = 8;
n21 = 8;
n22 = 8
p = [0.4 0.2; 0.2 0.4];
pMatrix = [p(1,1)*ones(n11) p(1,2)*ones(n12); ...
p(2,1)*ones(n21) p(2,2)*ones(n22)]
A = rand(n)<pMatrix
% log-likelihood for SBM
likA = (pMatrix.^A).*(ones(n)-pMatrix).^(ones(n)-A)
loglikA = A.... |
% This program tries to form a line using chapter 1 assumptions
%There is llimited sensor range thus there can be no cardinal number
%assigning
clear
close all
clc
%% Initialisation
% Parameters deciding number of bots
num_leader=2;
num_follower=15;
num_total=num_leader+num_follower;
agent(num_total)=agent_b... |
clear; clc; clf;
delete(findall(0,'Type','figure'))
%% Import data from text file
% Script for importing data from the following text file:
%
% filename: /Users/leonardo/Google Drive/PhD/MATLAB/Research/dpc_regioni.csv
%
% Auto-generated by MATLAB on 16-Aug-2020 16:02:02
% Setup the Import Options and import the d... |
t = [-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11];
y = [ -6 -5 -6 -5 -4 -5 -3 -4 -3 -1 -3 -2 -1 -2 -3 -1 1 0 1 2 1 2];
z = Spline3_Coef(t,y);
Xs = linspace(-10,11,100);
Ys = double.empty(length(Xs),0);
for i=1:length(Xs)
Ys(i) = Spline3_Eval(t, y, z, Xs(i));
end
plot(Xs, Ys);
grid ... |
% Returns the left, bottom, width and height to use to center a window of the given size on the indicated or main screen.
% Copyright (c) 2012 Howard Hughes Medical Institute.
% All rights reserved.
% Use is subject to Janelia Farm Research Campus Software Copyright 1.1 license terms.
% http://license.janelia... |
classdef cStateClass < handle
properties
Q
E
rho
rhou
e
u
p
a
H
g
end
methods
% cStateClass constructor
function obj = cStateClass(numpt, g)
obj.Q = zeros(3*numpt, 1);
... |
%Works Local v2.1
classdef Cell
%UNTITLED2 Summary of this class goes here
% Detailed explanation goes here
properties
MaxX
MaxY
MaxZ
MinX
MinY
MinZ
XPoints
YPoints
ZPoints
end
methods
function obj ... |
function remove_frames(fileName, n, verbose)
% remove_frames(fileName, n)
% Remove dummy volumes from beginning of given file.
%
% Inputs:
% fileName - full path to file for which to remove dummy volumes
% n_dum - number of dummy volumes to remove (from beginning)
%
% Outputs:
% none
%
% requires: readFileNifti, write... |
function [ mathInfo ] = interface_prepareMathData( precursors, indicators, x, y, nx, ny, totalCells, prepareDataInfo, ...
optimizerValues, optimizerCondition)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
% final version: from external file...
if (prepareDataInfo.isCoded)
stringT... |
%% This is a demo showing how to use this toolbox
% Copyright by Quan Wang, 2011/05/10
% Please cite: Quan Wang. Kernel Principal Component Analysis and its
% Applications in Face Recognition and Active Shape Models.
% arXiv:1207.3538 [cs.CV], 2012.
clear;clc;close all;
load data.mat;
d=2;
%... |
## Copyright (C) 2021 Robertson
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is dist... |
function centroid = calcCentroid(coords, weights)
% calculate centroid with given coordinates and weights
% default weights = [ 1,1,1,...,1], i.e. average
if nargin<2
weights = ones(size(coords,1),1);
end
norm_weights = weights./sum(weights);
centroid = sum(coords.*repmat(norm_weights(:),1,size(coords,2)),1);
end |
%this is a code for jointly non-blind deblurring ande destriping for
<<<<<<< HEAD
%real data
=======
%simulated data
>>>>>>> 79b7b7b88e8b3cfe379b2c435dbbd56f66658257
clc; clear all; close all;
addpath(genpath('Images\'));
addpath(genpath('psfestimation\'));
addpath(genpath('destriping\'));
addpath(genpath('PROPACK\'))... |
load('svm_result3.mat');
gamma = [2^-11, 2^-9, 2^-7, 2^-5, 2^-3, 2^-1, 2^1, 2^3, 2^5, 2^7, 2^9, 2^11, 2^13, 2^15, 2^17, 2^19, 2^21];
C = [2^-4, 2^-1, 2^1, 2^3, 2^5, 2^7, 2^9, 2^11, 2^13, 2^15, 2^17, 2^19, 2^21, 2^23, 2^25, 2^27, 2^29];
num_g = numel(gamma);
num_c = numel(C);
% Z = zeros(num_c, num_g,1);
%
% Z(1:8,1... |
% book : Signals and Systems Laboratory with MATLAB
% authors : Alex Palamides & Anastasia Veloni
%
%
%
% State Space model construction
%from Transfer Function
num=[1 1.5 2];
den= [1 2.5 1.5];
sys=tf2ss(num,den);
% second way
[A,B,C,D]=tf2ss(num,den)
impulse(A,B,C,D);
legend('h(t) fro... |
clear all; close all; clc;
imdir = './ourBSD/train';
imagefiles = dir([imdir, '/*.jpg']);
npatches = 50000; %number of patches required
insize = 33; outsize = 21; % input-output patch sizes
inhalf = floor(insize/2);outhalf = floor(outsize/2);
inoutdiff = insize - outsize;
wavelet = 'db9'; % wavelet choice
i = 1;
in = ... |
% Requires k-wave library
freq = 5e3; % Source frequency [Hz]
source_to_slit = 0.2; % Distance from source to lens [m]
Nx = 256; % Number of grid points in x (longitudinal) direction
Ny = 160; % Number of grid points in y direction
Nz = 160; ... |
% Projects the depth values onto the RGB image.
%
% Usage:
% imgDepth = imread('raw_clips/bedroom_0001/d-12942.665769-31455701.pgm');
% imgDepth = swapbytes(imgDepth);
% rgb = imread('raw_clips/bedroom_0001/r-12941.6324869-2938947.ppm');
%
% [depthOut, rgbOut] = project_depth_map(imgDepth, rgb);
%
%
%
% Arg... |
%% Clearup
clear all; clc
%% Daten laden
a = [0.2e-3, 0.375e-3, 0.55e-3];
v = [16e-3, 108e-3, 200e-3];
p = [1000, 2000, 3000];
completeData{1} = xlsread('fminSummary.xlsx', '50Osci', 'B2:F28');
completeData{2} = xlsread('fminSummary.xlsx', '70Osci', 'B2:F28');
completeData{3} = xlsread('fminSummary.xlsx', '100Osci', ... |
function [mz] = java_enr_combinations()
global cs;
mz = cs.enr_combinations();
cs.min_btfax_env=100;
end
|
% Copyright 2018, by the California Institute of Technology. ALL RIGHTS
% RESERVED. United States Government Sponsorship acknowledged. Any
% commercial use must be negotiated with the Office of Technology Transfer
% at the California Institute of Technology.
% -----------------------------------------------------------... |
function revertMask(F, inMode, outMode)
% this function is used to revert the mask if it was not RAS
load(F.tag('mask')); % get mask
save([F.tag('mask') '_old_' inMode], 'mask'); % backup
% transpose mask
t = getTransformation(inMode, outMode);
mask = applyTransformation(mask, t);
save(F.tag... |
function GraphMatchedDrug
loadpaths
load graphdata_subjlist_wpli
randgraph = load('graphdata_subjlist_rand_wpli');
load grp2.mat
weiorbin = 3;
trange = [0.5 0.1];
fontsize = 12;
bands = {
'delta'
'theta'
'alpha'
'beta'
'gamma'
};
graphmeasures = {
'small-worldness ind... |
function probstruct = problem_ccn17(prob,subprob,noise,id,options)
% Problem names (ordered)
problist{1} = 'visvest_joint';
problist{10} = 'vandenberg2016';
problist{20} = 'adler2016';
problist{30} = 'goris2014';
problist{40} = 'vanopheusden2016';
problist{50} = 'targetloc';
% Initialize problem structure
if ischar(... |
addpath svm
% Generate data
Nc = 500; % data points *per class*
d = 2; % dimension
K = 3; % number of classes
X = []; Y = [];
% Set mean of class k to 2*k*ones(N,1)
for k = 1:K
mu = 2*k*ones(1,d);
S = randn(d);
S = S*S';
% S = S/det(S);
S = d*S/trace(S);
X = [X ; mvnrnd(mu, S, Nc)];
... |
function deltaV = dataRead()
%% ASEN 2004 - Rocket Bottle Lab
%{
Authors: Jashan Chopra (107689146)
Date Created: April 4th, 2019
Script Purposes and goals:
1) Read static test stand data
2) edit data to appropriate ranges
3) automate the data curtailing process
4) output data to matrix for statistica... |
clear all;
close all;
%% Initialisation des variables
f_e = 20E6; % fréquence d'échantillonnage 20MHz
T_e = 1/f_e;
D_s = 1E6; % débit symbole 1MHz
T_s = 1/D_s;
f_se = T_s/T_e;
N_fft = 512; % nombre de points pour... |
function [xb,yb]=DrawBoundary(x,y,z)% 画边界多边形
xb=[];yb=[]; % 边界多边形拐角点
figure('NumberTitle','off','Name','请画出边界多边形','Color','White')
title('请{\color{red}逆时针}画出边界多边形的拐角点(左键画点,右键取消),画完后关闭界面')
% set(gcf,'Pointer','cross') % 十字鼠标指针
hold on
if nargin == 3
s... |
%% Localize TurtleBot Using Monte Carlo Localization
rosshutdown
clear
% Start and goal in meters
start = [1 1];
goal = [5 5];
% Gera o Binary Occupancy Grid do espaco modelado do LaSER
map = createOccupancyGrid ('laser2.png', 2);
% show(map);
% Adjust start and goals to map resolution
start = start * map.Resolutio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.