text stringlengths 8 6.12M |
|---|
function H = w_Call_DPABI_VIEW(BrainVolume,NMin,PMin,ClusterSize,ConnectivityCriterion,UnderlayFileName,ColorMap,NMax,PMax,H,Transparency,Position,BrainHeader)
% function H = w_Call_DPABI_VIEW(BrainVolume,NMin,PMin,ClusterSize,ConnectivityCriterion,UnderlayFileName,ColorMap,NMax,PMax,BrainHeader)
% Function to call y_s... |
function [Xs, Ys] = normalize(X, Y)
%{
DESCRIPTION
Normalization
[X_s, Y_s] = normalize(X,Y)
INPUT
X Training samples (N*d)
N: number of samples
d: number of features
Y Testing samples (N*d)
N: number of... |
nob=imread('man.jpg');
gr=rgb2gray(nob);
lol=edge(gr,'sobel');
figure()
imshow(nob)
figure()
imshow(gr)
figure()
imshow(lol) |
function [] = nullBC(N)
% Solves Laplace's equation with inhomogeneous boundary conditions
% Differential operators
rd=[1,N];
kd=2:N-1;
[D,x]=chebD(N); D2=D*D;
[xx,yy]=ndgrid(x); y=x';
% Boundary conditions
a=[1,0;1,0];
b=[0,1;0,1];
b1=[0.2*sin(3*pi*y); 0*y];
b2=[(x<0).*sin(pi*x).^4, 0*x];
V1=zeros(N); L1=zeros(N,1)... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% automated window picker
%
% this script takes the waking bout start/end times calculated in wake_times,
% along with the associated trace (smoothed GA assay data) and calculates
% the appropriate window for curve fi... |
function L = hash2landmark(H)
% L = hash2landmark(H)
% Convert a set of <time hash> pairs ready from store
% into a set of 4-entry landmarks <t1 f1 f2 dt>.
% If H is 3 cols, first col (song ID) is discarded.
% 2008-12-29 Dan Ellis dpwe@ee.columbia.edu
% Hash value is 20 bits: 8 bits of F1, 6 bits of F2-F1, 6 bits ... |
clc;clear;
fileID = fopen('rcv1_topics.txt','r');
data = textscan(fileID,'%s %f %*[^\n]');
fclose(fileID);
class = char(data{1});
class = class(:,1);
doc = data{2};
% 30000 samples 15000 training 15000 testing
doc = doc(1:95201);
class = class(1:95201);
% doc_id = unique(doc)-2285;
tongji = zeros(30000,4);
temp = doc(1... |
%% colour sections of the test using labels
db = [161 4 211]./ 255;
brown = [220 119 26]./ 255;
Brown = [139 32 22]./ 255;
greeney = [40 112 8]./ 255;
purple= [140 62 214]./ 255;
citrine= [206 201 12]./ 255;
load('R93.mat')
load('L:\PassOff_Data\ClassificationAlgorithm\Lancaster\xwb_ETOPS_data.mat')
lo... |
% Script to demonstrate how to use those functions
% TimeSeries=randn(50,180,100); % roi*T*nsubect
% Convert Time series to weighted graphs
% wgraphs=build_graph(TimeSeries);
% Threshold at 0.1
% graphs=double(wgraphs>0.1);
% Compute pairwise distance
% D1=graph_todist(graphs,'semipar');
% D2=graph_todist(graphs);
... |
function [data, headerText] = load_ascii(filename,delimiter,header,nlines,offset)
% This function loads data from a tab delimited or csv ascii file similar
% to dlmread/importdata. If the file has fixed width columns and an offset
% is desired, it uses this information to quickly scan to desired area
% (makin... |
% create Create object
%
% This protected method is used during object creation to fill out default
% properties and manage density settings
%
%
% created February 29, 2016 by Daniel Dolan (Sandia National Laboratories)
%
function object=create(object,varargin)
% make a dummy Density2D object to setup
end |
function [ Y_min, beta_c, X_min, contLoc ] = min_point_ellipse( pos, ori, ellipse, res )
%MIN_POINT_ELLIPSE Summary of this function goes here
% Detailed explanation goes here
x = pos(1);
y = pos(2);
theta = ori;
a_e = ellipse(1);
b_e = ellipse(2);
beta = linspace(0,2*pi,res)';
r = a_e*b_e./(sqrt(b_e^2*cos(beta... |
%CSV reader, TRIR Surface Plot from .csv file and SVD analysis with autocorrelation. LCG 6/13/2016
%Cleanup from previous runs:
clear A M t cm1 i a x y U S V autoU autoV
%Input .csv file name here
datafile = 'lcg040717-Ge-t0-400nm2mW-6950nm0.7mW-100fs-1k.csv';
M = csvread(datafile);
M = M'; %switch rows/columns so th... |
clear all;
addpath('../..')
addpath('../projection_tools/')
addpath('../../../data')
% folder where we saved the wannier projection
tar_folder = 'run_folder_8band';
tar_theta = 1.1;
numk = 16;
% file of the output of step 5 (before REWAN)
h_new_filename = [tar_folder,'/eightWANnew_H_' strrep(num2str(tar_theta,'%.2f')... |
% donne le vecteur unitaire sortant (ut) de la réfraction
% ui : vecteur unitaire entrant
% i : vecteur unitaire normal à la surface du plan
% ni : indice de réfraction du milieu i
% nt : indice de réfraction du milieu t
function [ut, estRefracte] = Refraction(ui, i, ni, nt)
estRefracte = true;
%vecteurs unitaires
ui ... |
function d = cov_sample(X,Y)
% Returns sample covariance between 2 variables.
% Replication in columns.
%
N = size(X,2);
EX = mean(X,2);
% centering
X = X - repmat(EX,1,N);
EY = mean(Y,2);
Y = Y - repmat(EY,1,N);
d = 1/(N-1) * X*Y';
end |
function pcontr=curls(vcovar,names,bcovar,cs2,tn)
% pcontr=curls(vcovar,names,bcovar,cs2,tn)
% This function computes contravariant components
% of the curl of a vector. Output can be either
% symbolic or numeric.
% vcovar - covaraint components of a vector
% names - string or symbolic vector containing
% ... |
%
% ***********************************************************************************
% ******* A Flexible New Technique for Camera Calibration *******
% ***********************************************************************************
% 7/2004 Simon Wan
% ... |
function [Filterd_Output] = integration_filterl(data,fs)
d=fdesign.lowpass('Fp,Fst,Ap,Ast', 100, 110,1,20, fs);
designmethods(d);
Hd = design(d,'equiripple');
%fvtool(Hd);
Filterd_Output = filter(Hd,data);
%s_fft(Filterd_Output,fs);
end |
classdef wrffire
% WRFFIRE is a collection of functions for plotting and analysing
% output from WRF-Fire simulations.
%
% Trent Mattner
% November 2012
properties (Constant)
gravity = 9.81;
end
properties
ncid; % file handle
... |
function [ uxinterp,uyinterp,interp_store ] = getEInterp_alt( p,t,temp,r_c,npts,meshdomain)
% Triangle point indices
it1=t(1,:);
it2=t(2,:);
it3=t(3,:);
% Find centroids of triangles
xpts=(p(1,it1)+p(1,it2)+p(1,it3))/3;
ypts=(p(2,it1)+p(2,it2)+p(2,it3))/3;
% only need half the points
inds = xpts<=2*r_c;
... |
Init;
for BaseNo = 3:10000 % These correspond to columns in ParameterFileName
% Read file again for each column, thus can add columns at runtime.
B = readtable(ParameterFileName,'Sheet', 'B');
LH = readtable(ParameterFileName,'Sheet', 'LH');
clearvars -except B LH BaseNo ParameterFileName
tr... |
function [k, num, den, c] = getValuesFromInput(strVal)
% Promts a question box asking for the input values of the
% clicked box
% input
% strVal = from parent function a string to show witch box is being
% checked
% output
% k = magnification factor
% num = numerator f... |
% Description : This function takes each dimension separately and use the
% given method to compute the marginal pdf. The output is an increasing
% ordered pdf function
function [pdfs] = margipdf(M,methodk)
% INPUT
% M: n*p matrices n samples of p dimensions
% methodk: normal,box,trian... |
function [x_m_w_sweep] = add_sweep(sweep,x_m, y_m)
if sweep == 0
x_m_w_sweep = x_m;
elseif y_m == 0
x_m_w_sweep = 0;
else
theta = atan(x_m/abs(y_m));
x_m_w_sweep = abs(y_m)* tan(theta + sweep);
end
end |
clc
clear
a=input('Enter the value of a=');
b=input('Enter the value of b=');
n=input('Enter the value of n=');
h=(b-a)/n;
for r=1:1:10
x(1)=0;
y(1)=x(1)*(2-x(1));
x(r+1)=x(r)+h;
y(r+1)=x(r+1)*(2-x(r+1));
end
I=h/3*((y(1)+y(7))+4*(y(2)+y(4)+y(6))+2*(y(3)+y(5)));
fprintf('The Integral value is %0.5f'... |
function [channel]=get_channel_muti_parameter(channel,signal_sequence,ruili_sigma);
%获得信道乘性噪声
channel.attenuation.d=1/(channel.attenuation.distance^2);%pass loss is constant for the whole transmittion
switch channel.attenuation.pattern
case 'no' %no fading at all(only pass loss)
channel.attenuation.phi=z... |
p=24;
d=1;
beta=[1,1,1,1,zeros(1,p-4)]'/sqrt(4);
for i=1:p
for j=1:p
psig(i,j)=0.5^abs(i-j);
end
end
spsig = sqrtm(psig);
setpaths;
myCluster = parcluster();
parpool(myCluster);
for n=[60 120]
time=zeros(100,2);
tpr=zeros(100,2);
fpr=zeros(100,2);
angle=zeros(100,3);
... |
function [ D, G ] = dataconverter (strfile, detect, indicator)
% indicator - is a cell to indicat the meaning of number in detect.
% detect - a cell to store the time of events.
% strfile - name of the corresponding data file.
%
% Example:
% file = 'ls_gt_ls';
% result = { gt , ls , lt };
% events = {'gt','ls... |
function m = measureFocus2NoGraphGPU(imgBlurred)
% Horizontal and vertical edge finder
hHoriz = fspecial('sobel');
hVert = hHoriz';
[~,~,~,w] = size(imgBlurred);
m = zeros(1,w);
for k = 1:w
img = rgb2gray(imgBlurred(:,:,:,k));
imgV = imfilter(img,hVert);
imgH = imfilter(img,hHoriz);
img ... |
% Inverse Laplace Transform Calculator for Transfer Function Classes
% Allows taking laplace transform directly by using the transfer function
% Example: sd2td = ilaplace4tf(TF)
% Where TF is a transfer function class and
% sd2td is the time domain equivalent of TF
function sd2td=ilaplace4tf(TF)
syms s;
num= poly2sym(... |
function [C, sigma] = dataset3Params(X, y, Xval, yval)
%DATASET3PARAMS returns your choice of C and sigma for Part 3 of the exercise
%where you select the optimal (C, sigma) learning parameters to use for SVM
%with RBF kernel
% [C, sigma] = DATASET3PARAMS(X, y, Xval, yval) returns your choice of C and
% sigma. You... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% GUPS (Giga UPdates per Second) is a measurement that profiles the memory
% architecture of a system and is a measure of performance similar to MFLOPS.
% GUPS is calculated by identifying the number of memory locations that can be
% r... |
function y = BezierCurve(N, P)
% This function constructs a Bezier curve from given control points. P is a
% vector of control points. N is the number of points to calculate.
%
% Example:
%
% P = [0 0; 1 1; 2 5; 5 -1];
% x = (0:0.0001:5);
% y = BezierCurve(length(x), P);
% plot(x, y, P(:, 1), P(:, 2), 'x-', 'L... |
% Solving Power Model given in PowerModel.m
global m margin_lower margin_upper P_beg P_end Q_beg Q_end P_at_t Q_at_t;
m = 600;
margin_upper = m/2 + 50;
margin_lower = m/2;
% wir wollen am Node1 vorgeben
% um Node 5 rauszubekommen
P_beg = 0; %-90;
P_end = -0.9; %-180;
Q_beg = -0.3; %-30;
Q_end = -0.6; %-60;
P_at_N1 = g... |
function recError = calculateSRError(dictionary,allfeats,paramSR)
%% Calculate the sparse reconstruction errors.
allfeats = normVector(allfeats);%每列归一化
dictionary = normVector(dictionary);%每列归一化
paramSR.L = length(allfeats(:,1)); %特征维数
beta = mexLasso(allfeats, dictionary, paramSR);%计算稀... |
function [gdate,vdate] = f_gregorian(jdate,yr)
% - convert Julian date to Gregorian
%
% USAGE [gdate,vdate] = f_gregorian(jdate,yr);
%
% jdate = Julian date
% yr = 4-digit year
%
% gdate = {'dd-mmm-yyyy'} (date string)
% vdate = [yyyy mm dd h m s] (date vector)
%
% See also: f_julian, f_isDST, f_leapYear
% -----... |
function [cdata_in ddata_in] = get_pr_data_in(ns,cps,dps,indices)
%this func enumrates all parents indices of node i in the data, puts the continuous data (from contiuous nodes)
% discete data (from discrete parents)into 2 different
% arrays and returns.
cdata_in =[];
ddata_in = [];
counter = 1;
for j= 1:length(cps)
... |
classdef g2 < Modules.Experiment
%G2 Idles an experiment to prevent inactivity timer
properties(SetObservable)
expected_time = 0;
end
properties
prefs = {'expected_time'};
end
properties(Access=private)
abort_request = false; % Request flag for abort
end
... |
%BCSBACKTEST BlueChipStock backtest analysis
addpath ./source
load BlueChipBacktest
RefIndex = 45;
[NumMonths, NumAssets] = size(RetHistory);
NumStocks = NumAssets - 3;
NumPortfolios = 40;
Periodicity = 12;
NumPeriods = floor(NumMonths/Periodicity);
StartIndex = NumMonths - NumPeriods * Periodicity... |
# Admin-Template
|
function chkmkdir(tarDir)
% checks the existence of the input dir, if dir doesn't exist, make this dir.
% Weiguang (Gavin) Ding, May 2012
if exist(tarDir, 'dir') ~= 7
mkdir(tarDir);
end
end
|
function RegressAnalysesWater
% Collate data from Ensemble calculations
% Do once then comment since loaded below
%[VariablesWater,EnsemblesWater] = CollateWaterData;
%% Regression analyses
clear all
if matlabpool('size') ~= 0
evalc('matlabpool close');
end
EnsemblesNames = [{'Mean'},{'Median'},{'PCA_wei... |
function rmatch=MatchLast2CorForFirstBPM(ring,inCOD,indBPM,indHCor,indVCor)
%takes the last two correctors to match the orbit and angle trajectory at
%the first BPM.
% get trajectory
[t0]=findtrajectory6Err(ring,indBPM,inCOD);
% trn4=linepass([ring; ring; ring; ring],[inCOD(1:4),0,0]',[indBPM length(ring)+indBPM le... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 8/1/07 histn_input.mat: Creates a normalized histogram
% using two input files, 1) histogram data 2) Probability
% density plot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [hn,xspan] = histn(x0, binsize, xf)
xspan=[x0:binsi... |
function [ output_args ] = computeSafeRTI( input_args )
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
close all
% directory = '/home/khan/phd_ws/traversability/adjacency/narrow_passage/narrow_passage'
adj_dir = '/home/khan/phd_ws/traversability/adjacency/rsi/rand_01/road_rsi'
config_d... |
function y=CrudeVoigt(param,x)
% initial setup
x0=param(1);
sigma=param(2);
gamma=param(3);
% horizontal normalization
L=max(x)-min(x);
L=max(L,sigma);
L=max(L,gamma);
sigma=sigma/L;
gamma=gamma/L;
% integration
u=(x-x0)/L;
kernel=@(v) exp(-v.^2/(2*sigma^2))./(1+(u-v).^2/gamma^2);
y=integral(kernel,-inf,+inf,'Array... |
function addbackground(src,event,data)
% Callback function for "Add Floor" (eh1_file)
% Resume - Respond to uiwait in while loop
uiresume(data.f);
% Open the vr world and set up as a patch object in a figure
open(data.w)
figure('Name', 'Figure For Adding Floor','NumberTitle','off');
data.tp = ... |
% lift prediction using 2-D airfoilf theory
c=1; % chord
xf=5/6; % flap location, x is non-dimensional
aoa=degtorad(5); % angle of attack
% aoaf flap angle of attack
% simplified unsteady 3D wing lifting line method by B. Davoudi 7/27/2016
Nx=6; % chordw... |
%% 患者癌症和正常样本SOM分类
clc % 清屏
clear all; % 删除workplace变量
close all; % 关掉显示图形窗口
format short
% Initial
%% 录入输入数据
% 载入数据并将数据分成训练和预测两类
load gene.mat;
data=gene;
P=data(1:40,:); % 前20个是癌症,后20个是正常样本
T=data(41:60,:); % 待检测样本
% 转置后符合神经网络的输入格式
P=P';
T=T';
% 归一化操作
[Pn,Ps]=mapminmax(P);
[Tn,Ts]=mapminmax(T);
% 取输入元素的最大值和最小值Q:
% Q... |
% build global relationship from pairwise relationship
function [ stat_assignment_all, stat_assignment_result ] = build_global_inheritance( markers, output_dec_state, output_dec_state_sc, map)
count = 0;
n_ind = length(map.list);
num_m = length(markers);
stat_relation(1:n_ind,1:n_ind) = 0;
stat_relation_prob(1:n_i... |
%evaluate the fitness values of the whole population.
%Inputs: popSize-Integer. The number of the individuals;
% swarm-(popSize*dimension) matrix. Rrepresenting the individuals;
% bounds-(2*dimension) matrix. The boundaries of each
% dimension;
% types-(1*dimension) vector. The ... |
function [W1,W2] = train_NN(X,Label,iter,hidden,step,m)
features = size(X,2);
output = size(Label,2);
epsilon = 0.95; % the parameter to adjust the initial weight.
W1 = rand(features,hidden) *2*epsilon -epsilon; % input-hiddenlayer weight
W2 = rand(hidden+1,output)*2*epsilon -epsilon; % hiddenlayer-output weight... |
# Generate a sample of 40 project sizes
1;
function s = value_to_project_size(u)
if u <= 0.1
s = 1;
elseif u <= 0.85
s = 2;
else
s = 3;
end
end
function d = date_from_params(type, hours, price)
hours_per_month = 40 * 4;
if type == 1
min_devs = 1;
mea... |
function LPder=LegendreDerivativeMatrix(qP)
LPder=zeros(11,length(qP));
LPder(1,:) = 0;
LPder(2,:) = 1;
LPder(3,:) = 3*qP;
LPder(4,:) = 1/2*(15*qP.^2-3);
LPder(5,:) = 1/8*(140*qP.^3-60*qP);
LPder(6,:) = 1/8*(315*qP.^4-210*qP.^2+15);
LPder(7,:) = 21/8*(33*qP.^5-30*qP.^3+5*qP);
LPd... |
function [Y_uint8 Cb_uint8 Cr_uint8] = YCbCr(Rval, Gval, Bval)
MAXJSAMPLE = 255;
CENTERJSAMPLE = 128;
R = double(Rval);
G = double(Gval);
B = double(Bval);
if (max(max([R G B])) <= 1.0)
R = R * MAXJSAMPLE;
G = G * MAXJSAMPLE;
B = B * MAXJSAMPLE;
end;
Y = 0.29900 ... |
function [vec] = gen_vec_with_angle4(u1, u2,u3, inner_prod1, inner_prod2, inner_prod3)
% generate a unit vector such that it has the specified inner product with u1,
% and the specified inner product with u2
% note: u1 and u2 can be any dimension
u1 = u1 / norm(u1);
u2 = u2 / norm(u2);
u3 = u3 / norm(u3);
A = [u1'; u... |
% Draw a test sequence from sample leaf to the root of the tree
%
%
function drawTest(data, index, t, leaf, yname, tmax, yaxismin, yaxismax, t0)
timeEnvlope=0;
max=-999;
min=999;
if(t0>0),
tt=0;
i=1;
while(tt<t0),
if( data( t, i) > tt),
leaf=i;
tt=da... |
function disparity_map = ransac_plane(disparity_map,cluster,maxDistance,varargin)
%% Input parser
P = inputParser;
% Plot oder nicht
P.addOptional('do_plot', false, @islogical);
% den Input lesen
P.parse(varargin{:});
do_plot = P.Results.do_plot;
%% transform the cluster into 3D point
ind = find(cluster);
[v,u] = i... |
function [geoheight] = simple_prestogeo(p1,pz,t1,tz)
%%simple_prestogeo
%Function to quickly calculate the geopotential
%thickness given two pressures and two corresponding temperatures. Can be
%easily used as a geopotential height calculator if the first pressure and
%temperature input are the surface ... |
clear; close all; clc;
% this script illustrates the recursive computation of the ML estimators
% of correlation matrix and the d.o.g. of a t copula with isotropic structure
% see A. Meucci (2008) "Estimation of Structured T-Copulas"
% available at www.symmys.com > Research > Working Papers
load DB_SwapParRat... |
function [] = ycctest(imageName)
rgb = imread(imageName);
ycbcr = rgb2ycbcr(rgb); %convert to yuv space
%display the y component as a color image
%ycbcry = ycbcr;
%ycbcry(:,:,2) = 0;
%ycbcry(:,:,3) = 0;
%rgb1 = ycbcr2rgb(ycbcry);
%figure, imshow(rgb1);
% display the cb component ... |
%x=((y-R*(1-1/(1+(tan(w)+c/d)^2)))^0.5)^2+((z+R/((1+(tan(w)+c/d)^2))^0.5)^2)^0.5
% gim_y_act_c1 = 0.1;
% gim_y_act_c2 = 0.2;
% gim_y_act_ly1c = 0.3; % lx1c must always be greater than c1
% gim_y_act_lz1c = 0.4;
% gim_x_act_c1 = 0.1;
% gim_x_act_c2 = 0.2;
% gim_x_act_lx1c = 0.3; % lx1c must always be greater than c1
%... |
function line = edgeToLine(edge)
%EDGETOLINE Convert an edge to a straight line.
%
% LINE = edgeToLine(EDGE);
% Returns the straight line containing the edge EDGE.
% EDGE is represented as [X1 Y1 X2 Y2]
% LINE is represented as [X0 Y0 DX DY]
%
% Example
% edge = [2 3 4 5];
% line = edg... |
%% Versão 1
N = 1000;
n = round(N/0.8);
matriz = zeros(1,n);
for i=1:N
a = GeraChaves(3, 20)
h = mod(string2hash(a),n);
matriz(h) = matriz(h)+1;
subplot(1,2,1)
bar(matriz)
drawnow
subplot(1,2,2)
hist(matriz)
drawnow
end;
%% Versão 2
alpha = ['A':'Z' 'a':'z'];
% fi... |
clear all;
close all;
dataset=1;
n =1000;
seed = 1;
rand('state',seed);
randn('state',seed);
switch dataset
case 1
X = randn(4,n);
E = randn(1,n);
sg = 0.1;
X(1,:) = X(1,:);
X1 = X(1,:);
X2 = X(2,:);
Y = (X1.^2 + X2)./(0.5 + (X2 + 1.5).^2) + (1 + X2).^2+... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% %%%%%%%
%%%%%%% BI-DIMENSIONAL GINIBRE POINT PROCESS %%%%%%%
%%%%%%% %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
%% This is an example, explaining the use of INPUT definitions in SBmodels.
%% First have a look at the first model
edit model1.txt
% You can see that there is an input definition in the ODE (INPUT1).
% The prefactor "F" might be interpreted as bioavailability. You can
% use any prefactor (also a mathematical express... |
function b=dilation(x)
% function p=open(A)
% alpha = K1*A;
% beta = K2*A*alpha;
% gamma = K3*A*beta;
% p=(beta+gamma)/(1+alpha+beta+gamma);
% end
%
% global k1 k2 k3 k4 k5 k6;
% setParamsfullP2X7(x);
%
% Alow=0.1*10^-6;
% Ahigh=10*10^-6;
% K1 = 3*k2/k1;
% K2 = k4/k3;
% K3 = k6... |
% [lambda,mu,nu] = bpquadratic(P,x,I,i,g,k,A,b,Binv)
%
% Given the system ||x_h-x_i||^2 = P(h,i)^2 to compute the next vertex
% y=x_i given K known {x_h}'s for h in I, pick g-th equation and form
% linear system Eq(j)-Eq(g), getting Ay=b where A=2(x_h-x_g) and
% b=(||x_h||^2 - d_{h,i}^2). Pick nonbasic column k and le... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Trimming of imperfect hemispherical shell including point mass distributions %
% Fig.2 Eigenfrequencies of the perfect shell %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
%
% MSE 480/780: Robotics Lab 2 - Inverse Kinematics
%
% By: Vivek Vyas & Zahra Haeri
clc; clear all; close all;
%% Variables
d1 = 6.193; %cm
L2 = 14.605; %cm
L3 = 18.733; %cm
d5 = 9.843; %cm
%% Case 1 - Initialization
Tot = [ 0 0 1 28.58 ;...
0 -1 0 0 ;...
1 0 0 20.8 ;...
0 0 0 1 ];
%% Case 2 - Initialization
Tot ... |
%===============================================================
% Load Scheduling Problem with Quadratic Cost
% Institution: Federal University of Minas Gerais (UFMG)
% Department: Graduate Program in Electrical Engineering
% Author: Luciana Sant'Ana Marques
% Date: Feb 20th, 2018 at 16:31
%=====================... |
% This function compute HSIC given two kernel matrices
function val_hsic = compute_HSIC(mtr_sim_1,mtr_sim_2)
% Parameters
% -----------
% mtr_sim_1: matrix, shape(n_instances,n_instances)
% similarity matrice for feature 1
% mtr_sim_2: matrix, shape(n_instances,n_instances)
% similarity matrice for... |
function [ result ] = RLS( A, b )
%RLS Summary of this function goes here
% b = Ax
% A is 10000 * 10 matrix
% b is 10000 * 1 matrix
% x will be a 1 * 10 matrix
% A = randn(10000, 10); b = randn(10000, 1);
m = size(A, 1); % expect to be 10000
n = size(A, 2); % expect to be 10
a = zeros(n,... |
testCarInitialization
SA = linspace(-25,25,100);
Fz =[200,300,400,500,600,700,800,900,1000,1100,1200];
SR = 0.00;
IA = 0;
Fy = zeros(length(SA),length(IA));
for i = 1:length(Fz)
for j = 1:length(SA)
Fy(j,i) = LTSFyCombinedMF52(Car,SA(j),SR,Fz(i),IA);
%Fy(j,i) = LTSFyPureMF52(Car,SA(j),Fz,IA(i));
end
e... |
function strRoomDescription = RoomIDToDescription( iRoomID )
%
tRoomsIDs = Converter.GetRoomsIDs();
%
switch( iRoomID )
%
case tRoomsIDs.A202
strRoomDescription = 'A202';
%
case tRoomsIDs.A204
strRoomDescription = 'A204';
%
case tRoomsIDs.A206
strRoomDescription = 'A206';
%
c... |
function [] = FiberLengths(SP)
%% Hard Coded:
SearchLat = 90;
SearchLong = 200;
MinLength = 30; % Any segment less than 30 nm long will be cleaned out
ODiffTol = 50;
%% Image Characteristics
load(SP)
w = IMS.Dim; % width of image in nm
S = IMS.Segments; % The... |
%% 3 Estados Tanque Polar (Modelo discreto borroso del tanque)
clearvars
clc
close all
format shortG
addpath('..\..\Funciones');
load datosIdentificacionPolar % no inc de verdad
% load datosIdentificacionPolar2
% load datosIdentificacionPolar3 % inc
% load('..\2_Borroso\datosIdentificacionTS.mat');
%% Inicio
N = 0... |
function make_all_mei()
%Directory of the files
vid_dir = 'C:\Users\Jeff Lau\SkyDrive\Documents\Classes\18-798\final project\18-798-Final-Project\new convert vid';
img_dir = 'C:\Users\Jeff Lau\SkyDrive\Documents\Classes\18-798\final project\18-798-Final-Project\Image Files';
vids = fullfile(vid_dir, '*... |
% Version 1.1
%
% Code provided by Ruslan Salakhutdinov and Geoff Hinton
%
% Permission is granted for anyone to copy, use, modify, or distribute this
% program and accompanying programs and documents for any purpose, provided
% this copyright notice is retained and prominently displayed, along with
% a note saying tha... |
function [bi]=br_zone_valley(x2, y2, z2, valley, shift)
%-----------------------------------------------------
%-----------------***************---------------------
%---------------*-----------------*-------------------
%-------------*---------------------*-----------------
%-----------*-------------------------*----... |
function [Data, VoxelSize, Header] = y_ReadRPI(FileName, VolumeIndex)
%function [Data, VoxelSize, Header] = y_ReadRPI(FileName, VolumeIndex)
% Read NIfTI image in RPI orientation -- for NIfTI files without rotation in affine matrix!!!
% Will call y_Read.m, which does not adjust orientation.
% --------------------------... |
function [Z]=csz(S)
%these function set one by one zero between start and end input vector
r=1;
o=2;
for a=1:length(S)
Z(1,r)=S(1,a);
r=r+2;
Z(1,o)=0;
o=o+2;
end
Z(o-2)=[]; |
clear;
clear;
addpath(genpath('../..'));
set(0,'defaulttextInterpreter','latex');
fig = figure('Name','Regressione Parabolica', 'Color','white', 'NumberTitle','off');
fig.ToolBar = 'none';
n = 8;
x = chebyspace(-4, +4, n)';
parab = @(x) (x.^2)/4;
y = parab(x);
m = 2;
coeff = myls(x, y, m);
fplot(@(xval) polyval(co... |
function total_time = waitbar_reset(hObject)
%WAITBAR_RESET zurücksetzen der Fortschrittsanzeige eines GUI
% TOTAL_TIME = WAITBAR_RESET (HOBJECT) setzt die Fortschrittsanzeige im GUI
% von HOBJECT zurück. Nähere Informationen dazu findet sich in der
% Dokumentation der Funktion WAITBAR_UPDATE.
% TOTAL_T... |
function results=gab_task_envvars(args)
%% DESCRIPTION
%
% Extremely simple function to establish environmental variables
% necessary to easily work with data in EEGLAB. This is done by simply
% starting EEGLAB and then ensuring that the user's special pathfiles are
% checked before EEGLAB folders. User specif... |
function srinit(varargin)
%SRINIT - Just an alias to hwinit
hwinit(varargin{:});
|
classdef GenerationEC < EvolutionControl & Observable
properties
model
counteval
lastModel
origGenerations;
modelGenerations;
currentMode = 'original';
currentGeneration = 1;
lastOriginalGenerations = [];
remaining = 2;
end
methods
function obj = G... |
inf_u=50
inf_v=50
mm = 50
nn = 15
figure;
[UI,VI] = meshgrid((inf_u/mm:inf_u/mm:inf_u),(inf_v/mm:inf_v/mm:inf_v))
surf(UI,VI)
hold on
[U,V] = meshgrid(linspace(inf_u/mm,inf_u,nn),linspace(inf_v/mm,inf_v,nn))
surf(U,V) |
clc; clear all; close all;
syms s t n z w;
fs = 1000;
ts = 1/fs;
W = -2*pi: ts : 2*pi;
wc = 1;% change value of wc here
P1 = -1 *wc;
Px = P1 + cos(pi/3); %real part of pole
Py = sin(pi/3); %imaginary part of pole
P2 = Px + (Py *1i);
P3 = Px - (Py *1i);
% deriving 3rd order Butterworth Filter
H = (P1/... |
%evaluating the guiding center interpolation arrays
pos_X_gc=(mHe/eV)*(1/ZHe)*(v_Z_step.*bphi-v_phi_step.*bZ)./alphas_Bfield;
pos_Z_gc=(mHe/eV)*(1/ZHe)*(v_phi_step.*bX-v_X_step.*bphi)./alphas_Bfield;
alphas_Xpos_gc=alphas_pos_x+pos_X_gc;
alphas_Zpos_gc=alphas_pos_z+pos_Z_gc;
% limited map range
alphas_Xpos_gc=min(a... |
function ecuacionGeneralizada(pws, ip, pb)
pws=6000;
ip=54;
pb=3000;
%n=input('¿Cuántas divisiones quieres para pwf? ');
n=50;
pwf=linspace(pws,0,n);
[pwfM pwfN]=size(pwf);
q=zeros(pwfM, pwfN);
longitud=length(pwf);
contador=0;
for i=1:longitud
if pwf(i)>=pb
contador=contador+1;
q(i)=ip*(pws-pwf(i)... |
function x = brownian_motion_simulation ( m, n, d, t )
%*****************************************************************************80
%
%% BROWNIAN_MOTION_SIMULATION simulates Brownian motion.
%
% Discussion:
%
% Thanks to Feifei Xu for pointing out a missing factor of 2 in the
% stepsize calculation, 08 Marc... |
function [ Harms, tones, noises ] = get_pert_harm( file, nb, wid, bw )
%
%function [ Harms, noises ] = get_pert_harm( file [, nb, wid, bw ] )
%
% Recherche des composantes tonales pertinentes presentes
%dans le fichier wave 'file', puis recherche les sequences
%harmoniques correspondantes. 'nb' est le nombre d... |
% batch test
clear;
name_list = {'constant','mountain','road2'};
for i=1:length(name_list)
name = name_list{i};
% test_landmark_error;
test_distance_approximation;
end |
% Put this inside bin/Debug and execute it to plot the mean per generation
data = tdfread('bog4.dat');
generations = data.x0;
mean = data.x00x2E0643372;
deviation = data.x00x2E0499757;
hold on
plot(generations, mean)
% errorbar(generations, mean, -deviation/2, deviation/2)
|
% carrega o arquivo fis que tem a lógica fuzzy
load_file = readfis('rule4.fis');
% declarando a api do vrep
vrep=remApi('remoteApi');
vrep.simxFinish(-1);
%vetor de distancias e de controle dos sensores
sensorHandle = [0, 0, 0];
dist = [0, 0, 0];
%conectando ao Vrep
clientID=vrep.simxStart('127.0.0.1',19997,true,tru... |
function [Vtil,Wtil,Ttil,Stil, nuhat,etahat] = UpdateTPIEP_v1 (V,W,T,S,z,v,w,pv,pw, poles_oldv,poles_oldw)
% Updating procedure for tridiagonal pencil IEP
% Given a solution V,W,T,S to a TPIEP of size m, the solution to a TPIEP of size m+1
% is constructed, where a new node z, new weights v,w and new poles pv,pw are in... |
%publish graph function (makes graphs pretty and publishable)
function pubgraph(fh,FS,LW,CL,FN)
%fh is the handles to the figure containing the graph
%FS is the Font Size
%LW is the Line Width
%CL is Color
%FN is Font Name
figure(fh) %pull the figure forw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.