plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | yunjunz/GeodMod-master | distance.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/distance.m | 9,722 | utf_8 | a9e729399100476c41b19739741111ea | function [rng, az] = distance(varargin)
%DISTANCE Distance between points on sphere or ellipsoid
%
% [RNG, AZ] = DISTANCE(LAT1,LON1,LAT2,LON2) computes the great circle
% distance(s) and azimuth(s) between pairs of points on the surface of
% a sphere. The input latitudes and longitudes, LAT1, LON1, LAT2,
% LO... |
github | yunjunz/GeodMod-master | normfit.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/normfit.m | 9,769 | utf_8 | 324099093c434e469c983f4c0b4038c7 | function [muhat, sigmahat, muci, sigmaci] = normfit(x,alpha,censoring,freq,options)
%NORMFIT Parameter estimates and confidence intervals for normal data.
% [MUHAT,SIGMAHAT] = NORMFIT(X) returns estimates of the parameters of
% the normal distribution given the data in X. MUHAT is an estimate of
% the mean, and ... |
github | yunjunz/GeodMod-master | reckon.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/reckon.m | 4,883 | utf_8 | 2df8663560d5c0dc5980a147ec1d74d4 | function [latout,lonout] = reckon(varargin)
%RECKON Point at specified azimuth, range on sphere or ellipsoid
%
% [LATOUT, LONOUT] = RECKON(LAT, LON, RNG, AZ), for scalar inputs,
% calculates a position (LATOUT, LONOUT) at a given range RNG and azimuth
% AZ along a great circle from a starting point defined by LA... |
github | yunjunz/GeodMod-master | optimset.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/optimset.m | 18,072 | utf_8 | 52379a35432e00e9b6c34d237eb5ca75 | function options = optimset(varargin)
%OPTIMSET Create/alter optimization OPTIONS structure.
% OPTIONS = OPTIMSET('PARAM1',VALUE1,'PARAM2',VALUE2,...) creates an
% optimization options structure OPTIONS in which the named parameters have
% the specified values. Any unspecified parameters are set to [] (parameter... |
github | yunjunz/GeodMod-master | iptcheckconn.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/iptcheckconn.m | 3,636 | utf_8 | 5e525f699686b325761185fd83c95cd5 | function iptcheckconn(conn,function_name,variable_name,arg_position)
%IPTCHECKCONN Check validity of connectivity argument.
% IPTCHECKCONN(CONN,FUNC_NAME,VAR_NAME,ARG_POS) checks if CONN
% is a valid connectivity argument. If it is invalid, the function
% issues a formatted error message.
%
% A connectivity arg... |
github | yunjunz/GeodMod-master | convertlat.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/convertlat.m | 10,824 | utf_8 | f974246c634cc6583cc2f1d2ca74a15c | function latout = convertlat(ellipsoid, latin, from, to, units)
%CONVERTLAT Convert between geodetic and auxiliary latitudes
%
% LATOUT = CONVERTLAT(ELLIPSOID, LATIN, FROM, TO, UNITS) converts
% latitude values in LATIN from type FROM to type TO. ELLIPSOID is a
% 1-by-2 ellipsoid vector of the form [SEMIMAJORAX... |
github | yunjunz/GeodMod-master | iptcheckstrs.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/iptcheckstrs.m | 4,005 | utf_8 | c7fa725ef221a3d03aa97887ef54ab73 | function out = iptcheckstrs(in, valid_strings, function_name, ...
variable_name, argument_position)
%IPTCHECKSTRS Check validity of text string.
% OUT = IPTCHECKSTRS(IN,VALID_STRINGS,FUNC_NAME,VAR_NAME,ARG_POS) checks
% the validity of the text string IN. If the text string matches one of
... |
github | yunjunz/GeodMod-master | almanac.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/almanac.m | 41,894 | utf_8 | 09565ef6ada12021ec8cec0580d86eb0 | function mat = almanac(object,parm,units,refbody)
%ALMANAC Parameters for Earth, planets, Sun, and Moon
%
% ALMANAC, without any input arguments, displays a list of the heavenly
% objects recognized by ALMANAC.
%
% ALMANAC('object') displays recognized parameters, units, and reference
% body strings for the pl... |
github | yunjunz/GeodMod-master | ordfilt2.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/ordfilt2.m | 4,145 | utf_8 | e99494d517112c6f6bfcd28e1b2db16e | function B = ordfilt2(varargin)
%ORDFILT2 2-D order-statistic filtering.
% B=ORDFILT2(A,ORDER,DOMAIN) replaces each element in A by the
% ORDER-th element in the sorted set of neighbors specified by
% the nonzero elements in DOMAIN.
%
% B = ORDFILT2(A,ORDER,DOMAIN,S), where S is the same size as
% DOMAIN, u... |
github | yunjunz/GeodMod-master | bwlabeln.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/bwlabeln.m | 2,774 | utf_8 | 7d4b7a06a54ad4ba8019a003b79f0cdf | function [L,num] = bwlabeln(varargin)
%BWLABELN Label connected components in N-D binary image.
% L = BWLABELN(BW) returns a label matrix, L, containing labels for the
% connected components in BW. BW can have any dimension; L is the same
% size as BW. The elements of L are integer values greater than or equal
... |
github | yunjunz/GeodMod-master | regionprops.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/regionprops.m | 34,506 | utf_8 | 02272a9beba17c8fd9e792030d8937b3 | function outstats = regionprops(varargin)
%REGIONPROPS Measure properties of image regions (blob analysis).
% STATS = REGIONPROPS(L,PROPERTIES) measures a set of properties for each
% labeled region in the label matrix L. Positive integer elements of L
% correspond to different regions. For example, the set of el... |
github | yunjunz/GeodMod-master | readOptimHashTable.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/readOptimHashTable.m | 6,852 | utf_8 | 06bd898d7a6b2dc44cfac1969f5399a1 | function [probStruct,optStruct,errProb,errOpt] = readOptimHashTable(hashProb, hashOptions)
%readOptimHashTable Read hash table from optimtool and return MATLAB structures.
% Private to OPTIMTOOL
% Copyright 2005-2006 The MathWorks, Inc.
% $Revision: 1.1.6.2 $ $Date: 2007/12/10 21:50:06 $
% Add problem/options k... |
github | yunjunz/GeodMod-master | optimguiGeneratemfile.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/private/optimguiGeneratemfile.m | 7,160 | utf_8 | dfe8f711798d442a6274ef25b0e74705 | function err = optimguiGeneratemfile(hashProb,hashOpt)
%optimguiGeneratemfile generates an M-file from OPTIMTOOL.
% hashProb and hashOpt are Java hash tables containing information about
% the problem and options model. hashProb and hashOpt contain only information
% that user has changed since last time the dat... |
github | yunjunz/GeodMod-master | geodesicinv.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/private/geodesicinv.m | 11,939 | utf_8 | 0a7fa74a3d7f693ee05b16b69b603f82 | function [s, faz, baz] = geodesicinv(phi1, lambda1, phi2, lambda2, ellipsoid)
% Solve the inverse problem of geometric geodesy: Given a pair of points
% with geodetic coordinates PHI1, LAMBDA1, PHI2, LAMBDA2, find the
% distance S between them along a geodesic on the specified ELLIPSOID.
% Also determine the ... |
github | yunjunz/GeodMod-master | checkstrs.m | .m | GeodMod-master/mimiclib/toolboxfiles_map/private/checkstrs.m | 3,438 | utf_8 | bafa4aef61d71e8901908508aa7c0179 | function out = checkstrs(in, valid_strings, function_name, ...
variable_name, argument_position)
%CHECKSTRS Check validity of option string.
% OUT = CHECKSTRS(IN,VALID_STRINGS,FUNCTION_NAME,VARIABLE_NAME, ...
% ARGUMENT_POSITION) checks the validity of the option string IN. It
% returns ... |
github | yunjunz/GeodMod-master | dislocLayers.m | .m | GeodMod-master/deformation_sources/dislocLayers.m | 32,912 | utf_8 | e47248a92481f94c58b95683d6ca9a7c | function U=dislocLayers(m,xloc,d,mu,lam,scaleN)
%U=LayeredGreens(m,d,mu,lam,xloc)
% Calculates the surface displacements for a dislocation in a layered
% elastic halfspace using propagator matrix methods.
%%INPUTS:
%fault model (standard Okada paramterization -- must be column vector):
% m(1) = length (km) (do ... |
github | yunjunz/GeodMod-master | intgrV.m | .m | GeodMod-master/deformation_sources/penny/intgrV.m | 621 | utf_8 | a1d9e3cfc6c1878f0300aa46e09313cb | %function [V,Vs]=intgrV(fi,psi,h,Wt,t)
function [V]=intgrV(fi,h,Wt,t)
% V,Vs - volume of crack, volume of surface uplift
% fi,psi: basis functions
% t: interval of integration
%large=1e10;
V = sum(Wt.*fi.*t);
%Vs = sum(Wt.*fi.*(t-h*(h-t)./(h^2+t.^2)));
%V1 = sum(Wt.*(fi.*Q(0,t,0,41)));
%V2 = sum(Wt.*(fi.*Q(0,t,large,41... |
github | yunjunz/GeodMod-master | fpkernel.m | .m | GeodMod-master/deformation_sources/penny/fpkernel.m | 2,641 | utf_8 | 14db3d9eddeeca4172dab4e976009670 | function [K]=fpkernel(h,t,r,n)
% Kernels calculation
% Support matrix 't','r' and array 'n' input, Yunjun, 2015-11-10
p=4*h^2;
% K=[];
%[dumb,nr]=size(r);
%[dumb,nt]=size(t);
%Support array 'n' input, Yunjun, 2015-11-10
[s1,s2] = size(t);
s3 = length(n);
K=zeros(s1,s2,s3);
kg = zeros(s1,s2,3);
kg(:,:,1) = KG( t-r, p... |
github | yunjunz/GeodMod-master | Q.m | .m | GeodMod-master/deformation_sources/penny/Q.m | 2,816 | utf_8 | e0c9c4c9713cd8d420c0842375da6e69 | function [K]=Q(h,t,r,n)
% Kernels calculation
% Support matrix 't' and array 'n' input, Yunjun, 2015-11-10
K=[];
E=h^2+r.^2-t.^2;
D=(E.^2+4*h^2*t.^2).^(0.5);
D3=D.^3;
%i=sqrt(-1);
% switch n
% case 1 %Q1
% K=sqrt(2)*h.*t./(D.*sqrt(D+E));
%
% case 2 %Q2
% D3=D.^3;
% K=1/sqrt(2)... |
github | yunjunz/GeodMod-master | fred.m | .m | GeodMod-master/deformation_sources/penny/fred.m | 1,218 | utf_8 | 3f8d821d21a1dc0a806aed26bd8921b8 | function [fi,psi,t,Wt]=fred(h,m,er)
% fi,psi: basis functions
% t: interval of integration
% m: size(t)
%er=1e-7;
lamda=2/pi;
RtWt;
NumLegendreTerms=length(Rt);
for k=1:m
for i=1:NumLegendreTerms
d1=1/m;
t1=d1*(k-1);
r1:=d1*k;
j=NumLegendreTerms*(k-1)+i;
t(j)=Rt(j)*(r1-t1)*0.5+(r1+t1)*0.5;
end
end
%[t,Wt]=S... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/prior_mag_AS/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/prior_mag_AS/bin_util/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/prior_AS/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/prior_AS/bin_util/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/no_priors/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/no_priors/bin_util/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/prior_mag/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/prior_mag/bin_util/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | anneal.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/bin_util/anneal.m | 8,053 | utf_8 | 7ab3c719e1d6f53eda3761bc1809a165 | function [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,varargin)
% anneal - simulated annealing by Peter Cervelli
%ANNEAL [mhat,F,model,energy,count]=anneal(FUN,bounds,OPTIONS,x1,x2...,xn)
%
%Simulated annealing algorithm that tries to find a minimum to the function 'FUN'.
%
%INPUTS:
%
%'F... |
github | rishabhdutta/Fukuoka_project-master | momentmag.m | .m | Fukuoka_project-master/Noor/GPS_D17pt_D246/bin_util/momentmag.m | 315 | utf_8 | 3992130605cda82f0b08ef99e99fa45a |
function out = momentmag(in);
% function out = momentmag(in);
% in - okada parameters
nls = in;
rig = 2.5e10; % shear modulus
slipmag = sqrt( nls(:,8).^2 + nls(:,9).^2 ); % slip magnitude
gmom = nls(:,1).* nls(:,2).* 1e6 .* slipmag;
moment = rig*gmom;
Mw = 2*log10(moment)/3 - 6.03;
out = Mw;
|
github | rishabhdutta/Fukuoka_project-master | momentmag.m | .m | Fukuoka_project-master/figures/figure3/fig_extras/momentmag.m | 315 | utf_8 | 3992130605cda82f0b08ef99e99fa45a |
function out = momentmag(in);
% function out = momentmag(in);
% in - okada parameters
nls = in;
rig = 2.5e10; % shear modulus
slipmag = sqrt( nls(:,8).^2 + nls(:,9).^2 ); % slip magnitude
gmom = nls(:,1).* nls(:,2).* 1e6 .* slipmag;
moment = rig*gmom;
Mw = 2*log10(moment)/3 - 6.03;
out = Mw;
|
github | PhDP/mlbop-master | denoising_9_22.m | .m | mlbop-master/matlab/MATLAB-9/denoising_9_22.m | 3,084 | utf_8 | 372538357807ff2f57d98c3106eba25b | %--------------------------------------------------------------------
% Exercise 9.22
% SparseLab is used here (downloaded from https://sparselab.stanford.edu/)
% It can be replaced with any other sparse construction tool/algorithm.
%------------------------------------------------------------------------
functi... |
github | PhDP/mlbop-master | BATcs_10_14.m | .m | mlbop-master/matlab/MATLAB-10/BATcs_10_14.m | 10,863 | utf_8 | 4baa4058d118163f98c98e07f396a8f4 | %----------------------------------------------------------------
% Exercise 10.14
% Time-frequency analysis of echolocation signals transmitted by bats.
% The Time-Frequency toolbox (http://tftb.nongnu.org/) need to be
% downloaded and added to the matlab path
% addpath('tftb/mfiles').
%-------------------------------... |
github | PhDP/mlbop-master | OMPCSMP_10_12.m | .m | mlbop-master/matlab/MATLAB-10/OMPCSMP_10_12.m | 2,250 | utf_8 | 20d2715f694e27ad011ee9d092cf911b | %-----------------------------------------------------------------
% Exercise 10.12
% Implements the OMP and CSMP algorithms.
%----------------------------------------------------------------
function Matlab10_12
% Chooze a fixed signal length.
l = 100;
alpha = 0.2; % set alpha equal to 0.8 for questio... |
github | PhDP/mlbop-master | MRIcs_10_13.m | .m | mlbop-master/matlab/MATLAB-10/MRIcs_10_13.m | 1,258 | utf_8 | 2908aaa6da55f77773b071900389a9b4 | %-------------------------------------------------------------
% Exercise 10.13
% MRI reconstruction.
% The NESTA toolbox need to be downloaded and added to the matlab path
% (http://statweb.stanford.edu/~candes/nesta/nesta.html).
% Hadamard function (distributed with NESTA) might also need compiling.
%---------------... |
github | PhDP/mlbop-master | Matlab19_9.m | .m | mlbop-master/matlab/MATLAB-19/Matlab19_9.m | 2,728 | utf_8 | e8def42d61bd634b0a185cdb4e9f9e2e | %-------------------------------------------------------------------------------
% Exercise 19.9
% You must download the images from
% http://cgi.di.uoa.gr/~stheodor/faces.rar
%--------------------------------------------------------------------------------
function Matlab19_9
sizeimages = 168;
dirname = [... |
github | PhDP/mlbop-master | ICA_19_11.m | .m | mlbop-master/matlab/MATLAB-19/ICA_19_11.m | 1,244 | utf_8 | 51b5c5830bde8eb6d03ae61648113fcd | %-----------------------------------------------------------------------------------------------
% Exercise 19.11
% ICA.
% The fast ICA toolbox need to be downloaded from http://research.ics.aalto.fi/ica/fastica/
% and added in the matlab path
% addpath([pwd,filesep,'FastICA']);
%---------------------------------... |
github | PhDP/mlbop-master | Matlab19_10.m | .m | mlbop-master/matlab/MATLAB-19/Matlab19_10.m | 1,976 | utf_8 | 0c985db7b793032a73ee854978c60e7f | %-------------------------------------------------------------------------------
% Exercise 19.10
% You must download the images from
% http://cgi.di.uoa.gr/~stheodor/faces.rar
%--------------------------------------------------------------------------------
function Matlab19_10
sizeimages = 168;
dirname =... |
github | PhDP/mlbop-master | non_zero_cardinality.m | .m | mlbop-master/matlab/MATLAB-11/Exercise 11_22 (Online Learning in RKHS)/non_zero_cardinality.m | 140 | utf_8 | a79c804eab106f1cf5bc7288d8dc1975 |
function r = non_zero_cardinality(vector)
r=0;
N = length(vector);
for i=1:N
if vector(i)~=0
r = r+1;
end;
end; |
github | PhDP/mlbop-master | compute_subgrad_coef.m | .m | mlbop-master/matlab/MATLAB-11/Exercise 11_22 (Online Learning in RKHS)/compute_subgrad_coef.m | 753 | utf_8 | 7d70b16a2c8e4c0e71c3e77efecd6b8b |
function subgrad_coef = compute_subgrad_coef(x,d,e,n,i,epsilon,loss_type,loss_params)
switch loss_type
case 'l2'
if e(i)^2 <= epsilon
subgrad_coef = 0;
else
subgrad_coef = -2*e(i);
end;
case 'l1'
if abs(e(i)) <= epsilo... |
github | PhDP/mlbop-master | QKernel_APSM.m | .m | mlbop-master/matlab/MATLAB-11/Exercise 11_22 (Online Learning in RKHS)/QKernel_APSM.m | 7,133 | utf_8 | 2c3113e848118a8037a9ddfae73622e2 | %*******************************************************************
%Kernel APSM algorithm with quantization sparsification method.
%started: 05/02/2011
%ended: 11/02/2011
%Created by Pantelis Bouboulis
%-------------------------------------------------------------------
%Description
%
%Phi(u_n) ------> filter... |
github | PhDP/mlbop-master | Kappa.m | .m | mlbop-master/matlab/MATLAB-11/Exercise 11_22 (Online Learning in RKHS)/Kappa.m | 1,278 | utf_8 | d13dbd8408d517165089bd2811698262 |
function value=Kappa(x,y,type,param)
switch type
case 'gaus'
sigma=param(1);
N=length(x);
norm=0;
for i=1:N
norm = norm + (x(i)-y(i))^2;
end;
value = exp( -norm/sigma^2 );
case 'gaus_f'
sigma=param(1);
N... |
github | PhDP/mlbop-master | QKernel_NLMS.m | .m | mlbop-master/matlab/MATLAB-11/Exercise 11_22 (Online Learning in RKHS)/QKernel_NLMS.m | 4,311 | utf_8 | 35085bb579a796364be2707e8813425d | %*******************************************************************
%Kernel LMS algorithm.
%started: 03/03/2010
%ended: 16/03/2010
%updated: 05/02/2011
%-------------------------------------------------------------------
%Description
%
%y_n = <Phi(u_n), w>
%minimize |d_n - y_n|^2
%
% The Algorithm compute... |
github | PhDP/mlbop-master | loss_epsilon.m | .m | mlbop-master/matlab/MATLAB-11/Exercise 11_22 (Online Learning in RKHS)/loss_epsilon.m | 430 | utf_8 | 1205018f9cdb9ac6a05807545c836e63 |
function val = loss_epsilon(ksi, epsilon, loss_type, loss_params)
switch loss_type
case 'l2'
val = max(0, ksi^2 - epsilon);
case 'l1'
val = max(0, abs(ksi) - epsilon);
case 'huber'
sigma = loss_params(1);
if abs(ksi) <= sigma
val = max(0, ksi^2/(2... |
github | PhDP/mlbop-master | kappa.m | .m | mlbop-master/matlab/MATLAB-11/Exercise 11_21 (Support Vector Machines)/kappa.m | 1,017 | utf_8 | 9280a4679770a7a4a0819b2819bf5858 |
function value = kappa(x,y, kernel_type, kernel_params)
if (strcmp(kernel_type,'gaus')==1)
sigma = kernel_params(1);
N=length(x);
norm = sum( (x-y).^2 );
value = exp( -norm/sigma^2 );
elseif (strcmp(kernel_type,'gaus_c')==1)
sigma = kernel_params(1);
N=length(x);
exponent = su... |
github | PhDP/mlbop-master | kappa.m | .m | mlbop-master/matlab/MATLAB-11/Exercise 11_20 (Suport Vector Regression)/kappa.m | 1,017 | utf_8 | 9280a4679770a7a4a0819b2819bf5858 |
function value = kappa(x,y, kernel_type, kernel_params)
if (strcmp(kernel_type,'gaus')==1)
sigma = kernel_params(1);
N=length(x);
norm = sum( (x-y).^2 );
value = exp( -norm/sigma^2 );
elseif (strcmp(kernel_type,'gaus_c')==1)
sigma = kernel_params(1);
N=length(x);
exponent = su... |
github | PhDP/mlbop-master | kappa.m | .m | mlbop-master/matlab/MATLAB-11/Exercise 11.19 (Kernel Ridge Regression)/kappa.m | 1,017 | utf_8 | 9280a4679770a7a4a0819b2819bf5858 |
function value = kappa(x,y, kernel_type, kernel_params)
if (strcmp(kernel_type,'gaus')==1)
sigma = kernel_params(1);
N=length(x);
norm = sum( (x-y).^2 );
value = exp( -norm/sigma^2 );
elseif (strcmp(kernel_type,'gaus_c')==1)
sigma = kernel_params(1);
N=length(x);
exponent = su... |
github | PhDP/mlbop-master | tls.m | .m | mlbop-master/matlab/MATLAB-6/tls.m | 695 | utf_8 | d542ca9ce5b46a07d050a83200a00c71 | %=====================================================================
% Exercise 6.22
% This script implements the Total Least Squares algoritm
%=====================================================================
function x = tls(A,b,thresh)
% Solves the linear equation Ax=b using
% truncated total least... |
github | PhDP/mlbop-master | RLStracking_6_21.m | .m | mlbop-master/matlab/MATLAB-6/RLStracking_6_21.m | 1,744 | utf_8 | d4ece090ea43a0fe56b023bb0c0ca539 | %====================================================================
% Exercise 6.21
% Time-varying parameter estimation using the RLS and the
% NLMS.
%====================================================================
function RLStrack
close all
clear
L=5;%Dimension of the unknown vector
N=1000; %Nu... |
github | PhDP/mlbop-master | RLS_6_20.m | .m | mlbop-master/matlab/MATLAB-6/RLS_6_20.m | 2,299 | utf_8 | 454be65bde72bed4d8d43a1f45e9cb1b | %=======================================================================
% Exercise 6.20
% This function generates the model, the data and runs the RLS, the NLMS
% and the APA algorithms.
%========================================================================
function RLS
figure
L=200;%Dimension of the unkno... |
github | PhDP/mlbop-master | APSM_distrib.m | .m | mlbop-master/matlab/MATLAB-8/APSM_distrib.m | 3,260 | utf_8 | cb842b8d12f760294bc3d490e5bee231 | %=====================================================================
% Exercise 8.39
% This script implements the CTA APSM algorithm
%=====================================================================
function [err, x]=APSM_distrib_sparse(inputvec,y,data,errfun)
L = data.L; N = data.N;
mu = data.mu;... |
github | PhDP/mlbop-master | APSM_8_38.m | .m | mlbop-master/matlab/MATLAB-8/APSM_8_38.m | 3,636 | utf_8 | 1c4e1b759b7db3a4bd4707446d229ca9 | %=====================================================================
% Exercise 8.38
% This script generates the model, the data and runs
% the APSM, the RLS, the APA and the NLMS algorithms.
%=====================================================================
function APSM
figure
L=200;%Dimension o... |
github | PhDP/mlbop-master | pegasos_8_40.m | .m | mlbop-master/matlab/MATLAB-8/pegasos_8_40.m | 1,741 | utf_8 | 2422c0848f83c85571fa76f44b87f2a3 | %===================================================================
% Exercise 8.40
% Implementation of the Pegasos Algorithm.
%==================================================================
function [wT,b] = pegasos(X,Y,lamda,k,maxIter,Tolerance)
% X imput matrix
% Y labels
% lamda stepsize parameter of pegasos
... |
github | PhDP/mlbop-master | distributed_APSM_LMS_8_39.m | .m | mlbop-master/matlab/MATLAB-8/distributed_APSM_LMS_8_39.m | 5,769 | utf_8 | b22e2706a5a6bc31f3b45c20638bd39c | %=======================================================================
% Exercise 8.39
% The script generates the data and the network.
% The CTA APSM is compared to
% the CTA LMS, the ATC LMS and the non-cooperative LMS algorithms.
%======================================================================
fu... |
github | PhDP/mlbop-master | LMS_distrib_ATC.m | .m | mlbop-master/matlab/MATLAB-8/LMS_distrib_ATC.m | 2,519 | utf_8 | a48457a0ce9f666f3603f84f188f7f18 | %=====================================================================
% Exercise 8.39
% This script implements the ATC LMS algorithm
%=====================================================================
function [err, x]=LMS_distrib_sparse(inputvec,y,data,errfun)
%Initialization
L = data.L; N = data.N;
mu =... |
github | PhDP/mlbop-master | makenetwork.m | .m | mlbop-master/matlab/MATLAB-8/makenetwork.m | 2,092 | utf_8 | 12a6c65fceb799ec00982a13b376c81a | %=====================================================================
% Exercise 8.39
% This script generates the network for the distributed adaptive
% learning experiments.
%=====================================================================
function [N,A,connected] = makenetwork(nodes,connections,ruleweigh... |
github | PhDP/mlbop-master | LMS_distrib_CTA.m | .m | mlbop-master/matlab/MATLAB-8/LMS_distrib_CTA.m | 2,780 | utf_8 | bf277dff8ba0b6ab33ad4b1459edf0a3 | %=====================================================================
% Exercise 8.39
% This script implements the CTA LMS algorithm
%=====================================================================
function [err, x]=LMS_distrib_sparse(inputvec,y,data,errfun)
L = data.L; N = data.N;
mu = data.mu;
if... |
github | PhDP/mlbop-master | tracking_17_12.m | .m | mlbop-master/matlab/MATLAB-17/tracking_17_12.m | 3,992 | utf_8 | 2d303bb819dbfaeaff7763a0b7c45b3a | %-----------------------------------------------------------------
% Exercise 15.11
% Visual Tracking
% Use particle filter for tracking a circle moving according to
% a random uniform model in the image.
%
% Includes functions for circle plotting, likelihood estimation
% and particle sampling.
%
% Wr... |
github | PhDP/mlbop-master | error_ellipse.m | .m | mlbop-master/matlab/MATLAB-13/error_ellipse.m | 8,067 | utf_8 | 1ce76bb820fef22f78d8036863501121 | function h=error_ellipse(varargin)
% ERROR_ELLIPSE - plot an error ellipse, or ellipsoid, defining confidence region
% ERROR_ELLIPSE(C22) - Given a 2x2 covariance matrix, plot the
% associated error ellipse, at the origin. It returns a graphics handle
% of the ellipse that was drawn.
%
% ERROR_ELLIPSE(C33)... |
github | PhDP/mlbop-master | SB1_KernelFunction.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_24/SB1_KernelFunction.m | 2,594 | utf_8 | b7370f5b3bc2ab39555ca06a3457d87c | % SB1_KERNELFUNCTION Compute kernel functions for the RVM model
%
% K = SB1_KERNELFUNCTION(X1,X2,KERNEL,LENGTH)
%
% OUTPUT ARGUMENTS:
%
% K N1 x N2 kernel matrix.
%
% INPUT ARGUMENTS:
%
% X1 N1 x d data matrix
% X2 N2 x d data matrix
% KERNEL Kernel type: c... |
github | PhDP/mlbop-master | SB1_Diagnostic.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_24/SB1_Diagnostic.m | 535 | utf_8 | 97415e30f346945c88be6f535f86471a | % SB1_DIAGNOSTIC Output neat diagnostic info with verbosity control
%
%
% Copyright 2009 :: Michael E. Tipping
%
% This file is part of the SPARSEBAYES baseline implementation (V1.10)
%
% Contact the author: m a i l [at] m i k e t i p p i n g . c o m
%
function SB1_Diagnostic(level, message_, varargin)
Diag... |
github | PhDP/mlbop-master | SB1_Estimate.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_24/SB1_Estimate.m | 5,586 | utf_8 | 730deb45d2830345f8f3484ae0090d19 | % SB1_ESTIMATE Estimate parameters in a sparse Bayesian model
%
% [W,USED,ML,A,B,G] = SB1_ESTIMATE(PHI,T,A,B,MAXITS,MONITS)
%
% OUTPUT ARGUMENTS:
%
% W Estimated weights (subset of full model)
% USED Indices of relevant basis vectors
% ML Marginal likelihood of final model... |
github | PhDP/mlbop-master | setEnvironment.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_24/setEnvironment.m | 895 | utf_8 | 389a783c5400cec72055913ea1f7b44e | % SETENVIRONMENT Set value of "global" variable
%
%
% Copyright 2009 :: Michael E. Tipping
%
% This file is part of the SPARSEBAYES baseline implementation (V1.10)
%
% Contact the author: m a i l [at] m i k e t i p p i n g . c o m
%
function setEnvironment(varargin)
switch nargin
%
case 0,
% Initial... |
github | PhDP/mlbop-master | SB1_ExampleClassify.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_24/SB1_ExampleClassify.m | 4,186 | utf_8 | 2ee25937ef24cf3082165aa7d0c5c1a6 | % SB1_EXAMPLECLASSIFY Example of Sparse Bayes Classification
%
% SB1_EXAMPLECLASSIFY(N,KERNEL,WIDTH,MAXITS)
%
% INPUT ARGUMENTS:
%
% N Number of training points (up to 250)
% KERNEL Kernel function to use (see SB1_KERNELFUNCTION)
% WIDTH Kernel length scale parameter
% MAXITS... |
github | PhDP/mlbop-master | SB1_PosteriorMode.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_24/SB1_PosteriorMode.m | 4,157 | utf_8 | 3867817e1e122635ee08bc303a3265e4 | % SB1_POSTERIORMODE Find mode of posterior distribution (Bernoulli case)
%
% [W, UI, LMODE] = SB1_POSTERIORMODE(PHI,T,W,ALPHA,ITS)
%
% OUTPUT ARGUMENTS:
%
% W Parameter values at mode
% UI Inverse Cholesky factor of Hessian
% LMODE Log likelihood of data at mode
%
% I... |
github | PhDP/mlbop-master | SB1_ExampleRegress.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_24/SB1_ExampleRegress.m | 2,960 | utf_8 | dff444c7452808b3e444f5642c4592c6 | % SB1_EXAMPLEREGRESS Example of Sparse Bayes Regression
%
% SB1_EXAMPLEREGRESS(N,NOISE,KERNEL,WIDTH,MAXITS)
%
% INPUT ARGUMENTS:
%
% N Number of training points
% NOISE Noise standard deviation to be added
% KERNEL Kernel function to use (see SB1_KERNELFUNCTION)
% WIDTH Ker... |
github | PhDP/mlbop-master | getEnvironment.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_24/getEnvironment.m | 390 | utf_8 | 581e424b3e8c67ea9dd9e885bd2aed0c | % GETENVIRONMENT Read value of "global" variable
%
%
% Copyright 2009 :: Michael E. Tipping
%
% This file is part of the SPARSEBAYES baseline implementation (V1.10)
%
% Contact the author: m a i l [at] m i k e t i p p i n g . c o m
%
function value = getEnvironment(variable)
VA = get(0,'UserData');
if isfi... |
github | PhDP/mlbop-master | SB1_RVM.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_24/SB1_RVM.m | 2,769 | utf_8 | af5e3d63fd9a4a9decbda38805265c6b | % SB1_RVM Kernel specialisation of sparse Bayes model (RVM)
%
% [WEIGHTS, USED, BIAS, ML, ALPHA, BETA, GAMMA] = ...
% SB1_RVM(X,T,ALPHA,BETA,KERNEL,LEN,USEBIAS,MAXITS,MONITS)
%
% OUTPUT ARGUMENTS:
%
% WEIGHTS Parameter values of estimated model (sparse)
% USED Index vector of "relevant" ... |
github | PhDP/mlbop-master | vdpgm.m | .m | mlbop-master/matlab/MATLAB-13/Exercise_13_26/vdpgm.m | 49,336 | utf_8 | 9a85147eb2a74b8531352db5bae39573 | function [results] = vdpgm(given_data, opts)
%
% function [results] = vdpgm(given_data, opts)
%
start_time = clock;
if nargin == 1
opts = struct();
end
if issparse(given_data)
given_data = full(given_data);
end
if ~ isfield(opts, 'algorithm')
% algorithm can be one of 'vdp', 'bj', 'cdp', 'csb' and 'non_dp'
% v... |
github | PhDP/mlbop-master | LMSWhiteAR_5_20.m | .m | mlbop-master/matlab/MATLAB-5/LMSWhiteAR_5_20.m | 1,949 | utf_8 | cfb17a705540c07abdaccc65d8d27665 | %====================================================================
% Exercise 5.20.
% This function generates the model and data for white noise
% as well as an AR process, and runs the LMS algorithm.
%=====================================================================
function LMS
figure
L=10;%Di... |
github | PhDP/mlbop-master | APA_5_22.m | .m | mlbop-master/matlab/MATLAB-5/APA_5_22.m | 2,557 | utf_8 | 030653773e6d140bcb34660d4989d759 | %=====================================================================
% Exercise 5.22
% This function generates the model and runs the LMS, the NLMS
% and the APA algorithm for two different choices of the parameter q.
%======================================================================
function APA
... |
github | PhDP/mlbop-master | grad_descent_contours_5_18.m | .m | mlbop-master/matlab/MATLAB-5/grad_descent_contours_5_18.m | 1,899 | utf_8 | 2fa5f442974c0caad33e33c55694adad | %=========================================================
% Exercise 5.18
% This function plots the convergence path together with the
% isovalue contours of the covariance matrix Sigma.
%=========================================================
function [xopt,fopt,niter,gnorm,dx] = grad_descent(varargi... |
github | PhDP/mlbop-master | TDLMS_5_21.m | .m | mlbop-master/matlab/MATLAB-5/TDLMS_5_21.m | 1,706 | utf_8 | 9f3411bbd98207a0bb8674ae66dd0feb | %================================================================
% Exercise 5.21.
% This function generates the model
% and runs the LMS and the TDLMS algorithms
% for the AR process input scenario.
%=================================================================
function TDLMS
close
L=10;%Dimension ... |
github | PhDP/mlbop-master | LMSwhitenoise_5_20.m | .m | mlbop-master/matlab/MATLAB-5/LMSwhitenoise_5_20.m | 1,479 | utf_8 | 77e18a71fe28db2dae326cb6c5348692 | %====================================================================
% Exercise 5.20.
% This function generates the model for the white input scenario,
% and runs the LMS algorithm for two different
% choices of the stepsize.
%====================================================================
function LMS... |
github | PhDP/mlbop-master | grad_descent_errplot_5_18.m | .m | mlbop-master/matlab/MATLAB-5/grad_descent_errplot_5_18.m | 3,272 | utf_8 | 7ae6dcd073b9de94d4181899df012c86 | %========================================================
% Exercise 5.18
% This function computes the error curves
% for the Sigma=[1 0;0 0.1] covariance scenario.
% Two curves are presented, the first one
% corresponding to the optimum step-size \mu_o
% and the second one corresponding to \mu_o/2.
%==========... |
github | PhDP/mlbop-master | LMScorelated_5_20.m | .m | mlbop-master/matlab/MATLAB-5/LMScorelated_5_20.m | 1,513 | utf_8 | 48a25586bd6a5bc981e61cb64ba587b7 | %================================================================
% Exercise 5.20.
% This function generates the model for the correlated AR input
% scenario and runs the LMS algorithm for two different
% choices of the stepsize.
%================================================================
function LMSco... |
github | PhDP/mlbop-master | distributed_LMS_5_24.m | .m | mlbop-master/matlab/MATLAB-5/distributed_LMS_5_24.m | 5,324 | utf_8 | 8d44d69423da80a4b49f197d32454e0b | %===================================================================
% Exercise 5.24.
% This is the main function of the exercise.
% It generates the network, produces the data
% and calls the ATC, CTA and non--cooperative LMS functions.
% Running it, it may take some time.
%=====================================... |
github | PhDP/mlbop-master | error_ellipse.m | .m | mlbop-master/matlab/MATLAB-12/error_ellipse.m | 8,067 | utf_8 | 1ce76bb820fef22f78d8036863501121 | function h=error_ellipse(varargin)
% ERROR_ELLIPSE - plot an error ellipse, or ellipsoid, defining confidence region
% ERROR_ELLIPSE(C22) - Given a 2x2 covariance matrix, plot the
% associated error ellipse, at the origin. It returns a graphics handle
% of the ellipse that was drawn.
%
% ERROR_ELLIPSE(C33)... |
github | daniel-auger/Li-S_ECN_Model-master | uninstall_LiS_ECN_Model.m | .m | Li-S_ECN_Model-master/uninstall_LiS_ECN_Model.m | 1,410 | utf_8 | 02a6808465ed774a3c9a21fe6240afd3 | function uninstall_LiS_ECN_Model
%uninstall_LiS_ECN_Model Uninstall script for LiS_ECN_Model.
% uninstall_LiS_ECN_Model removes the folders needed by
% the LiS ECN Model from the MATLAB search path for the
% current session and all future sessions.
% Copyright 2016 Cranfield University
% Please see accompan... |
github | daniel-auger/Li-S_ECN_Model-master | install_LiS_ECN_Model.m | .m | Li-S_ECN_Model-master/install_LiS_ECN_Model.m | 1,131 | utf_8 | b8eb18f9b3a2b7b82d914bbea0cac716 | function install_LiS_ECN_Model
%install_LiS_ECN_Model Installation script for LiS_ECN_Model.
% install_LiS_ECN_Model adds the folders needed by the LiS
% ECN Model to the MATLAB search path for the current
% session and all future sessions.
% Copyright 2016 Cranfield University
% Please see accompanying lice... |
github | jamesfolberth/ieee_adjoints-master | bce_noncvx_objective.m | .m | ieee_adjoints-master/bce/bce_noncvx_objective.m | 2,705 | utf_8 | b85e9e1f2050ff098e7176bf15595b1b | function [f, df] = bce_noncvx_objective(x, nc, lh, lm, y, lambda_h_TV, huber_d)
% x = [h1; h2; m]
% min_{h,m} 1/2 ||y - A(h*m')||_2^2 + lambda_h ||h||_1 + lambda_m ||m||_1
%
% Here we compute the 1/2||...||_2^2 term and its gradient.
%
% This is restricted to h_i, m real, but maybe it's possible to extend to complex s... |
github | jamesfolberth/ieee_adjoints-master | driver.m | .m | ieee_adjoints-master/wavelet/driver.m | 5,437 | utf_8 | 307f45a954e51a5f87d60022e512eca7 | function [Xout] = driver()
addpath('./adjoints')
addpath('./HNO')
%X = double(imread('cameraman.pgm'));
%X = double(imread('cameraman_resize.pgm'));
%X = double(imread('texmos3.pgm')); % from USC-SIPI
%X = double(imread('clock.pgm')); % from USC-SIPI
%X = double(imread('resolution.pgm')); % from USC-SIPI
X = double... |
github | jamesfolberth/ieee_adjoints-master | fval_driver.m | .m | ieee_adjoints-master/wavelet/fval_driver.m | 4,777 | utf_8 | 0cdb552b5691d4d85294853ddccc7f0e | function [] = fval_driver()
addpath('./adjoints')
addpath('./HNO')
%X = double(imread('cameraman.pgm'));
%X = double(imread('cameraman_resize.pgm'));
%X = double(imread('texmos3.pgm')); % from USC-SIPI
%X = double(imread('clock.pgm')); % from USC-SIPI
X = double(imread('resolution.pgm')); % from USC-SIPI
X = X/255;... |
github | jamesfolberth/ieee_adjoints-master | fval_plotter.m | .m | ieee_adjoints-master/wavelet/fval_plotter.m | 1,656 | utf_8 | 4367bb3ee090cafe9869d74fdf02573e | function [] = fval_plotter()
addpath('export_fig/');
%fval();
%psnr();
ssim();
end
function [] = fval()
savefile = 'resolution_bior4.4_sym_fval.mat';
S = load(savefile);
fun_all_pinv = S.fun_all_pinv;
fun_all = S.fun_all;
fun_all_star = S.fun_all_star;
fstar = min(fun_all_star(:));
figure();
iters = 1:length(fu... |
github | jamesfolberth/ieee_adjoints-master | extension_pinv_adjoint_2d.m | .m | ieee_adjoints-master/wavelet/adjoints/extension_pinv_adjoint_2d.m | 2,738 | utf_8 | 8c34d8d5bd124091db5a3bd2278b7b0a | function [xe] = extension_pinv_adjoint_2d(x, lX, le, extmode)
% extension_pinv_adjoint_2d - adjoint of pinv of 2d signal extension operator
%
% xe = extension_pinv_adjoint_2d(x, lX, le, extmode) applies the adjoint of
% pseudoinverse of the 2d signal extension operator to the matrix xe. lX
% is the size of the ori... |
github | kbodwin/Differential-Correlation-Mining-master | stdize.m | .m | Differential-Correlation-Mining-master/DCM_Matlab/stdize.m | 290 | utf_8 | 605b2715701f6801158d3d3dd66bbc43 | % Standardize rows of matrix of data
function M = stdize(M)
% Number of cols of matrix
n = size(M,2);
% Subtract mean of each row
M = M - repmat(mean(M,2), 1, n);
% Find sd of each row
sds = std(M, 0, 2)*sqrt((n-1));
% Return stdized
M = M./repmat(sds, 1, n);
end |
github | jmarlena/linguist-master | convert_variable.m | .m | linguist-master/samples/Matlab/convert_variable.m | 2,186 | utf_8 | 3d73feb0b3feaa01d8b434d83f275241 | function [name, order] = convert_variable(variable, output)
% Returns the name and order of the given variable in the output type.
%
% Parameters
% ----------
% variable : string
% A variable name.
% output : string.
% Either `moore`, `meijaard`, `data`.
%
% Returns
% -------
% name : string
% The variable name i... |
github | jmarlena/linguist-master | create_ieee_paper_plots.m | .m | linguist-master/samples/Matlab/create_ieee_paper_plots.m | 34,238 | utf_8 | 3cf9c020f3fbd215ddc5182743c38bc8 | function create_ieee_paper_plots(data, rollData)
% Creates all of the figures for the IEEE paper.
%
% Parameters
% ----------
% data : structure
% A structure contating the data from generate_data.m for all of the bicycles
% and speeds for the IEEE paper.
% rollData : structure
% The data for a single bicycle at ... |
github | jmarlena/linguist-master | plant.m | .m | linguist-master/samples/Matlab/plant.m | 2,087 | utf_8 | daf74d53d9253d37bd69d59c76021156 | function Yc = plant(varargin)
% function Yc = plant(varargin)
%
% Returns the system plant given a number.
%
% Parameters
% ----------
% varargin : variable
% Either supply a single argument {num} or three arguments {num1, num2,
% ratio}. If a single argument is supplied, then one of the six transfer
% functions ... |
github | StanfordASL/GMT-master | dubinsCar.m | .m | GMT-master/viz/dubinsCar.m | 5,206 | utf_8 | c58036c72db56e6675e0254b7a632db7 | % time optimal dubins car path, 2d (x, y, theta)
function [path, cmin] = dubinsCar(x0,x1,numDisc,v,thetadotBound)
v = x1(1:2) - x0(1:2);
d = norm(v); % distance
th = atan2(v(2),v(1)); % angle between spatial locations
a = mod2piF(x0(3) - th); % angular difference from line
b = mod2piF(x1(3) - th); % angular difference ... |
github | StanfordASL/GMT-master | dubinsAirplane.m | .m | GMT-master/viz/dubinsAirplane.m | 883 | utf_8 | 2dec24008402de3749ef69e87bfa25f6 | %% time optimal dubins airplane, 4d (x,y,z,theta)
% following http://msl.cs.uiuc.edu/~lavalle/papers/ChiLav07b.pdf
% and http://www.et.byu.edu/~beard/papers/preprints/BeardMcLain__.pdf
% min turning radius is 1, max altitude rate is unbounded, velocity xy is 1
% note unbounded altitude unlike previous works, has no eff... |
github | pfoser/mapconstruction-master | DiscreteFrechetDist.m | .m | mapconstruction-master/evaluation/shortest_path_evaluation/libraries/DiscreteFrechetDist.m | 3,409 | utf_8 | 6ac6f9bd79e1bbb81b5c41d9a71cf790 | function cm = DiscreteFrechetDist(P,Q)
% Calculates the discrete Frechet distance between curves P and Q
%
% cm = DiscreteFrechetDist(P,Q)
%
% P and Q are two sets of points that define polygonal curves with rows of
% vertices (data points) and columns of dimensionality. The points along
% the curves are taken t... |
github | pfoser/mapconstruction-master | meshReduce.m | .m | mapconstruction-master/algorithms/Karagiorgou_tracebundle/libraries/matGeom/meshes3d/meshReduce.m | 9,526 | utf_8 | 46edf9c3fecb02bc41febc0e7698f5e5 | function varargout = meshReduce(nodes, varargin)
%MESHREDUCE Merge coplanar faces of a polyhedral mesh
%
% [NODES FACES] = meshReduce(NODES, FACES)
% [NODES EDGES FACES] = meshReduce(NODES, EDGES, FACES)
% NODES is a set of 3D points (as a Nn-by-3 array),
% and FACES is one of:
% - a Nf-by-X array containing... |
github | pfoser/mapconstruction-master | meshSurfaceArea.m | .m | mapconstruction-master/algorithms/Karagiorgou_tracebundle/libraries/matGeom/meshes3d/meshSurfaceArea.m | 1,902 | utf_8 | cebeb0d58fb007d200040c4afb4ff077 | function area = meshSurfaceArea(vertices, edges, faces)
%MESHSURFACEAREA Surface area of a polyhedral mesh
%
% S = meshSurfaceArea(V, F)
% S = meshSurfaceArea(V, E, F)
% Computes the surface area of the mesh specified by vertex array V and
% face array F. Vertex array is a NV-by-3 array of coordinates.
... |
github | pfoser/mapconstruction-master | drawEdge.m | .m | mapconstruction-master/algorithms/Karagiorgou_tracebundle/libraries/matGeom/geom2d/drawEdge.m | 3,460 | utf_8 | 6c7586a0ca0e602872562b32107c4c1f | function varargout = drawEdge(varargin)
%DRAWEDGE Draw an edge given by 2 points
%
% drawEdge(x1, y1, x2, y2);
% draw an edge between the points (x1 y1) and (x2 y2).
%
% drawEdge([x1 y1 x2 y2]) ;
% drawEdge([x1 y1], [x2 y2]);
% specify data either as bundled edge, or as 2 points
%
% The functi... |
github | pfoser/mapconstruction-master | enclosingCircle.m | .m | mapconstruction-master/algorithms/Karagiorgou_tracebundle/libraries/matGeom/geom2d/enclosingCircle.m | 1,898 | utf_8 | 8bca31625eaa9ea76cd9ee4034bfb2cf | function circle = enclosingCircle(pts)
%ENCLOSINGCIRCLE Find the minimum circle enclosing a set of points.
%
% CIRCLE = enclosingCircle(POINTS);
% compute cirlce CIRCLE=[xc yc r] which enclose all points POINTS given
% as an [Nx2] array.
%
%
% Rewritten from a file from
% Yazan Ahed (yash78@g... |
github | pfoser/mapconstruction-master | gcontour3d.m | .m | mapconstruction-master/algorithms/Karagiorgou_tracebundle/libraries/matGeom/graphs/gcontour3d.m | 3,868 | utf_8 | b5b004f9454217da3f4eed479cf5fa59 | function [nodes, edges, faces] = gcontour3d(img)
%GCONTOUR3D Create contour graph of a 3D binary image.
%
%
%
% ---------
%
% author : David Legland
% INRA - TPV URPOI - BIA IMASTE
% created the 28/06/2004.
%
nodes = zeros([0 3]); % 3 coordinates vertices
edges = zeros([0 2]); % first node and second node... |
github | pfoser/mapconstruction-master | drawGraph.m | .m | mapconstruction-master/algorithms/Karagiorgou_tracebundle/libraries/matGeom/graphs/drawGraph.m | 7,288 | utf_8 | c8b5391263238c5857828fec9a7f6362 | function varargout = drawGraph(varargin)
%DRAWGRAPH Draw a graph, given as a set of vertices and edges
%
% DRAWGRAPH(NODES, EDGES)
% draw a graph specified by a set of nodes (array N*2 or N*3,
% corresponding to coordinate of each node), and a set of edges (an array
% Ne*2, containing for each edge the f... |
github | pfoser/mapconstruction-master | polynomialCurveSetFit.m | .m | mapconstruction-master/algorithms/Karagiorgou_tracebundle/libraries/matGeom/polynomialCurves2d/polynomialCurveSetFit.m | 5,584 | utf_8 | 8dc90a6635bc63b29724ba33fb521305 | function [coefs lblBranches] = polynomialCurveSetFit(seg, varargin)
%POLYNOMIALCURVESETFIT Fit a set of polynomial curves to a segmented image
%
% COEFS = polynomialCurveSetFit(IMG);
% COEFS = polynomialCurveSetFit(IMG, DEG);
% Result is a cell array of matrices. Each matrix is DEG+1-by-2, and
% contains ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.