text stringlengths 8 6.12M |
|---|
function [x, w] = gaujac(a,b,n)
% Returns abscissas and weights for the Gauss-Jacobi n-point quadrature
% over the interval [a, b] using the Golub-Welsch Algorithm.
k=1:n;
c=2*k+a+b;
D=(b^2-a^2)./(c.*(c-2)+(b^2==a^2));
E=2./c.*sqrt(k.*(k+a).*(k+b).*(k+a+b)./(c.^2-1));
[x,V]=trideigs(D, E);
w0=2^(a+b+1)*gamma(a+1)*gam... |
function [t, u] = midisplingen(t0, T, N, a, b, pqr, C0, C1)
% Generalizado con condiciones tipo Robin (Ci == 2)
% x'(t0) + a(1)x(t0) = a(2) (C0 == 2)
% x'(T) + b(1)x(T) = b(2) (C1 == 2)
% Elegimos los valores iniciales para v1 y v2 en función de C0.
% Estos datos se obtienen cambiando la condición en T (*) por otra ... |
function dst = invSE3(src)
% INVSE3 Inverse of a matrix belonging to the special Eucliden group.
%
% Syntax: dst = invSE3(src)
%
% Inputs:
% src - 4 x 4 matrix in SE(3)
%
% Outputs:
% dst - Inverse of mat
%
% Other m-files required: none
% Subfunctions: none
% MAT-files required: none
%
% Author: Gabriel Mo... |
function y = isInRange(x,lower,upper)
y = (x >= lower) & (x <= upper);
end
|
function mm_surface_searchlight(SID);
% h = waitbar(0,'Initializing waitbar...');
% function gen_searchlight(spm_file, mask_file, varargin);
matlabpool open
addpath('/home/pbeukema/r2d4/bin/');
addpath('/home/pbeukema/modMap/bin/');
addpath('/home/pbeukema/r2d4/subjects/');
addpath('/home/matlab/8.1/toolbox/spm/spm8... |
clear;clc;close all;
name = 'Balance.txt';
[X,Y] = readDataForClassification(name);
X = normalize(X);
[train,test,trainL,testL] = divideTestTrain(X,Y,name);
dimension = 2; % Embedding dimension
% dDR
[embedingX,embedingTest] = dDR(train,test,trainL,dimension);
dDR_E = classifier(embedingX,embedingTest,t... |
%%
% Blog reader Ramiro Massol asked for advice on segmenting his cell images, so I
% gave it a try. I'm not a microscopy expert, though, and I invite readers
% who have better suggestions than mine to add your comments below.
%
% Let's take a look first to see what we have. I'm going to work
% with a cropped versi... |
clc; clear; close all;
% Delta Modulation
function [y, MSE]=Delta_Modulation(del, A) %del=step size, A=amplitude of signal
T=0:2*pi/100:2*pi;
x=A*sin(T);
plot(x)
hold on
y=[0]; %y=output binary sequencexr=0;
for i=1:length(x)-1
if xr(i)<=x(i)
d=1;
... |
function out = get_funds( in, wid )
%
%fonction array_out = get_funds( array_in [, wid ] )
%
% Recherche toutes les frequences qui ne sont pas
%multiples d'une autre dans le tableau 'array_in'. On
%considere qu'une frequence f est multiple de f0 si
%existe n entier tel que:
% abs( f0 - f/n ) <= ... |
function idx = f_balance(grps)
% - get indices of elements to create a balanced design
%
% USAGE idx = f_balance(grps);
%
% grps = vector of integers specifying group membership
% idx = index of elements for a balanced design
%
% SEE ALSO: f_randSub
% -----Notes:-----
% The purpose of this function is to assist the u... |
function x=rnd(y)
%a value less then 0 interpretad as 0
y(y<0)=0;
%a value greater then 9 interpretad as 9
y(y>9)=9;
% a value between zero and 9 rounded to nearest integer
x=round(y);
end |
%
% Run tests
%
addpath(genpath(strcat(pwd, '/../')));
import matlab.unittest.TestSuite;
ObjectDetection = TestSuite.fromClass(?CircleDetectionTests);
MarkerLocator = TestSuite.fromClass(?MarkerLocatorTests);
TurtleBot = TestSuite.fromClass(?TurtleBotTests);
PoseCorrection = TestSuite.fromClass(?PoseCorrectio... |
function [FileNames] = MLEMNameFiles(MLEM)
for i = 1:MLEM.nSims
FileNames.SurfaceCard{i,1} = strcat('Matrix',num2str(MLEM.nNewSystemMatrix),'Location',num2str(i),'SurfaceCard.txt'); %Temporary file for examining surface output
FileNames.CellCard{i,1} = strcat('Matrix',num2str(MLEM.nNewSyst... |
function [bestGMMMin] = MR_EM_timed(data, maxClusters, maxTime)
%Multiple Runs of Expectation Maximization using MDL as model selection criteria running for a specified number of minutes
tIni = tic;
bestMDL = realmax;
nObj = size(data,1);
EMSteps = 0;
bestGMMMin = {};
opts = statset('MaxIter',10000000);
while true
k... |
function modifyPasswd(~,~,hTip)
set(hTip,'Visible','on','string','contact developer!');
pause(3);
set(hTip,'Visible','off'); |
% script for analyzing new calcium data
% assumes data already loaded in from ROI_data_cleansed.mat
% only for lw76
tokens=regexp(pwd,filesep,'split');
bird_name=lower(tokens{end});
movie_fs=100;
motif_selection=[2];
plot_data=true;
%load custom_colormaps;
%% arrange the data into a simpler format
if strcmpi(bird_... |
function [y]=recursive_ifft_help_3(a)
% 傅立叶逆变换,a的长度必须为3的幂次
n=numel(a);
if n==1
y=a;
return;
end
wn=exp(-2*pi*1i/n);
w=1;
a1=a(1:3:n-2);
a2=a(2:3:n-1);
a3=a(3:3:n);
y=zeros(n,1);
y1=recursive_ifft_help_3(a1);
y2=recursive_ifft_help_3(a2);
y3=recur... |
function writeSEL(filename,S)
% writeSEL selection from .sel file (as used by Mario Botsch and Olga
% Sorkine in the accompanying data to their survey "On linear variational
% surface deformation methods"
% http://igl.ethz.ch/projects/deformation-survey/
%
% Input:
% filename path to .sel file
% S... |
function [criterion, ms, significant, m1, m2, oracle,labels ] = criteriaDiscriminant(trainX2,trainY2,testX,testY)
%CRITERIAFUN Summary of this function goes here
% Detailed explanation goes here
LabelsY=categorical(trainY2(:,3));
%trainX2 = normalize(trainX2);
% 'Delta',0,...
% 'DiscrimType','pseudoquadratic'.... |
% cspinf21 -- Thresholding Translation-Invariant Table of Blocks
%
% Here we display Stationary Wavelet Transform.
% Object Noisy[Blocks]
% S8 Wavelet
% Thresholded
% Remark: run CycleSpinInit and cspinf20 before this.
%
% Agenda: %
%
global N
global Noisy_Stat_Table
%
thr = sqrt(2* log(N));
%
figure;
[nrow,... |
function [rpy] = exp2rpy(expcood)
%UNTITLED 此处显示有关此函数的摘要
% 此处显示详细说明
wh=[0,-expcood(3),expcood(2);expcood(3),0,-expcood(1);-expcood(2),expcood(1),0];
R=eye(3,3)+ wh*sin(expcood(4))+ wh^2 *(1-cos(expcood(4)));
pitch=atan2(-R(3,1),sqrt(R(3,2)^2+R(3,3)^2));
if abs(pitch-pi/2)>1e-4
yaw=atan2(R(2,1)/cos(pitch),R(1,1)/c... |
function out = lab1_newton_raphson()
%Global Equation ax^2 + bx + c
global a b c;
% a = 1;
% b = 0;
% c = -1;
a = input('Enter A in Ax^2 + Bx + C');
b = input('Enter B in Ax^2 + Bx + C');
c = input('Enter C in Ax^2 + Bx + C');
out = solve_quadratic(-10,0.01);
end
func... |
function [cl,cd] = bpolar(BladeState,AC)
% To make your own bpolar:
% BladeState is the state of the blade element with matrix components:
% BladeState =
% M: Mach number
% alpha: angle of attack (radians)
% r: radius location (nondimensional)
% psi: azimuth location (radia... |
function fir_resp = gen_fir_resp(K = 95, Fp_div_Fs_2 = 0.08, ...
output_file = 'fir_coeffs.txt', do_plot = 0)
addpath([ pwd(), '/../toolbox/' ]);
Rp = 0.00057565; % Corresponds to 0.01 dB peak-to-peak ripple
%Rp = 0.057565; % Corresponds to 0.01 dB peak-to-peak r... |
% Question 2.4 and Question 2.5
clear all;
clc
Image_b=imread('PS3_b.jpg');
Image_a=imread('PS3_a.jpg');
u1=[880;
43;
270;
886;
745;
943;
476;
419;
317;
783;
235;
665;
655;
427;
412;
746;
434;
525;
716;
602];
v1=[214;
203;
197;
347;
302;
128;
590;
214;
3... |
function [pm shift]=nest(interm,outp,nltype,Starting)
%[pm shift]=nest(interm,outp)
%estimate a nonlinear instantaneous i/o relationship
%
%currently only works for pow3
%f(x)=a(x-x0)^p
%params=[a p x0];
%x0 is fixed to be min(interm);
%a and p are estimated using pow2fit and pow2fn
%
%Saul Kato
%120710
%if interm and... |
n = 2.^[7:10];
tmldivideb = zeros(length(n),1);
for i=1:length(n)
L = tril( rand( n(i) ) );
b = rand( n(i), 1 );
f = @() mldivide( L, b );
tmldivideb(i) = timeit(f,1)
end |
%%
% This file defines the function `myfct1`
%
% The "function" line defines:
% - the name of the function (`myfct1`)
% - the name of the input variable (`x`)
% - the name of the output variable (`y`)
% Those names can be nearly anything!
%
function y = myfct1(x)
fprintf("My input variable is %f\n",x);
a = 1;
y = x^... |
function [ rho ] = problem_H_Jacobianspectralradius(q,quadpoint,appdata)
rho = abs(appdata.nuh);
end
|
function uofn = u(n)
uofn = 0;
if(n >= 0)
uofn = 1;
endif
end |
% CS 5810 -- Programming for data analysis
%
% Assignment 3 | Prof. Alberto Paccanaro
%
%
%
% Insert BELOW your code
% 1. open the file and read using the fscanf
% 2. if entered input n is greater than column size of opened file, then it
% is error . 3. if not, generate random numbers using randi and now using
% ... |
% The following are extracts of outdated features of various subroutines of
% the PTES code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% VISUALIZATION OF HEX T-Q DIAGRAM
if WM==1 && fignum~=0
% Set Cp and enthalpy arrays
[TvH,CpvH,hvH] = hex_get_prop(fluidH,TC1,TH2,n);
[TvC... |
%{
* Script desarrollado por:
* Juan Martin Loyola
* Universidad Nacional de San Luis
* 2015
%}
%{
* Script en matlab utilizado para obtener informacion de los distintos
dataset.
* Todas las variables interesantes son almacenadas en archivos .mat para
luego utilizarlos para hacer las graficas.
%}
%% Antes de ... |
function aff_mat = modularity_affinity(adj,labels)
n = size(adj,1);
deg = sum(adj,2);
twicem = sum(deg);
m = twicem/2;
clusters = unique(labels);
k = length(clusters);
aff_mat = zeros([n,k]);
for v = 1:n
for i = 1:k
c = clusters(i);
labels_copy = labels;
labels_copy(v) = c;
mem = find(labels_copy=... |
%% The dynamic model with consider the heat...
% expansion of bearing elements
% shane 2019/11/26
%% …………………………华丽的分隔线…………………………%%
clc
clear
close all
global alfa A Zn F K_oj K_ij f D omega_i m I dm Q_1j...
Q_2j alfa_i alfa_o Ic omega_Rj omega_cj dF
%% 参数输入
% f=[0.523 0.523];%沟道曲率
dm=53.9; %节... |
function xClean = inductionAndLowFrequencyNoizeSuppression(x,fs)
% xClean = inductionAndLowFrequencyNoizeSuppression(x,fs)
% designedn and coded by Hideki Kawahara
% 22/April/2013 at Jena
xClean = x;
boundaryFrequency = 70; % in Hz, definition of low frequency region
decisionMargin = 10; % in dB
fftl = 2^ceil(l... |
% cemVE11.m
% 23 april 2016
% Ian Cooper
% School of Physics, University of Sydney
% https://d-arora.github.io/Doing-Physics-With-Matlab/
% Computation of the electrical potential from the line
% integral of the electric field
clear all
close all
clc
tic
% ======================================================... |
function x = LFSRs(n=10,N= 1e5, v0=1, v1=-1)
x=zeros(N,1);
sr=ones(n,1);
for i = 1:N
switch(n)
case 10
in= xor(sr(10),sr(7));
case 11
in = xor(sr(11), sr(9));
case 12
in = xor(xor(sr(12), sr(11)), xor(sr(10), sr(4)));
case 13
in = xor(xor(sr(13), sr(12))... |
function [UV,F, res, edge_norms] = create_irregular_grid( xRes, yRes, varargin)
% Creates random UV positions and their connectivity information guaranteeing
% min angle by wrapping trianlge (http://www.cs.cmu.edu/~quake/triangle.html)
%
% [V,F] = create_irregular_grid(xRes,yRes)
% [V,F] = create_irregul... |
for i = 1:height(DCM.M.pC.A)
for k = 1:width(DCM.M.pC.A)
if DCM.M.pE.A(i,k,1)~=0.0078
DCM.M.pC.A(i,k,1)=0;
end
end
end |
% This file will find the bursts from the spike train based on the burst
% threshold.
% input data: stimes for spike train, cut for the criteria of isi for
% burst,i for the ID of the neuron
function [bursts] = findbursts(stimes, cut)
threshold = 10^cut;
isi = diff(stimes);
tmax = max(stimes);... |
classdef PM100 < Modules.Driver
% Interface to Thorlabs PM100 power meter
% Inspired from code by: Michael Walsh (mpwalsh@mit.edu) 2014
properties
channel;
id;
unit_status = 'MW';
end
methods(Access=private)
function out = communicate(obj,msg,output)
... |
function run_calcps2(theta)
%
%functia calculeaza parametrul a1 pentru diferite valori ale diametrului
%experimate in nm.
%
[indref,lambda,tcelsius,garb]=initconst1;
for i=1:2000
rez(i,1)=i;
[tmp,rez(i,2)]=calcps1('g', 6, 10, i, theta, lambda, indref, tcelsius, 0, 'jpg');
end
save(['diametre_a1_',num2... |
function [interv_cells,center_frequencies] = subdivide_audio_matrix(audio_matrix,intervals,audio_sample_rate)
%SUBDIVIDE_AUDIO_MATRIX Subdivides an audio matrix into intervals of
% smaller audio matrices using a bandpass filter and returns an array of the
% filtered signals
interval_number = intervals;
% minimum absolu... |
% Suha Kwak, Inria-Paris, WILLOW Project
%% -------------------------------------------------------------------------
% Configurations
% target classes
% classes = {'aeroplane', 'bicycle', 'boat', 'bus', 'horse', 'motorbike'};
classes = {'bicycle'};
nclass = length(classes);
% target views (object poses)
% views ... |
close
clear
% bus:23, car:12, ferry:20, metro:10, train:21, tram:56
type={'bus';'car';'ferry';'metro';'train';'tram'};
lengarr=[23,12,20,10,21,56];
for typeidx=1:length(type)
t=cell2mat(type(typeidx));
dir = strcat('./results_HSDPA/results_',t);
cd(dir);
leng=lengarr(typeidx);
datatot=zeros(7,0);
... |
classdef GaussDist < ProbDist
properties
mu;
sigma2;
productDist;
prior; % for MAP estimation
end
%% Main methods
methods
function m = GaussDist(varargin)
% GaussDist(mu, sigma2, productDist)
% Note that sigma2 is the variance, not the standard deviation... |
% International Standard Atmosphere Data @ Sea Level.
% SI (International System of Units) is used.
% [h]=m [T]=K [p]=Pa [rho]=kgf/m^3 [g]=m/s^2 [R]=J/kg K
h1=0;
T1=288;
p1=101325;
rho1=1.225;
g=9.81;
R=287; |
DATA=load('analiza.txt');
X=DATA(:,1:17);
Y=DATA(:,18);
%%
CVMdl = fitcnb(X,Y,'Holdout',0.30,...
'ClassNames',{'0','1'});
CMdl = CVMdl.Trained{1};
testIdx = test(CVMdl.Partition);
XTest = X(testIdx,:);
YTest = Y(testIdx);
idx = randsample(sum(testIdx),10);
label = predict(CMdl,XTest);
table(YTest(idx),l... |
clear all;
close all;
MU1 = [5 10];
SIGMA1 = [8 0; 0 4];
MU2 = [10 15];
SIGMA2 = [8 0; 0 4];
R1 = chol(SIGMA1);
R2= chol(SIGMA2);
X1 = repmat(MU1,200,1) + randn(200,2)*R1;
X2 = repmat(MU2,200,1) + randn(200,2)*R2;
SIGMA1 = cov(X1);
SIGMA2 = cov(X2);
range1 = [-5:0.1:20]
range2 = [-5:0.1:20]
figure;
title('Mean-b... |
% reglage tracking simulé injection 113.4 MeV
kf0=1.178 ; % gradient pour 6.78/4.72
kd0=0.938;
Grf = 0.0610 ; % gradient remanent T/m
Grd = 0.0600 ; % gradient remanent T/m
a = 0.0517 ; % G/I T/m/A
Br = 0.0020 ; % Champ remanent T
b = 0.00135416 ; % ... |
function x = merl_quadprog(varargin)
% MERL_QUADPROG Optimize problems of the form:
%
% min_x 1/2 x' Q x - x' h
%
% s.t. x>=0
%
% According to the method described in "PARALLEL QUADRATIC PROGRAMMING FOR
% IMAGE PROCESSING" [Brand & Chen 11]
%
% x = merl_quadprog(Q,h,'ParamterName',ParameterValue)
... |
function [v_world] = convToWorld(q,v)
v_world = qmult(q,qmult([v;0],[-q(1:3);q(4)]));
v_world = v_world(1:3);
end |
global_settings;
win0 = Screen(0,'OpenWindow',settings.BACKGROUND_COLOR,settings.screenRect,settings.COLOR_DEPTH);
winnoise = Screen(win0,'OpenOffscreenWindow',settings.BLANK_SCREEN_COLOR,settings.screenRect,settings.COLOR_DEPTH);
%matrix_noise = ones(settings.SCREEN_X, settings.SCREEN_Y);
matrix_noise = ones(8... |
%% groupActivationOneSampleT
% Daniel Elbich
% Cognitive Aging & Neuroimaging Lab
% 7/24/19
% This script creates a group-level contrast of maps created from
% createContrasts.m.
%
% See also: estimateModel.m, createContrasts.m
%% User Input
% You should ONLY (!!!!!!) need to edit this highlighted section of the
... |
clc, clear all, close all
width = 1;
angleArgs = {'k-','linewidth',width};
textArgs = {'horizontalalignment','center'};
legendArgs = {'orientation','horizontal','location','north'};
%% non-concentric
tt = pi/6;
t = tt/2;
k = (1+sin(t))/(1-sin(t));
d1 = 1;
r1 = sqrt(2)/2 * sqrt(1-cos(tt))*d1;
d2 = k*d1;
r2 = k*r1;
p1... |
function fitResult = fittedIFMprofile(ifm, fitType, sigmaGuess, amplitudeGuess)
if nargin<2
fitType = 'gauss';
end
if nargin<3
sigmaGuess = 100; %typical for naomi
end
if nargin<4
amplitudeGuess = 7; %typical for naomi
end
[nAct, ~, ~] = size(ifm);
ampl... |
clc;
close all;
clear all;
%open loop values
open_freq = [0.01 0.1 0.5 1 5 8 10 13 15 18 20 25 30 50] * 1e3;
open_v_in = [120 120 120 120 120 120 120 120 120 120 120 120 120 120] * 1e-3;
open_v_out = [13.0 13.0 13.0 13.0 12.0 8.4 6.4 4.0 3.0 2.2 1.7 1.1 0.7 0.2];
open_v_in_distortion = [270 250 250 250 300 670 610 720... |
function [W,eigval]=pca(x,n)
% PCA - Principal Component Analysis
%
% [W,eigval]=pca(x,n)
%
% W = matriz cuyas filas son los autovectores de la matriz de covarianza
% eigval = vector columna de autovalores ordenados descendentemente
%
% x = matriz de patrones
% n = numer... |
function [meanf1] = calculatemeanf1(resultDir, gtDir, segmentationType, numberofComparasions, shift)
resultFolder = resultDir;
gtfolder = gtDir;
f1 = 0;
for i = 1:numberofComparasions
imfile = ['test_' segmentationType '_' '00' int2str(1200+i) '.png'];
gtfile = ['gt' '00' int2str(1200+i+shift) '.png'];
... |
close all
clc
clear
%% Load data
if ispc == 1;
filedir = 'C:\CommonData\EVOO\';
filename = 'EVOOLarge_TraditSTE_15mDEL_5Feb2016_result_result.tnt';
elseif ismac == 1;
filedir = '/Users/jaredking/Documents/Chemistry/Research_Files_and_Data/CHIRP/';
filename = '/Users/jaredking/Documents/Chemi... |
% Ejemplo de filtrado en frecuencias usando Transformada de Fourier en 1D
% D.Mery, Sept. 2010-2012
% probar con distintas senhales s1, s2, s3, s4
% PUC-DCC, http//dmery.ing.puc.cl
Fs = 50000;
N = 200000;
t = (0:N-1)/Fs;
pit = 2*pi*t;
figure(1)
clf
a = [1 2 3 4];
w = [1 1 1 1];
w1 = w(1); f1 =... |
function W = logisticReg(X,y,W,ita,iterations)
[rows,cols] = size(X);
grad = zeros(rows,cols);
for j=1:iterations
%method 1,slower
% for i=1:rows
% grad(i,:) = (sigmoid(-y(i)*X(i,:)*W)) * (-y(i)*X(i,:));
% end
% W = W -(ita*sum(grad,1)/rows)';
%method 2,faster
grad ... |
function s = thc_dls(p,t)
%THC_DLS - Theis dimensionless drawdown with a constant head boundary
%
% Syntax: s = thc_dls(p,t)
%
% p(1) = r1/r2
% with r1 = radius to the pumping well
% and r2 = radius to the image well
%
% provides the dimensionless drawdown at reduced time t
%
% See also: thc_dim, thc_lap
... |
function [symDH] = genDHTable(a, d, alpha, theta)
%UNTITLED9 Summary of this function goes here
% Detailed explanation goes here
%Assign the variables to symbolic parameters
symThetas = sym('Theta',[1, length(theta)]);
symThetas = transpose(symThetas);
symD = sym('D',[1,length(d)]);
symD = transpose(symD);
%Create a... |
function y = addZeros(vec,n)
rest = mod(length(vec),n);
toadd = n-rest;
toadd = toadd;
additional = [];
if rest ~= 0
additional = zeros(1,toadd);
end
y = [vec, additional];
end |
%Se establece el formato numérico
format longG
%Se aplica el método de Heun de Orden 2 al Modelo de Malthus
[x,y] = Heun_Pvi_Sistemas('funcion_malthus',0,10,10,150)
%Se aplica el método de Runge-Kutta de Orden 4 al Modelo de Malthus
[x,y1] = RK4_Pvi_Sistemas('funcion_malthus',0,10,10,150)
%Se aplica el método de ... |
% Ejemplo del comando SVD
clc; clear; close all
pkg load image
% Cargar la imagen
file = input("\nWrite the image path (press enter to default image):\n\n>", "s");
if strncmp (file, '', 3)
file = 'files/img1.jpg';
endif
I_color = imread(file);
A = I_color(:,:,1);
% Almacenar la imagen A (8-bits) en un archivo .... |
%Co-variance Computation for a Cluster
function [COVAR] = Cluster_Covariance(Data)
[r,c] = size(Data);
for i=1:r
COVAR(i) = var(Data(i,:));
end;
end; |
function y=R3(gamma)
y=[cos(gamma) sin(gamma) 0;...
-sin(gamma) cos(gamma) 0;...
0 0 1]; |
function A2 = Latex(A)
% A2 = Latex(A) outputs matrix A in LaTeX form, leaving out zeros,
% and returns the actual matrix that was output.
[m, n] = size(A);
disp(' \left[');
disp([' \begin{array}{*{' num2str(n) '}{r}}']);
% Figure out whether or not column contains only integers.
int = ones(1, n);
for j = 1:n
fo... |
function [M,E,EMAP] = crouzeix_raviart_massmatrix(V,F)
% CROUZEIX_RAVIART_MASSMATRIX Compute the Crouzeix-Raviart mass matrix where
% M(e,e) is just the sum of 1/3 the areas of the triangles on either side of
% an edge e. For tets, edges are now faccets.
%
% See for example "Discrete Quadratic Curvature Energ... |
function [v, w, iter] = RBFLM2(x, y, c, gamma, p, eta, epsilon)
% function [v, w, iter] = RBFGrad(x, y, c, gamma, m, eta, epsilon)
% Radial basis function training using linear generator functions
% and gradient descent.
%
% INPUTS
% x = training inputs, an ni x M matrix, where
% ni is the dimension of each input... |
function morphingRecord = ...
makeMorphingContinuum(outFileDirecotry,outFileRootName,nOfSteps,expansionRate)
% 06/Oct./2015 R2015b compatibility fix
% Author: Hideki Kawahara
[file,path] = uigetfile('*.mat','Select morphing substrate for A-end');
if length(file) == 1 && length(path) == 1
if file == 0 || p... |
% This script creates all the necessary matrices for problem 3.
% Then calculates the new points based of off the given points and passes
% them into the given function, plotsquare.m
%3.1: No rigid body transformation%
K = eye(3);
E = eye(4);
IO = eye(3,4);
AP1 = K * IO * E * [-1; -0.5; 2; 1];
AP2 = K * IO ... |
%%
Ts_traj_gen = 0.0001;
%%
max_acc = 2; % m/s^2 |
clc;
clear all;
%% initialization
%age_init = [0,abs(randn),abs(randn),abs(randn)];
age_init = [0,0,0,0];
%base = [0,0];
poi_coord = [0,0;0,5;3,5;3,0];
poi_no = 4 % base+three sensors
policy = [1,2,1,3,4,1];
vel = 0.5;
lambda = [0;1/3;1/11;1/5];
for i = 1:poi_no
update_time(i) = 1/lambda(i);
deadline(i) = 1/... |
function err = naivePerfusionSSEIntegratorP2X4StackDeMix5alt(ton,toff,Ttot,amp,T,I)
%#codgen;
naive=getNaiveP2X4StackDeMix5alt();
V=-60*10^-3;
err=errorIntegratorP2X4StackDeMix5alt(ton,toff,Ttot,amp,naive,T,I,V);
end |
function[slicer,slicec,lcdmapccd]=optimizeqiepian3(fringepath,prjX,prjY,xmin,xmax,ymin,ymax,fx)
%The last parameter is the center frequency of the phase-shifted fringe
slicer=(phaseunwrap2(fringepath,xmin,xmax,ymin,ymax,fx,0));%0Ϊrow 21*21
slicec=(phaseunwrap2(fringepath,xmin,xmax,ymin,ymax,fx,1));
slicer=roun... |
% BCG_Correction_Assessment_PowerSpectrum() - perform BCG artefact correction
% quantification as the average spectral power within artefact and
% physiological representative windows
%
% Author: Rodolfo Abreu, ISR/IST, Universade de Lisboa, 2015
function [ power, power_bkg ] = BCG_Correction_Assessment_PowerSpectrum... |
%function cll
x=questdlg('Close Clear all?');
if strcmp(x,'Yes')
close all force
% clear all
% clearvars
clear
end |
function Fx = robot_move_jx(x, u, wheelbase, dt)
%ROBOT_MOVE_JACOB Summary of this function goes here
% Detailed explanation goes here
% syms xx yy th v a w t real
% d = v * t;
% r = w / tan(a);
% b = (d / w) * tan(a);
% fxu = [xx - r * sin(th) + r * sin(th + b), yy + r * cos(th) - r ... |
function neighborList = getNeighborList(obj, treeIdx)
%Returns a list of neighbors of each node in a tree.
% INPUT treeIdx: Index of the tree of interest in obj.
% OUTPUT neighborList: Cell array of length number of nodes in
% tree with treeIdx. Each cell contains the indices
% of the neighbors of t... |
% 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 [net, info] = CNN_Tensor_Train_dag(imdb,varargin)
%% Training options (default), change from Main if needed
opts = struct();
% Number of channels
opts.nch = 1;
% Patch size
opts.patchsize = [256 256];
% Measurement rate
opts.MR = 0.1;
% DCT block size
opts.dctblsz = [8 16 32];
% Network directory
opts.expDir... |
function [q_start2half,qd_start2half] = InterpSeed1(obj, t1, q_start, q_end)
% -------------------- interpolate between t=0 & intm ------------------- %
q_start2half = zeros(numel(q_start), numel(t1));
qd_start2half = zeros(numel(q_start), numel(t1));
for m = 1:numel(q_start)
q_start2half(m,:) = q_start(m) + t1... |
function the_puzzle(typ)
% the_puzzle -- Interactive puzzle
%
% Type 'the_puzzle' start to the game. Run only one game at a time.
%
% On the board the gray squares represent 'pegs'. The black squares
% represent 'holes'. PC users will see 'holes' as a square marked 'X'.
% To make a move, click on a 'peg' one position a... |
function updateChessBoard(chessPaintBoard)
global chessBoard;
global chessRadius;
%global history;
global lastSetChess;
cla(chessPaintBoard);
oldGca=gca;
set(gcf,'CurrentAxes',chessPaintBoard);
for i=1:19
for j=1:19
if chessBoard(i,j)==1
circle(i,j,che... |
addpath 'C:\Users\Ashkan\UNB\Thesis\Projects\ACE\CLASSES'
clear
close all
clc
ACCandEMG = false; % true = ACC+EMG, false = EMG only
users{1} = '\Subjects\Old Data\Ashkan2_.USER';
repOrder{1} = [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ... |
function [ lat,long] = bizlocation( id )
%returns the location of the given business id
% Detailed explanation goes here
M = dataset('xlsfile','deleted-result-biz.csv');
M.business_id=nominal(M.business_id);
% id=nominal(id);
ds=M(eq(M.business_id,id),:);
% disp(ds);
lat=double(ds.latitu... |
function [LEDC LEDCGPQ]=p_Ledcons_propertyQ(clv,x,str,tol)
% P_LEDCONS_propertyQ checks whether an imputation x satisfies the
% ledcons property (consistency) using Matlab's PCT.
%
% Source: H. I. Meinhardt. The Modiclus Reconsidered. Technical report, Karlsruhe Institute of Technology (KIT), Karlsruhe, Germany,
% ... |
function[RFP_FTL_tracked_RGB_info F] = printLabels(ToShowRGB,Stats_new, show)
%RFP_FTL can be labelled in colors (RGB), 8/16 bits or mod with F
%levels (RFP_FTL_tracked_meanF)
RFP_FTL_tracked_RGB_info = zeros(size(ToShowRGB,1)*2,size(ToShowRGB,2)*2,size(ToShowRGB,3),size(ToShowRGB,4));
F(size(ToShowRGB,... |
%% Ascent Model
% Philip Linden
%% Assumptions
% * Helium in balloon behaves as an ideal gas
% * Atmosphere is homogenous and uniform composition at all altitudes
% * Atmosphere is a static fluid (no convection or winds)
% * Gas in the balloon is the same temperature and pressure as the
% atmosphere
% * Balloon main... |
clc, clear, close all
s = tf('s'); %Variable complejo
t=0:0.1:20; %Vector independiente
parabola=(1*t).^2; %Funcion PARABOLA
Ga = (30*(s+3)*(s+2)*(s+1))/((s)*((s+5)*(s+5)));
Galc = feedback(Ga,1,-1); %Sistema en lazo cerrado
[y,t]=lsim(Galc,parabola,t);%Respuesta a la ... |
function [mes]=imu(etat)
p= [etat(1);etat(2);etat(3)];
v= [etat(4);etat(5);etat(6)];
q= [etat(7);etat(8);etat(9);etat(10)]; qv= [etat(8);etat(9);etat(10)];
omega= [etat(11);etat(12);etat(13)];
wm= [etat(14);etat(15);etat(16);etat(17)];
vdot= [etat(18);etat(19);etat(20)];
R= eye(3)+2*q(1)*skew(qv)+2*skew(qv)^... |
function [xdata] = match_assign_prob(xdata,data,model,para,pathXdata)
% savePath = pathcat(pathMouse,'xdata.mat');
%% here, all cells that are not surely different are put together in ROI_clusters
for s = 1:data.nSes
for sm = s+1:data.nSes
for n = 1:data.session(s).nROI
neighbours = xda... |
function [descr, descr_im, param] = openFeature_box_once(param)
if ~isfield( param,'featFileList') || param.reboot
[param,featEmptyFileList] = createFeatFileList(param);
if sum(featEmptyFileList(:))~=0
param = generateAllFeatures(param,featEmptyFileList);
end
end
if param.box_for... |
function [] = leaning_report(x,y,nbins,tol,lags)
lenvec = laggedlean(x,y,nbins,tol,lags);
[truth,LIRpens,LIRleans] = LIR(x,y,nbins,tol);
fprintf('\n-------------------------\n');
fprintf('Lagged Leanings:\n');
fprintf(' [lag,leaning] :: guess\n');
for iter = 1:1:length(lags),
fprintf(' %i,%.7f :: ',lags(iter),l... |
function test_subplot_3D
%TEST_SUBPLOT_3D Test subplot 3D with DRAGZOOM
figure;
h1 = subplot(2,1,1);
[X,Y] = meshgrid(-3:.125:3);
Z = peaks(X,Y);
meshc(X,Y,Z);
axis([-3 3 -3 3 -10 10]);
h2 = subplot(2,1,2);
k = 5;
n = 2^k-1;
[x,y,z] = sphere(n);
surf(x,y,z);
dragzoom();
|
function [X,freq]=positiveFFT(x,Fs)
N=length(x); %get the number of points
k=0:N-1; %create a vector from 0 to N-1
T=N/Fs; %get the frequency interval
freq=k/T; %create the frequency range
X=fft(x)/N; % normalize the data
%only want the first half of the FFT, since it is redundant
cutOff = ceil(N/2);
%tak... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.