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 | UMN-Hydro/GSFLOW_pre-processor-master | write_lpf_MOD2_f2.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_lpf_MOD2_f2.m | 5,547 | utf_8 | 7123a8788999fc93894d61afd875da5e | % write_lpf_MOD
% 11/17/16
function write_lpf_MOD2_f2(GSFLOW_indir, infile_pre, surfz_fil, NLAY)
% % =========== TO RUN AS SCRIPT ===========================================
% clear all, close all, fclose all;
% % - directories
% % MODFLOW input files
% GSFLOW_indir = '/home/gcng/workspace/ProjectFiles/AndesWaterReso... |
github | UMN-Hydro/GSFLOW_pre-processor-master | write_ba6_MOD3.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_ba6_MOD3.m | 6,046 | utf_8 | c967103aeca207643dcd775bdb4760b4 | % write_ba6_MOD
% 11/17/16
function write_ba6_MOD3(GSFLOW_indir, infile_pre, mask_fil)
% % ==== TO RUN AS SCRIPT ===================================================
% clear all, close all, fclose all;
% % - directories
% % MODFLOW input files
% GSFLOW_indir = '/home/gcng/workspace/ProjectFiles/AndesWaterResources/GSFLO... |
github | UMN-Hydro/GSFLOW_pre-processor-master | write_ba6_MOD2_bu.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_ba6_MOD2_bu.m | 5,863 | utf_8 | 1f12d52d0b1416b1514618c0791f04d0 | % write_ba6_MOD
% 11/17/16
function write_ba6_MOD2(GSFLOW_indir, infile_pre, surfz_fil, mask_fil, NLAY, DZ)
% % ==== TO RUN AS SCRIPT ===================================================
% clear all, close all, fclose all;
% % - directories
% % MODFLOW input files
% GSFLOW_indir = '/home/gcng/workspace/ProjectFiles/Ande... |
github | UMN-Hydro/GSFLOW_pre-processor-master | write_lpf_MOD2_f2_2.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_lpf_MOD2_f2_2.m | 7,349 | utf_8 | 1987d3c8d54b48bd223a82357bdba31d | % write_lpf_MOD
% 11/17/16
function write_lpf_MOD2_f2_2(GSFLOW_indir, infile_pre, surfz_fil, NLAY)
% % =========== TO RUN AS SCRIPT ===========================================
% clear all, close all, fclose all;
% % - directories
% % MODFLOW input files
% GSFLOW_indir = '/home/gcng/workspace/ProjectFiles/AndesWaterRe... |
github | UMN-Hydro/GSFLOW_pre-processor-master | make_sfr2_f_Mannings.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/make_sfr2_f_Mannings.m | 17,011 | utf_8 | e13e86b33d9983c53be1b54cc3a79c20 | % make_sfr.m
% 1/8/16
% Leila Saberi
%
% 2 - gcng
function make_sfr2_f_Mannings(GSFLOW_indir, infile_pre, reach_fil, segment_fil_all)
% Note: assume .dis file already created!! (reads in TOP for setting STRTOP)
% % ======== TO RUN AS SCRIPT ===============================================
% % clear all, close all, fcl... |
github | UMN-Hydro/GSFLOW_pre-processor-master | make_sfr2_f.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/make_sfr2_f.m | 16,998 | utf_8 | 0ad0153cb953fb0dc4dfac073cf5d6b4 | % make_sfr.m
% 1/8/16
% Leila Saberi
%
% 2 - gcng
function make_sfr2_f(GSFLOW_indir, infile_pre, reach_fil, segment_fil_all)
% Note: assume .dis file already created!! (reads in TOP for setting STRTOP)
% % ======== TO RUN AS SCRIPT ===============================================
% clear all, close all, fclose all;
% ... |
github | UMN-Hydro/GSFLOW_pre-processor-master | write_ba6_MOD2_ok.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_ba6_MOD2_ok.m | 5,863 | utf_8 | 1f12d52d0b1416b1514618c0791f04d0 | % write_ba6_MOD
% 11/17/16
function write_ba6_MOD2(GSFLOW_indir, infile_pre, surfz_fil, mask_fil, NLAY, DZ)
% % ==== TO RUN AS SCRIPT ===================================================
% clear all, close all, fclose all;
% % - directories
% % MODFLOW input files
% GSFLOW_indir = '/home/gcng/workspace/ProjectFiles/Ande... |
github | UMN-Hydro/GSFLOW_pre-processor-master | write_OC_PCG_MOD_f_ok.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_OC_PCG_MOD_f_ok.m | 2,464 | utf_8 | 1d9ed9195d98acdaca000e193ada7d77 | % write_OC_PCG_MOD.m
% 11/20/16
function write_OC_PCG_MOD_f(GSFLOW_indir, infile_pre)
% clear all, close all, fclose all;
% - write to this file
% GSFLOW_indir = '/home/gcng/workspace/ProjectFiles/AndesWaterResources/GSFLOW/inputs/MODFLOW/';
fil_pcg = [infile_pre, '.pcg'];
fil_oc = [infile_pre, '.oc'];
slashstr = '/'... |
github | UMN-Hydro/GSFLOW_pre-processor-master | write_nam_MOD_f2.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_nam_MOD_f2.m | 2,336 | utf_8 | b3ca150a14dec00616051b95a14ea82c | % write_nam_MOD
% 11/20/16
function write_nam_MOD_f2(GSFLOW_indir, GSFLOW_outdir, infile_pre, fil_res_in)
% v2 - allows for restart option (init)
% clear all, close all, fclose all;
% % - directories
% % MODFLOW input filesfil_res_in
% GSFLOW_indir = '/home/gcng/workspace/ProjectFiles/AndesWaterResources/GSFLOW/input... |
github | UMN-Hydro/GSFLOW_pre-processor-master | write_ba6_MOD3_2.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_ba6_MOD3_2.m | 6,046 | utf_8 | c967103aeca207643dcd775bdb4760b4 | % write_ba6_MOD
% 11/17/16
function write_ba6_MOD3(GSFLOW_indir, infile_pre, mask_fil)
% % ==== TO RUN AS SCRIPT ===================================================
% clear all, close all, fclose all;
% % - directories
% % MODFLOW input files
% GSFLOW_indir = '/home/gcng/workspace/ProjectFiles/AndesWaterResources/GSFLO... |
github | UMN-Hydro/GSFLOW_pre-processor-master | write_dis_MOD2_f.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_dis_MOD2_f.m | 5,326 | utf_8 | 2a486d8aebe770037a17329382652f18 | % write_dis_MOD (for 3D domains)
% 11/17/16
%
% v1 - 11/30/16 start to include GIS data for Chimborazo's Gavilan Machay
% watershed; topo.asc for surface elevation (fill in bottom elevation
% based on uniform thickness of single aquifer)
function write_dis_MOD2_f(GSFLOW_indir, infile_pre, surfz_fil, NLAY, DZ,... |
github | UMN-Hydro/GSFLOW_pre-processor-master | write_lpf_MOD2_f2_ok.m | .m | GSFLOW_pre-processor-master/matlab_scripts/MODFLOW_scripts/write_lpf_MOD2_f2_ok.m | 5,446 | utf_8 | 78b4bbbf2eb4c445215734e7c60a624a | % write_lpf_MOD
% 11/17/16
function write_lpf_MOD2_f2(GSFLOW_indir, infile_pre, surfz_fil, NLAY)
% % =========== TO RUN AS SCRIPT ===========================================
% clear all, close all, fclose all;
% % - directories
% % MODFLOW input files
% GSFLOW_indir = '/home/gcng/workspace/ProjectFiles/AndesWaterReso... |
github | victorlei/libermate-master | fox_rabbit.m | .m | libermate-master/Tests/fox_rabbit.m | 1,178 | utf_8 | 602c5dee8301607688c2500a9c52510e | function fox_rabbit
%FOX_RABBIT Fox-rabbit pursuit simulation.
% Uses relative speed parameter, K.
k = 1.1;
tspan = [0 10]; yzero = [3;0];
options = odeset('RelTol',1e-6,'AbsTol',1e-6,'Events',@events);
[tfox,yfox,te,ye,ie] = ode45(@fox2,tspan,yzero,options);
plot(yfox(:,1),yfox(:,2)), hold on
plo... |
github | victorlei/libermate-master | functiontest2.m | .m | libermate-master/Tests/functiontest2.m | 50 | utf_8 | e53e67b09926ff991d5a1ee2224940c2 | % Comment
function ret=myfunction(a,b,c)
ret=a
|
github | victorlei/libermate-master | lcrun.m | .m | libermate-master/Tests/lcrun.m | 1,252 | utf_8 | 5a6e1f2365db43e3c78240595f9dcd04 | function lcrun
%LCRUN Liquid crystal BVP.
% Solves the liquid crystal BVP for four different lambda values.
lambda_vals = [2.4, 2.5, 3, 10];
lambda_vals = lambda_vals(end:-1:1); % Necessary order for continuation.
solinit = bvpinit(linspace(-1,1,20),@lcinit);
lambda = lambda_vals(1); sola = bvp4c(@lc... |
github | victorlei/libermate-master | neural.m | .m | libermate-master/Tests/neural.m | 1,142 | utf_8 | 230a2509d261ffe4bdba2ce6d3856ba1 | function neural
%NEURAL Neural network model with delays.
tspan = [0 40];
sol = dde23(@f,[0.2,0.5],@history,tspan);
subplot(2,2,1)
plot(sol.x,sol.y(1,:),'r-', sol.x,sol.y(2,:),'g--', 'LineWidth',2)
legend('y_1','y_2')
title('\tau_1 = 0.2, \tau_2 = 0.5','FontSize',12)
xlabel t, ylabel('y','Rotation',0), yl... |
github | victorlei/libermate-master | poly1err.m | .m | libermate-master/Tests/poly1err.m | 530 | utf_8 | af1e12065da2b7d0735699f20a6e0022 | function max_err = poly1err(n)
%POLY1ERR Error in linear interpolating polynomial.
% POLY1ERR(N) is an approximation based on N sample points
% to the maximum difference between subfunction F and its
% linear interpolating polynomial at 0 and 1.
max_err = 0;
f0 = f(0); f1 = f(1);... |
github | victorlei/libermate-master | rosy.m | .m | libermate-master/Tests/rosy.m | 694 | utf_8 | 779115362bc6de592272293c187aff40 | function rosy(a, b)
%ROSY "Rose" figures.
% ROSY(A, B) plots the curve
% X = R*COS(A*theta), Y = R*SIN(A*theta), where
% R = SIN(A*B*theta) and 0 <= theta <= 2*PI (360 values).
% Suggestions: ROSY(97, 5); ROSY(43, 4); ROSY(79, n9), n a digit.
% P. M. Maurer, A rose is ... |
github | victorlei/libermate-master | rossler_ex0.m | .m | libermate-master/Tests/rossler_ex0.m | 947 | utf_8 | 5a8cb634db4f93b743a6d06be24b133c | function rossler_ex0
%ROSSLER_EX0 Run Rossler example.
% This is the recommended approach for MATLAB 6.5 and earlier.
% ROSSLER_EX0 runs in MATLAB 7, but ROSSLER_EX1 illustrates the style of
% coding now recommended for MATLAB 7.
tspan = [0 100]; yzero = [1;1;1];
options = odeset('AbsTol',1e-7,'RelTol',1e-4);
... |
github | victorlei/libermate-master | skiprun.m | .m | libermate-master/Tests/skiprun.m | 851 | utf_8 | 029ef542f0f4a4b7f1a4396178755b86 | function sol = skiprun
%SKIPRUN Skipping rope BVP/eigenvalue example.
solinit = bvpinit(linspace(0,1,10),@skipinit,5);
sol = bvp4c(@skip,@skipbc,solinit);
plot(sol.x,sol.y(1,:),'-', sol.x,sol.yp(1,:),'--', 'LineWidth',4)
xlabel('x','FontSize',12)
legend('y_1','y_2')
% ------------------------ Subfunctions -... |
github | victorlei/libermate-master | fisher.m | .m | libermate-master/Tests/fisher.m | 1,812 | utf_8 | e0e4fe550562f2bce6a2895fc2219ea4 | function fisher
%FISHER Displays solutions to Fisher PDE.
m = 0; a = -50; b = 50; t0 = 0; tf = 20;
xvals = linspace(a,b,101); tvals = linspace(t0,tf,51);
[xmesh, tmesh] = meshgrid(xvals,tvals);
figure(1), subplot(2,2,1)
sol = pdepe(m,@fpde,@fica,@fbc,xvals,tvals);
ua = sol(:,:,1); mesh(xmesh,tmesh,ua)
x... |
github | victorlei/libermate-master | ode_pp.m | .m | libermate-master/Tests/ode_pp.m | 2,537 | utf_8 | 2556cbfbbd3a419a06d408a4f2038dce | function T = ode_pp
%ODE_PP Performance profile of three ODE solvers.
solvers = {@ode23, @ode45, @ode113}; nsolvers = length(solvers);
nproblems = 6;
nruns = 5; % Number of times to run solver to get more reliable timing.
for j = 1:nsolvers
code = solvers{j}
for i = 1:nproblems
option... |
github | victorlei/libermate-master | functiontest3.m | .m | libermate-master/Tests/functiontest3.m | 189 | utf_8 | 0a3c2f15e8b5f4c945982a4e1f9e1938 | % Comment
function ret=myfunction(a,b,c)
ret=a
% Comment
function [ret,b]=myfunction1(a,b,c)
ret=a
% Comment
function [ret,ret2,ret3]=myfunction1(a,b,c)
if(1)
return
end
ret=a
|
github | victorlei/libermate-master | mbiol.m | .m | libermate-master/Tests/mbiol.m | 1,110 | utf_8 | e2c5cb177e5361aaeaa8bc6ebfcf5b23 | function mbiol
%MBIOL Reaction-diffusion system from mathematical biology.
% Solves the PDE and tests the energy decay condition.
m = 0;
xmesh = linspace(0,1,15);
tspan = linspace(0,0.2,10);
sol = pdepe(m,@mbpde,@mbic,@mbbc,xmesh,tspan);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
subplot(221)
surf(xmesh,t... |
github | joe-of-all-trades/ImageM-master | ImageM.m | .m | ImageM-master/ImageM.m | 2,264 | utf_8 | c8b4371869f9375fa52c9346bcf8ee99 | function ImageM
% ImageM is a GUI program that aims to provide ImageJ-like experience in
% MATLAB.
%
% In this very first version, the only usable function is to allow drag and
% drop display of image file. Users can drage a file from file explorer and
% drop it over the text area. If the file is an image file supporte... |
github | pfrommerd/tag-tracking-matlab-master | algorithm.m | .m | tag-tracking-matlab-master/algorithm.m | 3,064 | utf_8 | b6b1b580d072f2db73a6da2e9f86f8b3 | function algorithm(tracker, detector, images, initial_skip, skip_rate, save_images, save_poses)
disp('Initializing figures');
fig1 = sfigure(1);
fig2 = sfigure(2);
fig3 = sfigure(3);
fig4 = sfigure(4);
fig5 = sfigure(5);
fig6 = sfigure(6);
figure(1);
disp('Entering mai... |
github | pfrommerd/tag-tracking-matlab-master | measure_patch_error.m | .m | tag-tracking-matlab-master/utils/measure_patch_error.m | 1,003 | utf_8 | 314720b90b8acc0540c992f1399e9e55 | % Use squared error
%{
function [ err ] = measure_patch_error(patchA, patchB)
if ((size(patchA, 1) ~= size(patchB,1)) || ...
(size(patchA, 2) ~= size(patchB,2)) || ...
(size(patchA,1) == 0 || size(patchA,2) == 0))
err = 1;
return;
else
[M, N] = size(patchA);
... |
github | pfrommerd/tag-tracking-matlab-master | homography_project.m | .m | tag-tracking-matlab-master/utils/homography_project.m | 253 | utf_8 | 94e504b39cf3c7350ec41941a3627707 |
function [ x ] = homography_project(H, X)
t = H * X;
if any(t(3,:) <= 0)
x = ones([2 size(t,2)]) * -1;
end
% Divide by the last row
x_x = t(1, :) ./ t(3, :);
x_y = t(2, :) ./ t(3, :);
x = [x_x; x_y];
end
|
github | pfrommerd/tag-tracking-matlab-master | homography_solve.m | .m | tag-tracking-matlab-master/utils/homography_solve.m | 2,397 | utf_8 | af74ae155f6fd32916b4660743d84634 | %{
function v = homography_solve(pin, pout)
% HOMOGRAPHY_SOLVE finds a homography from point pairs
% V = HOMOGRAPHY_SOLVE(PIN, POUT) takes a 2xN matrix of input vectors and
% a 2xN matrix of output vectors, and returns the homogeneous
% transformation matrix that maps the inputs to the outputs, to some
% approx... |
github | pfrommerd/tag-tracking-matlab-master | cosyvio_pose_to_std.m | .m | tag-tracking-matlab-master/cs_conv/cosyvio_pose_to_std.m | 796 | utf_8 | 49be4974100959a1218ccf1d72bcbb30 | % Converts a cosyvio pose (where x = z_std, y = -x_std, z = -y_std) to a
% standard pose with the conversion
% A = [0 -1 0; 0 0 -1; 1 0 0];
% X_std_cam = A * X_cosyvio_cam
% X_std_world = B * X_cosyvio_world
% The cosyvio dataset uses the form
% X_c = R * X_w + T
% We use
% R * X_c + T = X_w
% it can be solved that ... |
github | Nekooeimehr/MATLAB-Source-Code-Oversampling-Methods-master | Safe_Level_SMOTE.m | .m | MATLAB-Source-Code-Oversampling-Methods-master/Safe_Level_SMOTE.m | 2,224 | utf_8 | 7bcc91902154ffd812e529eb4bb2ec0c | function [final_features ,final_mark] = Safe_Level_SMOTE(original_features, original_mark, KNN)
ind = find(original_mark == -1);
Min_ins = original_features(ind,:);
KNN = KNN + 1;
final_features = original_features;
Limit = size(Min_ins,1);
Num_Ov = ceil(max(size(find(original_mark == -1),1) - size(find(original_mark... |
github | Nekooeimehr/MATLAB-Source-Code-Oversampling-Methods-master | Orig_agg_cluster.m | .m | MATLAB-Source-Code-Oversampling-Methods-master/Orig_agg_cluster.m | 1,763 | utf_8 | bcf7eb3c45362da02adbfe1337455cfa | function labels = Orig_agg_cluster(data, CThresh)
N = size(data,2);
% Clusters is a cell array of vectors. Each vector contains the
% indicies of the points belonging to that cluster.
% Initially, each point is in it's own cluster.
clusters = cell(N,1);
for cc = 1:length(clusters)
clusters{cc} = [cc];
end
% the... |
github | Nekooeimehr/MATLAB-Source-Code-Oversampling-Methods-master | nearestneighbour.m | .m | MATLAB-Source-Code-Oversampling-Methods-master/nearestneighbour.m | 13,779 | utf_8 | 8156790f42c7c9e5eba34274cd7ccbaa | function [idx, tri] = nearestneighbour(varargin)
%NEARESTNEIGHBOUR find nearest neighbours
% IDX = NEARESTNEIGHBOUR(X) finds the nearest neighbour by Euclidean
% distance to each point (column) in X from X. X is a matrix with points
% as columns. IDX is a vector of indices into X, such that X(:, IDX) are
% t... |
github | Nekooeimehr/MATLAB-Source-Code-Oversampling-Methods-master | Mod_AggCluster.m | .m | MATLAB-Source-Code-Oversampling-Methods-master/Mod_AggCluster.m | 4,951 | utf_8 | 5625c0e6a852c1dc8f6c1ddf39c5f24b | function [min_clusters] = Mod_AggCluster(Majority_features, Minority_features ,CThresh)
% This code is a modification of the source code for Hierachical Clustering
% implemented by David Ross
% The source code for the original Hierachical Clustering can be found in:
% http://www.cs.toronto.edu/~dross/code/
SizeMin =... |
github | snoopyisadog/Chinese_Stroke_Extraction-master | extract_rho.m | .m | Chinese_Stroke_Extraction-master/extract_rho.m | 1,538 | utf_8 | 5f36bbd40f6c0289fa94fec6621dfdd0 | function [ pics ] = extract_rho( rho, pts )
global map img space hei wid ang
space = rho;
[ hei, wid, ang] = size( rho);
map = zeros( hei, wid, ang);
P = size(pts,1);
pics = zeros( 1, hei, wid);
for i = 1:P
x = pts(i,1); y = pts(i,2);
for k = 1:ang
if ( rho( x, y... |
github | snoopyisadog/Chinese_Stroke_Extraction-master | get_PBOD.m | .m | Chinese_Stroke_Extraction-master/get_PBOD.m | 1,139 | utf_8 | e89aa1e17b4707bfa9945b0ed62b909b | function [ ret, pt ] = get_PBOD( im )
global pic hei wid
pic = im;
[ hei, wid ] = size(im);
gap = 3;
range = 360/gap;
ang = linspace(0,2*pi,360/gap);
ret = zeros(hei, wid, 360/gap);
pt = zeros(1,2)
for i = 1:hei
for j = 1:wid
if im(i,j) == 0 % if this pixel is black
... |
github | mainster/matlabCodes-master | EMW_d.m | .m | matlabCodes-master/EMW_d.m | 5,530 | utf_8 | f71f44e53bfe2723a3d6a621d63e3e06 | function varargout = EMW_d(varargin)
% EMW_D M-file for EMW_d.fig
% EMW_D, by itself, creates a new EMW_D or raises the existing
% singleton*.
%
% H = EMW_D returns the handle to a new EMW_D or the handle to
% the existing singleton*.
%
% EMW_D('CALLBACK',hObject,eventData,handles,...) ... |
github | mainster/matlabCodes-master | BodePlotGui.m | .m | matlabCodes-master/BodePlotGui.m | 51,136 | utf_8 | 857358906042b6788eef8bf402d2758f | function varargout = BodePlotGui(varargin)
% BODEPLOTGUI Application M-file for BodePlotGui.fig
% FIG = BODEPLOTGUI launch BodePlotGui GUI.
% BODEPLOTGUI('callback_name', ...) invoke the named callback.
% Last Modified by GUIDE v2.5 18-Oct-2011 14:11:08
%Written by Erik Cheever (Copyright 2002)
%Contact: erik_c... |
github | mainster/matlabCodes-master | CustomMDBdistribution.m | .m | matlabCodes-master/CustomMDBdistribution.m | 14,354 | utf_8 | e0b9947e4c6d31e4383fdd19d958129b | classdef CustomMDBdistribution < prob.ToolboxFittableParametricDistribution
% This is a sample implementation of the Laplace distribution. You can use
% this template as a model to implement your own distribution. Create a
% directory called '+prob' somewhere on your path, and save this file in
% that directory using a... |
github | mainster/matlabCodes-master | LTspiceParamImport.m | .m | matlabCodes-master/LTspiceParamImport.m | 9,811 | utf_8 | 31cb370f57cc42db4b4d21a689e367bb | function varargout = LTspiceParamImport (ascfile, varargin)
% LTSPICEPARAMIMPORT Scan and import parameters from LTspice *.asc files.
% Place pattern ".param MATLAB_PARAM=1" at the beginning of '+ (...)' extended
% parameter list as spice directive, for example:
%
% .param MATLAB_PARAM=1
% + Ve = 5V
% + Rc = 1k
% + ... |
github | mainster/matlabCodes-master | AudioDisplay.m | .m | matlabCodes-master/AudioDisplay.m | 5,016 | utf_8 | e8de62c2d879c6dcbd6204046ee00ab2 | function varargout = AudioDisplay(varargin)
% AUDIODISPLAY M-file for AudioDisplay.fig
% AUDIODISPLAY, by itself, creates a new AUDIODISPLAY or raises the existing
% singleton*.
%
% H = AUDIODISPLAY returns the handle to a new AUDIODISPLAY or the handle to
% the existing singleton*.
%
% AUDIODI... |
github | mainster/matlabCodes-master | GalvoBIGMatlab_cortex_Link.m | .m | matlabCodes-master/RT_projects/GalvoProjekt/GalvoBIGMatlab_cortex_Link.m | 8,877 | utf_8 | c230be7a86d7cc7b8fae1c6406a24707 | function GalvoMatlab_cortex_Link
uicontrol('Style', 'pushbutton', 'String', 'OpenPort',...
'Position', [20 20 70 30],...
'Callback', @MDBopenPort);
%%
uicontrol('Style', 'slider',...
'Min',1,'Max',50,'Value',41,...
'Position', [400 20 120 20],...
'Callback', {@surfzlim,h... |
github | mainster/matlabCodes-master | GalvoMatlab_cortex_Link.m | .m | matlabCodes-master/RT_projects/GalvoProjekt/GalvoMatlab_cortex_Link.m | 3,199 | utf_8 | 25abb87130f441e60e5c75f49348e4ed | function GalvoMatlab_cortex_Link()
% GalvoMatlab_cortex_Link Link handling to cortex_m4 serial interface.
%
% See also SUM, PLUS.
global s;
evalin('base','global s');
uicontrol('Style', 'pushbutton', 'String', 'OpenPort',...
'Position', [20 20 70 30],...
'Callback', {@clf});
uicont... |
github | mainster/matlabCodes-master | RootRaisedCosShaper.m | .m | matlabCodes-master/NT_projects/RootRaisedCosShaper.m | 887 | utf_8 | ebc26eb85cefc0ff1dfae5bcc57f49ad | % Root Raised-Cosine Filter / Pulsform
%
% t: timevector
% Ts: Symbol time
% r: Role- off faktor
% dom: Domain, Time or Frequency
%
function [res] = RootRaisedCosShaper(x,Ts,r,dom)
jump=@(xx) (0.5*sign(xx)+0.5);
if dom=='time'
fs=1/Ts;
fn=fs;
% sig=@(x) 2*fn*sinc(2*pi*fn*x).... |
github | mainster/matlabCodes-master | RaisedCosShaper.m | .m | matlabCodes-master/NT_projects/RaisedCosShaper.m | 954 | utf_8 | e476fe526ad6bbf8fba7c051cdef1139 | % Raised-Cosine Filter / Pulsform
%
% t: timevector
% Ts: Symbol time
% r: Role- off faktor
% dom: Domain, Time or Frequency
%
function [res] = RaisedCosShaper(x,Ts,r,dom)
% syms n k;
% step = abs(abs(x(2))-abs(x(1)));
jump=@(xx) (0.5*sign(xx)+0.5);
k=1;
res=[1:length(x)];
... |
github | mainster/matlabCodes-master | genComplSinFS.m | .m | matlabCodes-master/NT_projects/genComplSinFS.m | 1,045 | ibm852 | af9fbb8c127b618397e63c583decf164 | % Function generate Complex Sinusodial
%
% fc: Frequenz der Schwingung
% n: n Perioden von 1/fc werden gesamplt??
% Are: Amplitude Re
% Aim: Amplitude Im
% phi: Phase zwischen Re und Im
% DCre: Gleichanteil von Re
% DCim: Gleichanteil von Im
%
% [time,fsam,res]:
% time: ... ist ... |
github | mainster/matlabCodes-master | zbb.m | .m | matlabCodes-master/NT_projects/zbb.m | 736 | utf_8 | da2f47bee8c3d37db2c3ea0ddbb392fe | % Get complex Baseband in time domain
%
% t: time- vector
% M: M- valued PSK
% Ts: Symbol- Time in[s] --> 1/Ts = Baudrate
% symbolBits: mapped symbol vector --> sizeof(symbol) = 1
% Ampl: Baseband Amplitude
%
function [res] = zbb(t,M,Ts,symbolBits,Ampl)
rect=@(t) (0.5*sign(t)+0.5);
% Baseband- Pulse: For M-PSK g(t)=c... |
github | mainster/matlabCodes-master | genComplSin.m | .m | matlabCodes-master/NT_projects/genComplSin.m | 1,130 | ibm852 | 639178c2b3b60daf8c549f7dc096b24b | % Function generate Complex Sinusodial
%
% fc: Frequenz der Schwingung
% n: n Perioden von 1/fc werden gesamplt??
% Are: Amplitude Re
% Aim: Amplitude Im
% phi: Phase zwischen Re und Im
% DCre: Gleichanteil von Re
% DCim: Gleichanteil von Im
%
% [time,fsam,res]:
% time: ... ist ... |
github | mainster/matlabCodes-master | zbbBPSK.m | .m | matlabCodes-master/NT_projects/zbbBPSK.m | 813 | utf_8 | 173bec77a32a45d39d22488412bc1d46 | % Get complex Baseband in time domain
%
% t: time- vector
% Ts: Symbol- Time in[s] --> 1/Ts = Baudrate
% dk: mapped symbol vector
% Ampl: Baseband Amplitude
%
function [res] = zbbBPSK(t,Ts,dk,Ampl,shape,rolloff)
rect=@(t) (0.5*sign(t)+0.5);
% Baseband- Pulse: For M-PSK g(t)=cos(2*pi/(2*Ts))*(sigma(t+Ts)-sigma(t-Ts))
... |
github | mainster/matlabCodes-master | NyquistGui.m | .m | matlabCodes-master/NyquistGui/NyquistGui.m | 26,670 | utf_8 | 020bca963b04660214fdac5ea9e1a183 |
function varargout = NyquistGui(varargin)
% Doesn't handle multiple poles on axes (except at origin).
% Rounds to nearest 0.001 (if near origin or axis
%
% NYQUISTGUI MATLAB code for NyquistGui.fig
% NYQUISTGUI, by itself, creates a new NYQUISTGUI or raises the existing
% singleton*.
%
% H = NYQUISTGUI ... |
github | mainster/matlabCodes-master | gershband.m | .m | matlabCodes-master/CUSTOM_LIBRARY/Mimotools/gershband.m | 3,076 | utf_8 | 1fc6d3bb4118fc7975d6ebd6fee3f398 | function gershband(a,b,c,d,e)
%GERSHBAND - Finds the Gershorin Bands of a nxn LTI MIMO SYS model
% The use of the Gershorin Bands along the Nyquist plot is helpful for
% finding the coupling grade of a MIMO system.
%
% Syntax: gershband(SYS) - computes the Gershgorin bands of SYS
% gershband(SYS,'v') - co... |
github | mainster/matlabCodes-master | arrowh.m | .m | matlabCodes-master/CUSTOM_LIBRARY/Mimotools/arrowh.m | 6,921 | utf_8 | a6ac3ee76572ce60d5bd4be9dd7ee4c0 | % ARROWH Draws a solid 2D arrow head in current plot.
% ARROWH(X,Y,COLOR,SIZE,LOCATION) draws a solid arrow head into
% the current plot to indicate a direction. X and Y must contain
% a pair of x and y coordinates ([x1 x2],[y1 y2]) of two points:
%
% The first point is only used to tell (in c... |
github | mainster/matlabCodes-master | icdtool.m | .m | matlabCodes-master/CUSTOM_LIBRARY/Mimotools/icdtool.m | 19,918 | utf_8 | 44e8f0f1d83bf6807bdfacc3078fd998 | function varargout = icdtool(varargin)
%ICDTOOL - Individual Channel Design utility for 2x2 MIMO systems
%
% Syntax:
% icdtool(G) - Starts icdtool for G, where G is a transfer function matrix
%
% Example:
% g11=tf(2,[1 3 2]);
% g12=tf(-2,[1 1]);
% g21=tf(-1,[1 2 1]);
% g22=tf(6,[1 5 6]);
% ... |
github | mainster/matlabCodes-master | LiveRecording.m | .m | matlabCodes-master/LiveRecordingWave/LiveRecording.m | 10,220 | utf_8 | abbd8965ff6e8ea28c0d4966d99778fd | function LiveRecording
%Syntax: LiveRecording
% Run LiveRecording by typing "LiveRecording" in your command line
%
% Marcus Vollmer
% alpha 13.06.2014
% Initialize and hide the GUI as it is being constructed.
aud = audiodevinfo;
if isempty(ver('Signal'))
errordlg('Signal Processing Toolbox required','!! Err... |
github | terejanu/AdaptiveGaussianSumFilter-master | error_ellipse.m | .m | AdaptiveGaussianSumFilter-master/error_ellipse.m | 8,394 | utf_8 | 89c9afde8aeb5b09c8a1fa777a9a8b9b | 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... |
github | masumhabib/quest-master | importBandResult.m | .m | quest-master/utils/matlab/importBandResult.m | 899 | utf_8 | 7ff4feab1a9082e50da7c2b663fd9af9 | %
% Copyright (C) 2014 K M Masum Habib <masum.habib@gmail.com>
%
function out = importBandResult(fileName)
fid = fopen(fileName, 'rt');
out = [];
while (~feof(fid))
type = fscanf(fid, '%s[^\n]');
if strfind(type, 'EK') == 1
out.EK = scan();
elseif strfind(type, 'EIGENVEC... |
github | masumhabib/quest-master | importTransResult.m | .m | quest-master/utils/matlab/importTransResult.m | 1,603 | utf_8 | fcadd5373709cc91cec1eed7e966bb96 | %
% Copyright (C) 2014 K M Masum Habib <masum.habib@gmail.com>
%
function out = importTransResult(fileName)
fid = fopen(fileName, 'rt');
out = [];
ibIE = 1;
ibn = 1;
ibneq = 1;
while (~feof(fid))
type = fscanf(fid, '%s[^\n]');
if strfind(type, 'ENERGY') == 1
[out.NE,... |
github | masumhabib/quest-master | importPotential.m | .m | quest-master/utils/matlab/importPotential.m | 334 | utf_8 | bcd8483c35f0173a6b1605c72bd0258f | %
% Copyright (C) 2014 K M Masum Habib <masum.habib@gmail.com>
%
function [X, Y, Z, V] = importPotential(fileName)
fid = fopen(fileName, 'rt');
X = [];
Y = [];
Z = [];
V = [];
data = load(fileName);
X = data(:,1);
Y = data(:,2);
Z = data(:,3);
V = data(:,4);
fclose... |
github | NYU-DiffusionMRI/mppca_denoise-master | MPdenoising.m | .m | mppca_denoise-master/MPdenoising.m | 8,173 | utf_8 | e486f43bc82b9c4a0ebf3bd3a095b504 | function [Signal, Sigma] = MPdenoising(data, mask, kernel, sampling, centering)
%
% "MPPCA": 4d image denoising and noise map estimation by exploiting data redundancy in the PCA domain using universal properties of the eigenspectrum of
% random covariance matrices, i.e. Marchenko Pastur distribution
%
... |
github | NYU-DiffusionMRI/mppca_denoise-master | MP.m | .m | mppca_denoise-master/MP.m | 5,946 | utf_8 | 3b5355d0743ba9e04980fb6755227d1d | function [Xdn, sigma, npars] = MP(X, nbins, centering)
% "MP": matrix denoising and noiseestimation by exploiting data redundancy in the PCA domain using universal properties of the eigenspectrum of
% random covariance matrices, i.e. Marchenko Pastur distribution
%
% [Xdn, Sigma, npars] = MP(X, nbins... |
github | NYU-DiffusionMRI/mppca_denoise-master | MPnonlocal.m | .m | mppca_denoise-master/MPnonlocal.m | 12,883 | utf_8 | 9df62ed192b176dcf7fa65ac94b73ddb | function [Signal, varargout] = MPnonlocal(data, varargin)
% MPnonlocal Denoise 4d magnitude data (x, y, z, dirs) or 5d complex data
% (x, y, z, coils, dirs) and estimate 3d noise maps and significant
% parameter maps using nonlocal patching and eigenvalue shrinkage in
% the MPPCA framework
... |
github | CUAir/ardupilot-master | RotToQuat.m | .m | ardupilot-master/libraries/AP_NavEKF/Models/Common/RotToQuat.m | 288 | utf_8 | 9239706354267c8f5f2a29f992c07de9 | % convert froma rotation vector in radians to a quaternion
function quaternion = RotToQuat(rotVec)
vecLength = sqrt(rotVec(1)^2 + rotVec(2)^2 + rotVec(3)^2);
if vecLength < 1e-6
quaternion = [1;0;0;0];
else
quaternion = [cos(0.5*vecLength); rotVec/vecLength*sin(0.5*vecLength)];
end |
github | CUAir/ardupilot-master | NormQuat.m | .m | ardupilot-master/libraries/AP_NavEKF/Models/Common/NormQuat.m | 198 | utf_8 | ed913e87efc9194a2c52b266fced8da7 | % normalise the quaternion
function quaternion = normQuat(quaternion)
quatMag = sqrt(quaternion(1)^2 + quaternion(2)^2 + quaternion(3)^2 + quaternion(4)^2);
quaternion(1:4) = quaternion / quatMag;
|
github | CUAir/ardupilot-master | QuatToEul.m | .m | ardupilot-master/libraries/AP_NavEKF/Models/Common/QuatToEul.m | 436 | utf_8 | c19c9235052d99b8b943a7157e83fc94 | % Convert from a quaternion to a 321 Euler rotation sequence in radians
function Euler = QuatToEul(quat)
Euler = zeros(3,1);
Euler(1) = atan2(2*(quat(3)*quat(4)+quat(1)*quat(2)), quat(1)*quat(1) - quat(2)*quat(2) - quat(3)*quat(3) + quat(4)*quat(4));
Euler(2) = -asin(2*(quat(2)*quat(4)-quat(1)*quat(3)));
Euler(3) =... |
github | skulumani/foucault-master | load_constants.m | .m | foucault-master/matlab/load_constants.m | 1,176 | utf_8 | 14da85c48f205f137f1fb2e74e55db1f | % load constants for Foucault pendulum
function [constants] = load_constants()
%% define constants
constants.eom = 'full'; % full or len or rot for simplifications
% constants.Omega = 7.2921158553e-5; % rad/sec earth angular velocity
constants.Omega = 7.2921158553e-5;
constants.mu = 3.986004418e14; % m^3/sec
% % origi... |
github | skulumani/foucault-master | hat_map.m | .m | foucault-master/matlab/hat_map.m | 246 | utf_8 | a1515ff3e5d34892df65ff78d2340d60 | % 8 June 15
% skew symmetric operator
function mat = hat_map(vec)
% maps a 3-vec to a skew symmetric matrix
mat = zeros(3,3);
mat(1,2) = -vec(3);
mat(1,3) = vec(2);
mat(2,1) = vec(3);
mat(2,3) = -vec(1);
mat(3,1) = -vec(2);
mat(3,2) = vec(1);
|
github | skulumani/foucault-master | ROT2.m | .m | foucault-master/matlab/ROT2.m | 594 | utf_8 | cc21aff60c155554ebcbed98170a584e | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Purpose: Rotation matrix about second axis
% b = dcm*a
%
% Inputs:
% - beta - rotation angle (rad)
%
% Outpus:
% - rot2 - rotation matrix (3x3)
%
% Dependencies:
% - none
%
% Author: Shankar Kulumani 23 Septe... |
github | skulumani/foucault-master | body_animation.m | .m | foucault-master/matlab/body_animation.m | 3,976 | utf_8 | bde6196a4c3f3ae7ea82c2b5fb05d57c | % 23 September 2016
% animation for foucault pendulum
function body_animation(t,q,qd,constants,type,filename)
% draw position of pendulum in the body frame
% body frame reference frame
% Rotate body frame to match matlab figure (gravity is downward -z
% direction)
b1 = constants.L*[1;0;0];
b2 = constants.L*[0;1;0];
b... |
github | skulumani/foucault-master | inertial_animation.m | .m | foucault-master/matlab/inertial_animation.m | 3,766 | utf_8 | 59d22cc3a33cf76d7a8d9577cd3512c9 | % 23 September 2016
% animation for foucault pendulum expressed in inertial frame
function inertial_animation(t,q,qd,constants,type,filename)
% draw position of pendulum in the body frame
fig_handle = figure();
range=1.1*(constants.L);
axis([-range range -range range -range range]);
axis square;
grid on,hold on,
titl... |
github | skulumani/foucault-master | plot_outputs.m | .m | foucault-master/matlab/plot_outputs.m | 2,708 | utf_8 | 35bb5bdc3d3fc9f4b3011e76dba4f584 | % 23 September 2016
% plot simulation
function plot_outputs(t,q,qd,constants)
% extract constants
Cbeta = constants.Cbeta;
S = constants.S;
Omega = constants.Omega;
Len = constants.L;
m = constants.m;
% calculate the total energy of the pendulum and make sure it's consistent
T = zeros(length(t),1);
V = zeros(length(... |
github | skulumani/foucault-master | vee_map.m | .m | foucault-master/matlab/vee_map.m | 217 | utf_8 | 03c2d87aa5e1f2a683080adf744e0e27 | % 11 June 15
% vee map function to take a skew symmetric matrix and map it to a 3 vector
function [vec] = vee_map(mat)
x1 = mat(3,2)-mat(2,3);
x2 = mat(1,3) - mat(3,1);
x3 = mat(2,1)-mat(1,2);
vec = 1/2*[x1;x2;x3]; |
github | skulumani/foucault-master | foucault_ode_rot.m | .m | foucault-master/matlab/foucault_ode_rot.m | 648 | utf_8 | 39743fd03e852988bf26ffb954f37a1d | % 8 September 2016
% Assuming length of pendulum is much less than the Earth and that the
% rotation coriolis force is negligible r \Omega^@ << g
function [state_dot] = foucault_ode_rot(t,state,constants)
% extract constants
Omega = constants.Omega;
L = constants.L;
m = constants.m;
Re = constants.Re;
g = ... |
github | skulumani/foucault-master | foucault_ode.m | .m | foucault-master/matlab/foucault_ode.m | 692 | utf_8 | 3c2f639b066df7d1619969e89d260f42 | % 8 September 2016
% Full NL ODE function for foucault pendulum
function [state_dot] = foucault_ode(t,state,constants)
% extract constants
Omega = constants.Omega;
L = constants.L;
m = constants.m;
Re = constants.Re;
g = constants.g;
Cbeta = constants.Cbeta;
S = constants.S;
% redefine the state
pos =... |
github | skulumani/foucault-master | ROT3.m | .m | foucault-master/matlab/ROT3.m | 611 | utf_8 | 72379dd4a63db93ef3483a5b142b68c3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Purpose: Rotation matrix about thrid axis
% b = dcm*a
%
% Inputs:
% - gamma - rotation angle (rad)
%
% Outpus:
% - rot3 - rotation matrix (3x3)
%
% Dependencies:
% - none
%
% Author: Shankar Kulumani 23 Septem... |
github | skulumani/foucault-master | ROT1.m | .m | foucault-master/matlab/ROT1.m | 606 | utf_8 | 8f5386316502a83577c44e5d15de58e8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Purpose: Rotation matrix about first axis
% b = dcm*a
%
% Inputs:
% - alpha - rotation angle (rad)
%
% Outpus:
% - rot1 - rotation matrix (3x3)
%
% Dependencies:
% - none
%
% Author: Shankar Kulumani 23 Septe... |
github | skulumani/foucault-master | foucault_ode_length.m | .m | foucault-master/matlab/foucault_ode_length.m | 620 | utf_8 | 45cffa2ccb1d9618df1ebb10cf953ee3 | % 8 September 2016
% Assuming length of pendulum is much less than the Earth
function [state_dot] = foucault_ode_length(t,state,constants)
% extract constants
Omega = constants.Omega;
L = constants.L;
m = constants.m;
Re = constants.Re;
g = constants.g;
Cbeta = constants.Cbeta;
S = constants.S;
% redef... |
github | CALFEM/calfem-matlab-iga-master | bspdegelev.m | .m | calfem-matlab-iga-master/NURBS/bspdegelev.m | 20,513 | utf_8 | 5a7638accd22f943a5ac4278ab8176b6 | function [ic,ik] = bspdegelev(d,c,k,t)
% BSPDEGELEV: Degree elevate a univariate B-Spline.
%
% Calling Sequence:
%
% [ic,ik] = bspdegelev(d,c,k,t)
%
% INPUT:
%
% d - Degree of the B-Spline.
% c - Control points, matrix of size (dim,nc).
% k - Knot sequence, row vector of size nk.
% t - Raise the B-Sp... |
github | otroblogdetecno/matlabExamples-master | spatial_calibration_demo.m | .m | matlabExamples-master/caracteristicas/spatial_calibration_demo.m | 10,512 | utf_8 | f6a8ac89a25e8f0720bdadb7a30c016a | function spatial_calibration_demo()
% spatial_calibration_demo This demo allows you to
% spatially calibrate your image and then
% make distance or area measurements.
global originalImage;
% Check that user has the Image Processing Toolbox installed.
clc; % Clear the command window.
close all; % Close all figures ... |
github | otroblogdetecno/matlabExamples-master | DeltaE.m | .m | matlabExamples-master/DeltaE/DeltaE.m | 20,283 | utf_8 | 117e2bac667be64d3a0c96dac4c7b853 | % Demo macro to very, very simple color detection in LAB color space.
% The RGB image is converted to LAB color space and then the user draws
% some freehand-drawn irregularly shaped region to identify a color.
% The Delta E (the color difference in LAB color space) is then calculated
% for every pixel in the image... |
github | kartik-nighania/ardupilot-master | RotToQuat.m | .m | ardupilot-master/libraries/AP_NavEKF/Models/Common/RotToQuat.m | 288 | utf_8 | 9239706354267c8f5f2a29f992c07de9 | % convert froma rotation vector in radians to a quaternion
function quaternion = RotToQuat(rotVec)
vecLength = sqrt(rotVec(1)^2 + rotVec(2)^2 + rotVec(3)^2);
if vecLength < 1e-6
quaternion = [1;0;0;0];
else
quaternion = [cos(0.5*vecLength); rotVec/vecLength*sin(0.5*vecLength)];
end |
github | kartik-nighania/ardupilot-master | NormQuat.m | .m | ardupilot-master/libraries/AP_NavEKF/Models/Common/NormQuat.m | 198 | utf_8 | ed913e87efc9194a2c52b266fced8da7 | % normalise the quaternion
function quaternion = normQuat(quaternion)
quatMag = sqrt(quaternion(1)^2 + quaternion(2)^2 + quaternion(3)^2 + quaternion(4)^2);
quaternion(1:4) = quaternion / quatMag;
|
github | kartik-nighania/ardupilot-master | QuatToEul.m | .m | ardupilot-master/libraries/AP_NavEKF/Models/Common/QuatToEul.m | 436 | utf_8 | c19c9235052d99b8b943a7157e83fc94 | % Convert from a quaternion to a 321 Euler rotation sequence in radians
function Euler = QuatToEul(quat)
Euler = zeros(3,1);
Euler(1) = atan2(2*(quat(3)*quat(4)+quat(1)*quat(2)), quat(1)*quat(1) - quat(2)*quat(2) - quat(3)*quat(3) + quat(4)*quat(4));
Euler(2) = -asin(2*(quat(2)*quat(4)-quat(1)*quat(3)));
Euler(3) =... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | initParamDist.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/toolbox/initParamDist.m | 1,393 | utf_8 | f5c0d7c880e1e6a811cc0157eb7fd94a | function prob_bij = initParamDist(edgeD, edge_pairs, samples)
% Initialize tree parameters using distances
adjmat = logical(edgeD);
Ntotal = size(adjmat,1);
Nobserved = size(samples,1);
Nsamples = size(samples,2);
prob_bi = zeros(Ntotal,2);
prob_bi(1:Nobserved,2) = sum(samples-1,2)/Nsamples;
for i=Nobserved+1:Ntotal... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | makeModel.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/toolbox/makeModel.m | 2,836 | utf_8 | 577899ddcf8258afdccd0c8bc94a1aca | function [adjmat, level_m] = makeModel(graph, m)
% Generate the adjacency matrix for the given graph with m observed
% variables.
level_m = m;
switch graph
case 'star'
M = m+1;
adjmat = sparse(M,M);
adjmat(1:m,end) = 1;
case 'doubleStar'
M = m+2;
adjmat = sparse(M,M);
... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | drawWeightedGraph.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/toolbox/drawWeightedGraph.m | 8,290 | utf_8 | 136465d2b59b2a3dbd583c773e6f79a7 | function [x, y, h] = drawWeightedGraph(adj, labels, root, edge_weight, node_t, varargin)
% DRAW_LAYOUT Draws a layout for a graph
%
% [X, Y, H] = DRAW_LAYOUT(ADJ, <LABELS, ISBOX, X, Y>)
%
% Inputs :
% ADJ : Adjacency matrix (source, sink)
% LABELS : Cell array containing labels <Default : '1':'N'>
% ISBO... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | forrest_ll2.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/toolbox/forrest_ll2.m | 2,850 | utf_8 | a284d701978ee08905a2c299a206516a | function [l, missed] = forrest_ll2(data, atree, verbose);
% calculuate the log-likelihood of data under a forrest model
%
% Copyright (C) 2006 - 2009 by Stefan Harmeling (2009-06-26).
if ~exist('verbose', 'var') || isempty(verbose)
verbose = 0;
end
if isempty(atree)
error('[%s.m] tree is empty', mfilename);
end
... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | queryFamiliesClustering.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/toolbox/queryFamiliesClustering.m | 5,005 | utf_8 | 8df6181dc3a9864c626905100cb4d562 | function [families, parents, avg_log_ratio] = queryFamiliesClustering(distance,numSamples,verbose)
% Find family groups by adaptive thresholding
if(nargin < 3)
verbose = 0;
end
edgeD_min = -log(0.1);
edgeD_max = -log(0.9);
m = size(distance,1);
%relD_thres = 2*edgeD_min; % For reliable statistics, ignore distan... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | treeLayout.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/toolbox/treeLayout.m | 2,812 | utf_8 | a3b707653d47e879ac3e0006f320963f | function [x,y] = treeLayout(adj,root,edge_weight)
% Similar to make_layout but specialized for a tree.
if nargin < 2
root = 1;
end
if nargin < 3
edge_weight = adj;
end
N = size(adj,1);
level = poset(adj,root)'-1;
y = (level+1)./(max(level)+2);
y = 1-y;
% neighbors = find(adj(root,:));
% [temp1, sorted_i... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | treeMsgOrder.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/toolbox/treeMsgOrder.m | 1,545 | utf_8 | 1d7c7a885cd6c01b2ab00e3df5baee6f |
function msg = treeMsgOrder(adj, root)
%treeMsgOrder Find message scheduling for inference on a tree.
% Determines a sequence of message updates by which BP produces optimal
% smoothed estimates on a tree-structured undirected graph.
%
% msg = treeMsgOrder(adj, root)
%
% PARAMETERS:
% adj = adjacency matr... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | myProcessOptions.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/misc/myProcessOptions.m | 674 | utf_8 | b94d252a960faa95a3074129247619e6 | function [varargout] = myProcessOptions(options,varargin)
% Similar to processOptions, but case insensitive and
% using a struct instead of a variable length list
options = toUpper(options);
for i = 1:2:length(varargin)
if isfield(options,upper(varargin{i}))
v = getfield(options,upper(varargin{i}));
... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | myProcessOptions.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/minConf/myProcessOptions.m | 674 | utf_8 | b94d252a960faa95a3074129247619e6 | function [varargout] = myProcessOptions(options,varargin)
% Similar to processOptions, but case insensitive and
% using a struct instead of a variable length list
options = toUpper(options);
for i = 1:2:length(varargin)
if isfield(options,upper(varargin{i}))
v = getfield(options,upper(varargin{i}));
... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | minConf_TMP.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/minConf/minConf/minConf_TMP.m | 8,550 | utf_8 | 6983e0de62f07b14b5a7e0f3b9d6b3df | function [x,f,funEvals] = minConF_BC(funObj,x,LB,UB,options)
% function [x,f] = minConF_BC(funObj,x,LB,UB,options)
%
% Function for using Two-Metric Projection to solve problems of the form:
% min funObj(x)
% s.t. LB_i <= x_i <= UB_i
%
% @funObj(x): function to minimize (returns gradient as second argument... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | minConf_PQN.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/minConf/minConf/minConf_PQN.m | 8,743 | utf_8 | 833730ebce2f402d389c4ad511129e60 | function [x,f,funEvals] = minConf_PQN(funObj,x,funProj,options)
% function [x,f] = minConf_PQN(funObj,funProj,x,options)
%
% Function for using a limited-memory projected quasi-Newton to solve problems of the form
% min funObj(x) s.t. x in C
%
% The projected quasi-Newton sub-problems are solved the spectral pr... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | UGM_TreeBP.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/UGM/misc/UGM_TreeBP.m | 2,745 | utf_8 | baa995f7edc3145b6631c22a4890e471 | function [messages] = UGM_TreeBP(nodePot,edgePot,edgeStruct,maximize)
[nNodes,maxState] = size(nodePot);
nEdges = size(edgePot,3);
edgeEnds = edgeStruct.edgeEnds;
nStates = edgeStruct.nStates;
V = edgeStruct.V;
E = edgeStruct.E;
nodeDone = zeros(nNodes,1);
sent = zeros(nEdges*2,1);
messages = zeros(maxState,nEdges*2... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | UGM_Sample_VarMCMC.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/UGM/sample/UGM_Sample_VarMCMC.m | 2,625 | utf_8 | b61803b06589d39b8589ddf7e705bdf6 | function [samples] = UGM_Sample_VarMCMC(nodePot,edgePot,edgeStruct,burnIn,varProb)
% MCMC sampler that switches between random walk MH and variational MF
% sampling
%
% varProb is the probability of trying the variational move
% (set to 0 for purely variational proposals)
[nNodes,maxStates] = size(nodePot);
nEdges = s... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | UGM_Sample_Gibbs.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/UGM/sample/UGM_Sample_Gibbs.m | 1,475 | utf_8 | fc98ab2b4b0110d00bef783f438a7cb3 | function [samples] = UGM_Sample_Gibbs(nodePot,edgePot,edgeStruct,burnIn,y)
% [samples] = UGM_Sample_Gibbs(nodePot,edgePot,edgeStruct,burnIn,y)
% Single Site Gibbs Sampling
if nargin < 5
% Initialize
[junk y] = max(nodePot,[],2);
end
if edgeStruct.useMex
samples = UGM_Sample_GibbsC(nodePot,edgePot,int32(edgeStruct... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | UGM_Sample_Exact.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/UGM/sample/UGM_Sample_Exact.m | 2,003 | utf_8 | a154b2b69704368d50fb3f106f13340b | function [samples] = UGM_Sample_Exact(nodePot,edgePot,edgeStruct)
% Exact sampling
assert(prod(edgeStruct.nStates) < 50000000,'Brute Force Exact Sampling not recommended for models with > 50 000 000 states');
[nNodes,maxState] = size(nodePot);
nEdges = size(edgePot,3);
edgeEnds = edgeStruct.edgeEnds;
nStates = edgeSt... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | UGM_Infer_Exact.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/UGM/infer/UGM_Infer_Exact.m | 1,876 | utf_8 | ee20f10625b7e182499b0d93e3434775 | function [nodeBel, edgeBel, logZ] = UGM_Infer_Exact(nodePot, edgePot, edgeStruct)
% INPUT
% nodePot(node,class)
% edgePot(class,class,edge) where e is referenced by V,E (must be the same
% between feature engine and inference engine)
%
% OUTPUT
% nodeBel(node,class) - marginal beliefs
% edgeBel(class,class,e) ... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | UGM_Infer_TRBP.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/UGM/infer/UGM_Infer_TRBP.m | 4,237 | utf_8 | eee0c6b71628076316fbde2d253256e7 | function [nodeBel, edgeBel, logZ] = UGM_Infer_TRBP(nodePot,edgePot,edgeStruct)
[nNodes,maxStates] = size(nodePot);
nEdges = size(edgePot,3);
% Compute Edge Appearance Probabilities
if 0 %nEdges == nNodes*(nNodes-1)/2
mu = ((nNodes-1)/nEdges)*ones(nEdges,1);
elseif 1
% Generate Random Spanning Trees u... |
github | ColumbiaDVMM/Weak-attributes-for-large-scale-image-retrieval-master | UGM_Infer_LBP.m | .m | Weak-attributes-for-large-scale-image-retrieval-master/UGM/UGM/infer/UGM_Infer_LBP.m | 2,799 | utf_8 | 5101f62b8c2760b27424c72e3f8746c5 | function [nodeBel, edgeBel, logZ] = UGM_Infer_LBP(nodePot,edgePot,edgeStruct)
if edgeStruct.useMex
[nodeBel,edgeBel,logZ] = UGM_Infer_LBPC(nodePot,edgePot,int32(edgeStruct.edgeEnds),int32(edgeStruct.nStates),int32(edgeStruct.V),int32(edgeStruct.E),edgeStruct.maxIter);
else
[nodeBel, edgeBel, logZ] = Infer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.