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 | jakobsj/how_little_data-master | isolate_axes.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/isolate_axes.m | 3,787 | utf_8 | 453f95309059c464d4388c2e6c56d249 | %ISOLATE_AXES Isolate the specified axes in a figure on their own
%
% Examples:
% fh = isolate_axes(ah)
% fh = isolate_axes(ah, vis)
%
% This function will create a new figure containing the axes/uipanels
% specified, and also their associated legends and colorbars. The objects
% specified must all be in th... |
github | jakobsj/how_little_data-master | im2gif.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/im2gif.m | 6,234 | utf_8 | 8ee74d7d94e524410788276aa41dd5f1 | %IM2GIF Convert a multiframe image to an animated GIF file
%
% Examples:
% im2gif infile
% im2gif infile outfile
% im2gif(A, outfile)
% im2gif(..., '-nocrop')
% im2gif(..., '-nodither')
% im2gif(..., '-ncolors', n)
% im2gif(..., '-loops', n)
% im2gif(..., '-delay', n)
%
% This function c... |
github | jakobsj/how_little_data-master | pdf2eps.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/pdf2eps.m | 1,522 | utf_8 | 4c8f0603619234278ed413670d24bdb6 | %PDF2EPS Convert a pdf file to eps format using pdftops
%
% Examples:
% pdf2eps source dest
%
% This function converts a pdf file to eps format.
%
% This function requires that you have pdftops, from the Xpdf suite of
% functions, installed on your system. This can be downloaded from:
% http://www.foolabs.c... |
github | jakobsj/how_little_data-master | print2array.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/print2array.m | 6,468 | utf_8 | 34b2982f7d03ad620473fe5331f534a2 | %PRINT2ARRAY Exports a figure to an image array
%
% Examples:
% A = print2array
% A = print2array(figure_handle)
% A = print2array(figure_handle, resolution)
% A = print2array(figure_handle, resolution, renderer)
% [A bcol] = print2array(...)
%
% This function outputs a bitmap image of the given fig... |
github | jakobsj/how_little_data-master | append_pdfs.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/append_pdfs.m | 2,068 | utf_8 | 1e97e9c2cadd89753e3402105347bedb | %APPEND_PDFS Appends/concatenates multiple PDF files
%
% Example:
% append_pdfs(output, input1, input2, ...)
% append_pdfs(output, input_list{:})
% append_pdfs test.pdf temp1.pdf temp2.pdf
%
% This function appends multiple PDF files to an existing PDF file, or
% concatenates them into a PDF file if the o... |
github | jakobsj/how_little_data-master | using_hg2.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/using_hg2.m | 383 | utf_8 | f498b4d38ac8cd83c4c0d5f1b082ff84 | %USING_HG2 Determine if the HG2 graphics pipeline is used
%
% tf = using_hg2(fig)
%
%IN:
% fig - handle to the figure in question.
%
%OUT:
% tf - boolean indicating whether the HG2 graphics pipeline is being used
% (true) or not (false).
function tf = using_hg2(fig)
try
tf = ~graphicsvers... |
github | jakobsj/how_little_data-master | eps2pdf.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/eps2pdf.m | 5,143 | utf_8 | cd07d7984e39ef75ff3df49305770c4e | %EPS2PDF Convert an eps file to pdf format using ghostscript
%
% Examples:
% eps2pdf source dest
% eps2pdf(source, dest, crop)
% eps2pdf(source, dest, crop, append)
% eps2pdf(source, dest, crop, append, gray)
% eps2pdf(source, dest, crop, append, gray, quality)
%
% This function converts an eps file... |
github | jakobsj/how_little_data-master | copyfig.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/copyfig.m | 845 | utf_8 | bf21447d5aa8f9a873cf45bc0c03cef0 | %COPYFIG Create a copy of a figure, without changing the figure
%
% Examples:
% fh_new = copyfig(fh_old)
%
% This function will create a copy of a figure, but not change the figure,
% as copyobj sometimes does, e.g. by changing legends.
%
% IN:
% fh_old - The handle of the figure to be copied. Default: gc... |
github | jakobsj/how_little_data-master | user_string.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/user_string.m | 2,460 | utf_8 | e8aa836a5140410546fceccb4cca47aa | %USER_STRING Get/set a user specific string
%
% Examples:
% string = user_string(string_name)
% saved = user_string(string_name, new_string)
%
% Function to get and set a string in a system or user specific file. This
% enables, for example, system specific paths to binaries to be saved.
%
% IN:
% string_name - ... |
github | jakobsj/how_little_data-master | export_fig.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/export_fig.m | 29,846 | utf_8 | 5424a162b645a44ca71ec9d7364ac582 | %EXPORT_FIG Exports figures suitable for publication
%
% Examples:
% im = export_fig
% [im alpha] = export_fig
% export_fig filename
% export_fig filename -format1 -format2
% export_fig ... -nocrop
% export_fig ... -transparent
% export_fig ... -native
% export_fig ... -m<val>
% export_fig... |
github | jakobsj/how_little_data-master | ghostscript.m | .m | how_little_data-master/phasediagrams_code/code/ext/export_fig/ghostscript.m | 5,167 | utf_8 | e274d22dbcaa074e52b4567ad806444d | %GHOSTSCRIPT Calls a local GhostScript executable with the input command
%
% Example:
% [status result] = ghostscript(cmd)
%
% Attempts to locate a ghostscript executable, finally asking the user to
% specify the directory ghostcript was installed into. The resulting path
% is stored for future reference.
% ... |
github | jakobsj/how_little_data-master | mosek_wrap.m | .m | how_little_data-master/phasediagrams_code/code/ext/mosek_wrap/mosek_wrap.m | 5,961 | utf_8 | fbb89dcdaa5c7670fdf1d3fd7e18caca | function [xsol,info] = mosek_wrap(prob, solver_pars, lowlev_pars)
%MOSEK_WRAP Wrapper to solve selected problems using MOSEK
% [xsol,info] = mosek_wrap(prob, solver_pars, lowlev_pars)
%
% Inputs:
% - prob: struct describing the optimization problem, fields:
% name: String with problem name, see switch-cases ... |
github | jakobsj/how_little_data-master | snow.m | .m | how_little_data-master/phasediagrams_code/code/ext/SNOWMAKER/snow.m | 12,153 | utf_8 | 334a1fb5734cb0f64da3223e7b0d3d82 | function sdim = snow(name,varargin)
% SNOW: Compute statistical dimensions for various cones
%
% USAGE: SDIM = SNOW("NAME",Param1,Param2,...)
%
% INPUTS:
% -NAME The name determines the type of cone, e.g., circular, orthant, l1
% descent cone, etc. The implemented methods appear below.
%
% -Param Some con... |
github | jakobsj/how_little_data-master | randkaczmarz.m | .m | how_little_data-master/phasediagrams_code/code/ext/AIRtools_1.0/randkaczmarz.m | 8,542 | utf_8 | 05ab0ba3c020f3032d3623d70d70a634 | function [X info] = randkaczmarz(A,b,K,x0,options)
%RANDKACZMARZ Randomized Kaczmarz method
%
% [X info] = randkaczmarz(A,b,K)
% [X info] = randkaczmarz(A,b,K,x0)
% [X info] = randkaczmarz(A,b,K,x0,options)
%
% Implements the randomized Kaczmarz's method for the system Ax = b:
%
% x^{k+1} = x^k + lambda*(b_... |
github | jakobsj/how_little_data-master | calczeta.m | .m | how_little_data-master/phasediagrams_code/code/ext/AIRtools_1.0/calczeta.m | 1,529 | utf_8 | 4dfb3da4760cf7a1bfab368494fe922a | function z = calczeta(k)
%CALCZETA Calculates a specific root of a certain polynomial
%
% z = calczeta(k)
%
% Calculates the unique root in the interval [0 1] of the polynomial equation
% (2k -1)z^{k-1} - ( z^{k-2} + ... + z + 1 ) = 0
% by means of Newton's method.
%
% Input:
% k either a sorted vector or a ... |
github | highperformancecoder/minsky-master | testEq.m | .m | minsky-master/test/testEq.m | 1,099 | utf_8 | 0e788b61119d303e4a359f053d9e35d6 | function f=uf0
f=exp(1)
endfunction;
function f=uf1(x)
f=exp(x)
endfunction;
function f=uf2(x,y)
f=exp(x+y)
endfunction;
function f=f(x,t)
F=x(1);
Loans=x(2);
b=x(3);
fooey=x(4);
int=x(5);
int1=x(6);
tau_mathrmbar=0;
foo_1=0;
c=0;
bar_23=0;
bar=0;
a=0;
A=0;
polygamma=psi(floor(0),(t));
q=atan(inf);
r=100*(1);
s=gamm... |
github | highperformancecoder/minsky-master | compareWithOctave.m | .m | minsky-master/test/compareWithOctave.m | 514 | utf_8 | d3d9237d1644b3f2e75978d247b278ee | example=argv(){1};
source ([example ".m"]);
source ([example ".dat"]);
function h=heaviside(x)
if (x<0)
h = 0;
else
h = 1;
endif
endfunction
function i=iota(n)
i=[0:n-1];
endfunction
# split input data into timestep vector and data to compare
t=d(:,1);
xc=d(:,2:size(d,2));
x=lsode(@f, x0, t);
i... |
github | joshwcheung/risk-prediction-regression-models-master | simulateData.m | .m | risk-prediction-regression-models-master/simulateData.m | 3,111 | utf_8 | fcbb903c99c3ad9315debd4d599a7c8f | function simulateData(m, n, varG)
%simulateData simulates genotype and phenotype data
% stores p, G, B, E, and Y in .csv files for training and validation sets
% p: vector of m minor allele frequencies (MAFs)
% G: n x m matrix of genotypes
% B: vector of m betas, the SNP effect sizes, where 1% are causal
% E:... |
github | joshwcheung/risk-prediction-regression-models-master | validateModel.m | .m | risk-prediction-regression-models-master/validateModel.m | 2,417 | utf_8 | 230340d2edde4bc44a2fba1e4a7ff3f1 | function validateModel()
%validateModel produces R^2 and MSE calculations for regression models
BHatOLS = csvread('BHatOLS.csv');
BHatModifiedOLS = csvread('BHatModifiedOLS.csv');
BHatRidge = csvread('BHatRidge.csv');
BHatLasso = csvread('BHatLasso.csv');
G = csvread('ValidationG.csv');
Y = csvread('ValidationY.csv');... |
github | sods/svml-master | svmlopt.m | .m | svml-master/svmlopt.m | 10,773 | utf_8 | 0bb13c47a53673366e0707ea708bb7e9 | function options = svmlopt(varargin)
% SVMLOPT - Generate/alter options structure for SVM light
%
% OPTIONS = SVMLOPT('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 []
% (... |
github | sods/svml-master | svm_learn.m | .m | svml-master/svm_learn.m | 4,486 | utf_8 | 8af44d7ce356eefa151c3d939f6f02a7 | function status = svm_learn(options, examples, model)
% SVM_LEARN - Interface to SVM light, learning module
%
% STATUS = SVM_LEARN(OPTIONS, EXAMPLES, MODEL)
% Call the training program 'svm_learn' of the SVM light
% package.
% OPTIONS must be a structure generated by SVMLOPT.
% EXAMPLES is the name of the fi... |
github | sods/svml-master | svm_classify.m | .m | svml-master/svm_classify.m | 2,103 | utf_8 | 5d09a19437d9a311a03abf3b63715c2c | function status = svm_classify(options, data, model, predictions)
% SVM_CLASSIFY - Interface to SVM light, classification module
%
% STATUS = SVM_CLASSIFY(OPTIONS, DATA, MODEL, PREDICTIONS)
% Call the classification program 'svm_classify' of the SVM light
% package.
% OPTIONS must be a structure generated by... |
github | scivision/python-matlab-examples-main | cwd.m | .m | python-matlab-examples-main/cwd.m | 111 | utf_8 | 1015ab48edb8a83061c2777a33294258 | % finds directory this .m file exists in
function path = cwd()
path = fileparts(mfilename('fullpath'));
end
|
github | scivision/python-matlab-examples-main | airy_disc_kernel.m | .m | python-matlab-examples-main/PlotExamples/airy_disc_kernel.m | 505 | utf_8 | db8b602a4643828f155223a2754229de | % https://github.com/astropy/astropy/blob/astropy/modeling/functional_models.py
function z = airy_disc_kernel(N, radius)
arguments
N (1,1) {mustBePositive}
radius (1,1) {mustBePositive} = 3
end
x_0=0;
y_0=0;
%%
x = -N/2:N/2;
y = x;
[x,y] = meshgrid(x,y);
j1zero = 3.8317059702075125; % scipy.special.jn_zeros(1, 1... |
github | scivision/python-matlab-examples-main | contourOverImage.m | .m | python-matlab-examples-main/PlotContour/contourOverImage.m | 698 | utf_8 | 4d86be9ed9ec1c37204ce91504ba5d8a | function contourOverImage()
[X,Y,Z,V] = testdata();
plotimagecontour(X,Y,Z,V)
end
function [X,Y,Z,V] = testdata()
delta = 0.1;
V = 0.1*rand(61,61);
x = -3:delta:3;
y = -3:delta:3;
[X,Y] = meshgrid(x,y);
Z = reshape(mvnpdf([X(:),Y(:)]), size(X));
end
function plotimagecontour(x,y,Z,V)
%% 2-D
figure(1),clf(1)
% image
a... |
github | scivision/python-matlab-examples-main | contourImage2.m | .m | python-matlab-examples-main/PlotContour/contourImage2.m | 2,685 | utf_8 | 235acf2b376a1d6256d093cbfc0a77eb | % This function is a hack around the new R2014b+ graphics system that removed
% the ability to manipulate the children of contour(), contourf().
% It flattens a contour and pcolor, with a bit of sharpness loss due to imresize
% operation.
% Certainly not optimal but "it works" to put a contour on an image in 3-D.
% Mic... |
github | yiran06/mat_inverse-master | mat_inverse.m | .m | mat_inverse-master/mat_inverse.m | 2,159 | utf_8 | 1f7f4538b49003f1f810672c857ecf76 | function [niter,vr_iter,vp_iter,vs_iter,dns_iter] = mat_inverse(tag,freq,vr_exp,sigma,thk,vp,vs,dns,maxiter, mu, tol_vs)
% input:
% 1. dispersion curve
% L/R, freq, vr_exp, sigma
% 2. initial model
% thk, vp, vs, dns
% 3. parameters control the inversion
% maxiter, mu, tol_vs (change in vs)
addp... |
github | yiran06/mat_inverse-master | plt_model_rbh.m | .m | mat_inverse-master/plt_model_rbh.m | 757 | utf_8 | 64f950b76cc2d862ef0e1076856342b3 | % plot thk model
function plt_model_rbh(thk,dns1,vp1,vs1,linetype)
tmp = cumsum(thk);
z1 = [0;tmp];
z2 = [tmp;tmp(end)+20];
NL = length(thk);
z = zeros(1 + 2*NL + 1,1);
dns= z; vp=z; vs=z;
z(1) = z1(1);
z(2:2:end-1) = z2(1:end-1);
z(3:2:end-1) = z2(1:end-1);
z(end) = z2(end);
dns(1) = dns1(1);
dns(2:2:end-1) = dns... |
github | yiran06/mat_inverse-master | write_model_rbh.m | .m | mat_inverse-master/write_model_rbh.m | 477 | utf_8 | db8d28ee00a137db3986028b203fff62 | % write the model
function write_model_rbh(name,h,vp,vs,rho)
fid = fopen(name,'w+');
fprintf(fid,'MODEL\nTEST MODEL\nISOTROPIC\nKGS\nFLAT EARTH\n1-D\nCONSTANT VELOCITY\nLINE08\nLINE09\nLINE10\nLINE11\nH(KM) VP VS RHO QP QS ETAP ETAS FREFP FREFS \n');
for i=1:length(h)
fprintf(fid,'%10.3f %10.3f %10.3f %10... |
github | yiran06/mat_inverse-master | example.m | .m | mat_inverse-master/example.m | 3,932 | utf_8 | d725b17a7e95d174034803ff2d0e4bcd | % 1-10 sec Love wave disperion from CVM model
function example
close all;
addpath('/home/yma/Codes/Surf.Codes/mat_disperse');
itheo = 0;
disp_theo = 'disp_theo.txt';
model_theo = 'CVM_basin.mdl';
%%%
% creat 1~10 s dispersion curve from CVM basin model
if itheo
% create synthetic dispersion curve
period ... |
github | hollaus/MSTEx-CVL-matlab-master | removeFalsePositives.m | .m | MSTEx-CVL-matlab-master/src/removeFalsePositives.m | 724 | utf_8 | 131a85a2d917681a08e312fd277806d8 | function cleanImg = removeFalsePositives(suImg, aceThresh, varargin)
params = parseInputs(varargin{:});
% neighSize = 21;
% numSafeFGNeighbors = 1;
falsePositiveCandidate = (suImg - aceThresh) > 0;
safeFG = suImg .* aceThresh;
sumSafeFG = imfilter(safeFG, ones(params.rPNeighSize), 'symmetric');
numSafeFG = falsePo... |
github | hollaus/MSTEx-CVL-matlab-master | normimg.m | .m | MSTEx-CVL-matlab-master/src/normimg.m | 2,229 | utf_8 | 0e9a5544bdcaeac28b7cc7f86ab47005 | function img = normimg(img, varargin)
% function img = normimg(img);
%
% DESCRIPTION:
% IMG = normimg(IMG); normalizes an image IMG. It simply adds the minimal
% value < 0 of an image matrix so that all values are positive. Afterwards
% it divides all values by the maximum. The resultant image IMG is an
% image wh... |
github | hollaus/MSTEx-CVL-matlab-master | getFileList.m | .m | MSTEx-CVL-matlab-master/src/getFileList.m | 898 | utf_8 | 2faf5f03fda74d2dbbbe7276ca43a749 | function fileList = getFileList(path, varargin)
params = parseInputs(varargin{:});
if (~isfolder(path))
disp([path ' is not a directory']);
fileList = [];
return;
end
if (nargin == 1)
fileList = dir(fullfile(path));
else
fileList = dir(fullfile(path, ['*' params.ext]));
end
isFile = ~[fileList... |
github | hollaus/MSTEx-CVL-matlab-master | binarizeBatch.m | .m | MSTEx-CVL-matlab-master/src/binarizeBatch.m | 1,198 | utf_8 | d9755ed3624f95db16b0817969c8845b | function binarizeBatch(srcPath, trgPath, varargin)
params = parseInputs(varargin{:});
ids = getUniqueFileIds(srcPath, params);
for i = 1 : length(ids)
id = ids{i};
if strcmp(params.dbName, 'mstex')
msPath = fullfile(srcPath, id);
elseif strcmp(params.dbName, 'msbin')
params.numN... |
github | hollaus/MSTEx-CVL-matlab-master | binarMultiSpect.m | .m | MSTEx-CVL-matlab-master/src/binarMultiSpect.m | 5,689 | utf_8 | ff1c5fd9c4de1497e735042e0fe763e2 | function binarMultiSpect(folderName, outputImgName)
%BINARMULTISPECT Applies document binarization on multispectral images.
% BINARMULTISPECT reads the images contained in a folder folderName and
% writes the resulting image outputImgName.
% The folder should contain 8 image files (FXXs.png) where XX is the
% channel... |
github | hollaus/MSTEx-CVL-matlab-master | suBinar.m | .m | MSTEx-CVL-matlab-master/src/suBinar.m | 5,040 | utf_8 | 415351e8419f5be1b4a9a4d269aff5ec | function binaryImg = suBinar(img, varargin)
% Implementation of:
% Binarization of Historical Document Images Using the Local Maximum and Minimum
% - by: Bolan Su, Shijian Lu, Chew Lim Tan
%
% Copyright (C) 2014-2015 Fabian Hollaus <holl@caa.tuwien.ac.at>
% Copyright (C) 2014-2015 Markus Diem <markus@nomacs.org>
% ... |
github | hollaus/MSTEx-CVL-matlab-master | getUniqueFileIds.m | .m | MSTEx-CVL-matlab-master/src/getUniqueFileIds.m | 920 | utf_8 | bf0e2c57bd08a2640e2106cae112e749 | function uniqueIds = getUniqueFileIds(pathName, varargin)
params = parseInputs(varargin{:});
if strcmp(params.dbName, 'mstex')
d = dir(pathName);
dfolders = d([d(:).isdir]);
dfolders = dfolders(~ismember({dfolders(:).name},{'.','..'}));
uniqueIds = {dfolders(:).name};
else
fileName... |
github | hollaus/MSTEx-CVL-matlab-master | binarMS.m | .m | MSTEx-CVL-matlab-master/src/binarMS.m | 1,833 | utf_8 | 1874da9b4d50286d7957945370c1daf8 | function output = binarMS(data, width, height, varargin)
params = parseInputs(varargin{:});
writingImg = reshape(data(:, params.writingIdx), height, width);
b = suBinar(writingImg, params);
b = removeBackground(b);
if (isfield(params, 'evalStage')) && (params.evalStage == 1)
output = b;
return;
end
fgIdx ... |
github | hollaus/MSTEx-CVL-matlab-master | folderFMeasureMSBin.m | .m | MSTEx-CVL-matlab-master/src/folderFMeasureMSBin.m | 1,627 | utf_8 | 9f3e78228c7c7d4ab7ba9cf375826a31 | function [f, fileNames, r, p, nrm] = folderFMeasureMSBin(imgPath, gtPath, varargin)
params = parseInputs(varargin{:});
gtImgs = getFileList(gtPath);
f = zeros(length(gtImgs),1);
r = f;
p = f;
nrm = f;
fileNames = gtImgs;
for i = 1 : length(gtImgs)
gtName = gtImgs{i};
gtImg = imread(fullfile(gtPath, gtN... |
github | ahmadyan/Duplex-master | vbgm.m | .m | Duplex-master/test/vbgm.m | 5,328 | utf_8 | 86a1a8cbce3754dcfaebaf25bf66a3ec | function [label, model, L] = vbgm(X, init, prior)
% Perform variational Bayesian inference for Gaussian mixture.
% X: d x n data matrix
% init: k (1 x 1) or label (1 x n, 1<=label(i)<=k) or center (d x k)
% Reference: Pattern Recognition and Machine Learning by Christopher M. Bishop (P.474)
% Written by Michael Che... |
github | ahmadyan/Duplex-master | rosen.m | .m | Duplex-master/test/optimization-test/rosen.m | 441 | utf_8 | 2e3ae96ad4c959619ddeffb8ad425f3b | % Duplex optimization
%
% Vectorized version of the Generalized Multi-variate Rosenbrock function
% https://en.wikipedia.org/wiki/Rosenbrock_function
% f(x, y) = sum_{i=1}^{N-1} 100 (x_{i+1} - x_i^2)^2 + (1-x_i)^2
% This function has exactly one minimum for N=3 at (1, 1, 1) and
% two minimums for N=4-7 at (1, 1, ..... |
github | mprat/lsr-l1reg-matlab-master | l1_ls_nonneg.m | .m | lsr-l1reg-matlab-master/+l1_ls/l1_ls_nonneg.m | 7,985 | utf_8 | a65d1f604b6bb3e700f967b4eed0ba79 | function [x,status,history] = l1_ls_nonneg(A,varargin)
%
% l1-Regularized Least Squares Problem Solver
%
% l1_ls solves problems of the following form:
%
% minimize ||A*x-y||^2 + lambda*sum(x_i),
% subject to x_i >= 0, i=1,...,n
%
% where A and y are problem data and x is variable (described below).
%... |
github | mprat/lsr-l1reg-matlab-master | l1_ls.m | .m | lsr-l1reg-matlab-master/+l1_ls/l1_ls.m | 8,414 | utf_8 | 592cd5d633c7f3e474bcad9309e4ea07 | function [x,status,history] = l1_ls(A,varargin)
%
% l1-Regularized Least Squares Problem Solver
%
% l1_ls solves problems of the following form:
%
% minimize ||A*x-y||^2 + lambda*sum|x_i|,
%
% where A and y are problem data and x is variable (described below).
%
% CALLING SEQUENCES
% [x,status,history] = l1... |
github | mabl/wgms3d-master | nguyen_prepfunc.m | .m | wgms3d-master/tests/tm2te_leakage/nguyen_prepfunc.m | 894 | utf_8 | b1dde9f1c7b3367e55aee4a569d7610b |
function com = nguyen_prepfunc (W, nsearch)
lambda0 = 1.55e-6;
H = 0.205e-6;
D = 0.015e-6;
RC = 0.007e-6;
wgms3d_mgp_rib_waveguide('nguyen.mgp', W, H, D, RC, 1.0, 3.4797, 1.444);
xx = wgms3d_grid_make([ 0e-6 W/2-100e-9 W/2-25e-9 W/2+25e-9 W/2+100e-9 5.0e-6], ...
... |
github | mabl/wgms3d-master | nguyen_plotfunc.m | .m | wgms3d-master/tests/tm2te_leakage/nguyen_plotfunc.m | 395 | utf_8 | bbd328a9366f65443e0737667c2f70be |
function nguyen_plotfunc (Ws, Modes)
wgms3d_tracemodes_plotneffs (Ws, Modes);
for i = 1 : length(Modes{end})
ccfig(10+i); clf
wgms3d_plot_ht(Modes{end}{i}, 'Geometry', 'nguyen.mgp', 'LogContours', 3);
title(sprintf('Mode %d', i))
end
function ccfig (h)
if ishan... |
github | mabl/wgms3d-master | bendit_plotfunc.m | .m | wgms3d-master/tests/disk_resonator/bendit_plotfunc.m | 402 | utf_8 | 392e1db5fb7b8badb4ccaee1f38d9bb8 |
function bendit_plotfunc (Rcurvs, Modes)
wgms3d_tracemodes_plotneffs (Rcurvs, Modes);
for i = 1 : length(Modes{end})
ccfig(10+i); clf
wgms3d_plot_ht(Modes{end}{i}, 'Geometry', 'prkna.mgp', 'LogContours', 3);
title(sprintf('Mode %d', i))
end
function ccfig (h)
i... |
github | mabl/wgms3d-master | circular_exact_e_field.m | .m | wgms3d-master/tests/all_field_components/circular_exact_e_field.m | 1,665 | utf_8 | 94fe66e65c8ab2c4923cbb8063d06647 |
function [ex, ey, ez] = circular_exact_e_field (nu, neff, xs, ys, ...
rho, lambda, nco, ncl)
k = 2*pi/lambda;
V = k*rho*sqrt(nco^2-ncl^2);
beta = k * neff;
U = rho * sqrt(k^2*nco^2 - beta.^2);
W = rho * sqrt(beta.^2 - k^2*ncl^2);
I = sqrt(-1);
u0 = 1.... |
github | mabl/wgms3d-master | circular_exact_h_field.m | .m | wgms3d-master/tests/all_field_components/circular_exact_h_field.m | 2,027 | utf_8 | 695bc345de175218b525ff4597559544 |
function [hx, hy, hz] = circular_exact_h_field (nu, neff, xs, ys, ...
rho, lambda, nco, ncl)
k = 2*pi/lambda;
V = k*rho*sqrt(nco^2-ncl^2);
beta = k * neff;
U = rho * sqrt(k^2*nco^2 - beta.^2);
W = rho * sqrt(beta.^2 - k^2*ncl^2);
I = sqrt(-1);
u0 = 1.... |
github | mabl/wgms3d-master | wgms3d_plot_hl.m | .m | wgms3d-master/matlab/wgms3d_plot_hl.m | 1,248 | utf_8 | cc7fc70197e8e61f026020df75dc2cee |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_import_output.m | .m | wgms3d-master/matlab/wgms3d_import_output.m | 2,092 | utf_8 | f1d05b96df77b097c4ffccb79dfda950 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2011 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_ht.m | .m | wgms3d-master/matlab/wgms3d_plot_ht.m | 1,334 | utf_8 | b44af5c928ba35cd41d6cbf5817a2f28 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_grid_write.m | .m | wgms3d-master/matlab/wgms3d_grid_write.m | 970 | utf_8 | 1d94bbffe558aebe46e6c3b864259dd6 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_normalize_mode_field.m | .m | wgms3d-master/matlab/wgms3d_normalize_mode_field.m | 1,335 | utf_8 | eae960f499008ba9f06aeaadf540a2d1 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2012 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_post.m | .m | wgms3d-master/matlab/wgms3d_plot_post.m | 1,594 | utf_8 | 3b31316f4d872d2e7685453a5f13a7a6 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_calc_group_index.m | .m | wgms3d-master/matlab/wgms3d_calc_group_index.m | 1,511 | utf_8 | e80122743634a01ce9c6a71d8c696cfd |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2011 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_int.m | .m | wgms3d-master/matlab/wgms3d_int.m | 1,108 | utf_8 | fc9ec43034bf79b6b85efb55c66291a2 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_mgp.m | .m | wgms3d-master/matlab/wgms3d_plot_mgp.m | 2,827 | utf_8 | 11ca9c4098c081ad568ec7c944f2b0cc |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_grid_make.m | .m | wgms3d-master/matlab/wgms3d_grid_make.m | 988 | utf_8 | 1490a3b2dba6a474c34070f0464f786e |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_et.m | .m | wgms3d-master/matlab/wgms3d_plot_et.m | 1,332 | utf_8 | 5372968319750b8c22ca9670042dad99 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_quiver.m | .m | wgms3d-master/matlab/wgms3d_plot_quiver.m | 3,018 | utf_8 | 93a279329430558875e95cbd08a27cad |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_modeproduct.m | .m | wgms3d-master/matlab/wgms3d_modeproduct.m | 992 | utf_8 | 6c1e848273907d2a07da1e1dad0d72f7 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_clean.m | .m | wgms3d-master/matlab/wgms3d_clean.m | 905 | utf_8 | 59e88513f17c5bceeab70d2aba5d1ab8 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_contours.m | .m | wgms3d-master/matlab/wgms3d_plot_contours.m | 2,454 | utf_8 | b772e31461453caf521256911ece2bb1 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_el.m | .m | wgms3d-master/matlab/wgms3d_plot_el.m | 1,246 | utf_8 | 1bd648f809b34b6166866dd4e73016ae |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_mgp_rib_waveguide.m | .m | wgms3d-master/matlab/wgms3d_mgp_rib_waveguide.m | 4,679 | utf_8 | c90a592d8a7a334cb4399175139fb807 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2012 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_cd_boundary.m | .m | wgms3d-master/matlab/wgms3d_plot_cd_boundary.m | 1,213 | utf_8 | f3f585306b2375727d15e3b8e26daae5 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_read_bin_data.m | .m | wgms3d-master/matlab/wgms3d_read_bin_data.m | 1,062 | utf_8 | fb9219c6a360e254cb81584824ecb785 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2011 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_run.m | .m | wgms3d-master/matlab/wgms3d_run.m | 1,068 | utf_8 | 8818359fc495055aceb0c5f2fc4f8646 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_tracemodes.m | .m | wgms3d-master/matlab/wgms3d_tracemodes.m | 7,433 | iso_8859_15 | 78bac33a027b18470ddaa1c2cc9f6dd1 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2011 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_find_pml.m | .m | wgms3d-master/matlab/wgms3d_find_pml.m | 1,209 | utf_8 | d2706a95ea9a652a399536b946e89fec |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_tracemodes_plotneffs.m | .m | wgms3d-master/matlab/wgms3d_tracemodes_plotneffs.m | 1,370 | utf_8 | 72336f74bbb56bbaae9d85d4e1bd3e81 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2011 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_load_field.m | .m | wgms3d-master/matlab/wgms3d_load_field.m | 1,159 | utf_8 | 2907d7091d51aa5a167bd0a10ca77d5a |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2010 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_scalar.m | .m | wgms3d-master/matlab/wgms3d_plot_scalar.m | 1,304 | utf_8 | 3127ba0f7397caa26555c042b49e3eb1 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2011 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_plot_refractive_index.m | .m | wgms3d-master/matlab/wgms3d_plot_refractive_index.m | 1,236 | utf_8 | cfff0f46e09b29f04da678ee7fdce777 |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2011 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | mabl/wgms3d-master | wgms3d_load_mode_field.m | .m | wgms3d-master/matlab/wgms3d_load_mode_field.m | 2,316 | utf_8 | 54030ac9aa3739fe27ed2560778fdfcf |
% wgms3d - a full-vectorial finite-difference mode solver.
%
% Copyright (C) 2005-2011 Michael Krause <m.krause@tu-harburg.de>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, eithe... |
github | igem-waterloo/uwaterloo-igem-2015-master | viralAssemblyModel.m | .m | uwaterloo-igem-2015-master/models/viralassembly/viralAssemblyModel.m | 5,721 | utf_8 | 91fb6fc35200c7ee54c09fbb2862eb97 | function viralAssemblyModel ()
%% Initial Conditions
% We're setting everything to 0 except the first variable
% The first variable is the copy number of gapped DNA in the nucleus
% This simulates the initial infection
initial = zeros(18,1);
initial(1) = 0.0001;
vol = 75; % Volume of cell
%% Run the simulati... |
github | igem-waterloo/uwaterloo-igem-2015-master | mattsmart_poly.m | .m | uwaterloo-igem-2015-master/training/week1/mattsmart_poly.m | 529 | utf_8 | 944cf505ad762ad016eb6ce480028109 | function [y] = mattsmart_poly(x, coeffs)
% testing if source tree works
sum_recurse = 0;
coeffs_recurse = coeffs;
function sum = poly_recurse(coeffs_recurse, sum_recurse)
n = length(coeffs_recurse);
if n == 1
sum = sum_recurse + coeffs_recurse(n);
else
sum_recurse = sum_recurse + coeffs... |
github | igem-waterloo/uwaterloo-igem-2015-master | minfcn.m | .m | uwaterloo-igem-2015-master/training/week1/minfcn.m | 292 | utf_8 | 6c519d57b453178eef8f708ca1314035 |
function [min_index] = minfcn(A)
%1 - return the minimum element of array
%2 - return index
N = numel(A);
min = A(1);
for i = 1:1:N
if A(i) < min
min = A(i);
index = find(A == A(i));
end
end
min_index = 1;
min_index(1) = min;
min_index(2) = index;
end
|
github | igem-waterloo/uwaterloo-igem-2015-master | trainingODESystem_toFill.m | .m | uwaterloo-igem-2015-master/training/week2/trainingODESystem_toFill.m | 1,443 | utf_8 | adee87627175929b7d99709cbf02a3db | % Plots the time series of a very simple 6-species network
function trainingODESystem_toFill
% Plots the time series of a very simple 6-species network
% The network includes the following reactions:
% A + B -> C + D (with rate constant k1)
% C -> E + F (with rate constant k2)
% D -> B ... |
github | igem-waterloo/uwaterloo-igem-2015-master | trainingODESystem.m | .m | uwaterloo-igem-2015-master/training/week2/trainingODESystem.m | 1,540 | utf_8 | 56a3eb3fdf8a68545544a1eef20ddeae | function trainingODESystem
% Plots the time series of a very simple 6-species network
% The network includes the following reactions:
% A + B -> C + D (with rate constant k1)
% C -> E + F (with rate constant k2)
% D -> B (with rate constant k3);
%
% Based on example code by ... |
github | aniket0112/Sudoku_Solver-master | SolveSudoku.m | .m | Sudoku_Solver-master/SolveSudoku.m | 4,467 | utf_8 | 6af5046dc7fda749c5c9687d134dd863 | %This Function follows Backtracking algorithm to solve the SUDOKU. The
%function is recurred till it gives flag 1 i.e. SUDOKU is solved.
function [flag]=SolveSudoku(ANSWER,minimumarray,all_possible_elements)
%For storing the solved ANSWER matrix a global variable is defined.
global ANSWEROUT; ... |
github | lxkuz/left_ventricle_detection-master | polygon2voxel_double.m | .m | left_ventricle_detection-master/polygon2voxel_version1j/polygon2voxel_double.m | 5,872 | utf_8 | d0e1eae2993db447be74e337e5bcab4b | function Volume=polygon2voxel_double(FacesA,FacesB,FacesC,VerticesX,VerticesY,VerticesZ,VolumeSize,Wrap)
Vertices=[VerticesX(:) VerticesY(:) VerticesZ(:)]-1;
% List with all vertices coordinates of a face
FaceVertices=[Vertices(FacesA,:) Vertices(FacesB,:) Vertices(FacesC,:)];
Volume=false(VolumeSize);
Volume=Dr... |
github | lxkuz/left_ventricle_detection-master | SelectPosition.m | .m | left_ventricle_detection-master/Functions/SelectPosition.m | 2,312 | utf_8 | 515420e8afee2e26082c33d57777b6ff | function varargout = SelectPosition(varargin)
% Detect callback and execute callback function
if nargin && ischar(varargin{1})
gui_Callback = str2func(varargin{1});
feval(gui_Callback,varargin{2:end});
return
end
% Input arguments
data.Image=varargin{1};
data.shapex=varargin{2};
data.shapey=va... |
github | lxkuz/left_ventricle_detection-master | PreProcessCp2tform.m | .m | left_ventricle_detection-master/Functions/PreProcessCp2tform.m | 2,813 | utf_8 | 8948ba44acf85c0ba38910f1c9a1d4e9 | function [uv xy]=PreProcessCp2tform(uv,xy)
% When CP2TFORM is used in piecewise linear mode, it uses triangulation
% to calculate the local image transformation. Sometimes a good
% triangulation of basepoints gives folded triangles when used
% with the input points. The function CP2TFORM try's to remove
% the co... |
github | lxkuz/left_ventricle_detection-master | DrawContourGui.m | .m | left_ventricle_detection-master/Functions/DrawContourGui.m | 7,543 | utf_8 | 1e97b71d86faf4aabd03664666d92d59 | function varargout = DrawContourGui(varargin)
% This GUI DrawContourGui can be used to draw a contour line on
% a picture (saddly, only very basic functionality).
%
% How does it work :
% - Start DrawContourGui
% - Load a picture
% Drawing the line
% - Left click with the mouse on a landmark point for
% instance ... |
github | lxkuz/left_ventricle_detection-master | showcs3.m | .m | left_ventricle_detection-master/Functions/showcs3.m | 8,747 | utf_8 | 2772587091495810f7c29fd98e6987d5 | function varargout = showcs3(varargin)
% SHOWCS3 M-file for showcs3.fig
% SHOWCS3, by itself, creates a new SHOWCS3 or raises the existing
% singleton*.
%
% H = SHOWCS3 returns the handle to a new SHOWCS3 or the handle to
% the existing singleton*.
%
% SHOWCS3('CALLBACK',hObject,eventData,handl... |
github | lxkuz/left_ventricle_detection-master | ASM_MakeAppearanceModel2D.m | .m | left_ventricle_detection-master/ASM Functions/ASM_MakeAppearanceModel2D.m | 2,852 | utf_8 | 0360eb3bdeadb8aea2740dc66947943b | %% Gray-Level Appearance Model
function AppearanceData=ASM_MakeAppearanceModel2D(TrainingData,options)
% Number of TrainingData sets
s=length(TrainingData);
% Number of landmarks
nl = size(TrainingData(1).Vertices,1);
% Calculate the normals of the contours of all training data
for i=1:s
[TrainingData(i... |
github | lxkuz/left_ventricle_detection-master | ASM_MakeAppearanceModel3D.m | .m | left_ventricle_detection-master/ASM Functions/ASM_MakeAppearanceModel3D.m | 2,938 | utf_8 | a026415550b1c5eec6b021d25a1b3594 | %% Gray-Level Appearance Model
function AppearanceData=ASM_MakeAppearanceModel3D(TrainingData,Faces,options)
% Number of TrainingData sets
s=length(TrainingData);
% Number of landmarks
nl = size(TrainingData(1).Vertices,1);
% Calculate the normals of the contours of all training data
for i=1:s
[Traini... |
github | lxkuz/left_ventricle_detection-master | ASM_ApplyModel3D.m | .m | left_ventricle_detection-master/ASM Functions/ASM_ApplyModel3D.m | 8,082 | utf_8 | e3389ec0ec524d8c855411e8e84ec173 | function [posV,I_segment]=ASM_ApplyModel3D(Itest,tform,ShapeData,AppearanceData,options)
% Optimalization
% The initial contour is the Mean trainingdata set contour
nl=length(ShapeData.x_mean)/3;
posV=[ShapeData.x_mean(1:nl) ShapeData.x_mean(nl+1:nl*2) ShapeData.x_mean(nl*2+1:end)];
% Position the initial con... |
github | lxkuz/left_ventricle_detection-master | AAM_ApplyModel3D.m | .m | left_ventricle_detection-master/AAM Functions/AAM_ApplyModel3D.m | 12,950 | utf_8 | 94194e13f41b5675d230cbefde63db2b | function [pos,I_model,I_segment]=AAM_ApplyModel3D(ItestLarge,tformLarge,Data,options)
pos = InitialShape(tformLarge,Data,options);
% Loop through the 4 image size scales
for scale=options.nscales:-1:1
% Get the PCA model for this scale
R=Data{scale}.R;
ShapeAppearanceData=Data{scale}.ShapeAppearance... |
github | lxkuz/left_ventricle_detection-master | AAM_MakeSearchModel2D.m | .m | left_ventricle_detection-master/AAM Functions/AAM_MakeSearchModel2D.m | 6,315 | utf_8 | 0b015065c0093117eb5e8db6c6e42536 | function R=AAM_MakeSearchModel2D(ShapeAppearanceData,ShapeData,AppearanceData,TrainingData,options)
% Structure which will contain all weighted errors of model versus real
% intensities, by several offsets of the parameters
drdp=zeros(size(ShapeAppearanceData.Evectors,2)+4,6,length(TrainingData),length(Appearanc... |
github | lxkuz/left_ventricle_detection-master | AAM_ApplyModel2D.m | .m | left_ventricle_detection-master/AAM Functions/AAM_ApplyModel2D.m | 8,336 | utf_8 | 153b406bd9455b8e85bc3a6a9fef83c4 | function AAM_ApplyModel2D(ItestLarge,tformLarge,Data,options)
% We start at the coarse scale
scale=1; scaling=2^(-(scale-1));
% Transform the coordinates to match the coarse scale
tform=tformLarge;
%tform.offsetv=(tform.offsetv-0.5)*scaling+0.5;
tform.offsetv=tform.offsetv*scaling;
% Get the PCA model for ... |
github | lxkuz/left_ventricle_detection-master | AAM_MakeSearchModel3D.m | .m | left_ventricle_detection-master/AAM Functions/AAM_MakeSearchModel3D.m | 9,280 | utf_8 | cbbad9ae203156184f91952169dff07d | function R=AAM_MakeSearchModel3D(ShapeAppearanceData,ShapeData,AppearanceData,TrainingData,options)
nl=length(ShapeData.x_mean)/3;
if(options.scale3), posen=10; else posen=7; end
% Structure which will contain all weighted errors of model versus real
% intensities, by several offsets of the parameters
drdp=zer... |
github | rbgirshick/caffe-fast-rcnn-master | classification_demo.m | .m | caffe-fast-rcnn-master/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | KarlYang2013/Text-detection-and-extraction-from-a-natural-image-master | 2.color_reduction.m | .m | Text-detection-and-extraction-from-a-natural-image-master/Code/2.color_reduction.m | 2,477 | utf_8 | a60f80e4c382e777cae48155055f9002 | function [X,map] = color_reduction(varargin)
[RGB,m,dith] = parse_inputs(varargin{:});
so = size(RGB);
% Converts depending on what is m:
if isempty(m) % Convert RGB image to an indexed image.
X = reshape(1:(so(1)*so(2)),so(1),so(2));
if so(1)*so(2) <= 256
X = uint8(X-1);
elseif so(1)*so... |
github | KarlYang2013/Text-detection-and-extraction-from-a-natural-image-master | 3.gradient.m | .m | Text-detection-and-extraction-from-a-natural-image-master/Code/3.gradient.m | 1,931 | utf_8 | 30b3b274a6e83864f6616e9a87942ede | function [Gx,Gy,Gtheta,Gmag]=gradient(varargin)
[ED] = parse_inputs(varargin{:});
mask_x=[-1 -2 -1;0 0 0;1 2 1];
mask_y=[-1 0 1;-2 0 2;-1 0 1];
pixel_z=[0 0 0;0 0 0;0 0 0];
resultx=[0 0 0;0 0 0;0 0 0];
resulty=[0 0 0;0 0 0;0 0 0];
[row,column,value]=find(ED... |
github | KarlYang2013/Text-detection-and-extraction-from-a-natural-image-master | 4.swt_cal.m | .m | Text-detection-and-extraction-from-a-natural-image-master/Code/4.swt_cal.m | 7,203 | utf_8 | 1c96aa8efd22c3d491c7acd2d300772a | function [ Val ]= swt_try(varargin)
[Gx,Gy,Gmag,Gtheta,ED]=parse_inputs(varargin{:});
[row,column,value]=find(ED);
[row_size,column_size,channel_value]=size(ED);
row_size
column_size
Len=0;
for i=1:1:row_size
for j=1:1:column_size
Val(i,j)=Inf;
end
... |
github | KarlYang2013/Text-detection-and-extraction-from-a-natural-image-master | 6.adcgrouping.m | .m | Text-detection-and-extraction-from-a-natural-image-master/Code/6.adcgrouping.m | 3,027 | utf_8 | 9b6867d52d6eb376ba7dbedaf3b8752e | function []=adcgrouping(varargin)
% Important key functions/ parameters
% Call regionprops(CC, 'basic') to get the Area, Centroid and BoundBox
% Centroid(1) will have centroid.x
% Centroid(2) will have centroid.y
% BoundBox(3) will have x_width -> width
% BoundBox(4) will have y_width -> height
[ED] = parse_... |
github | KarlYang2013/Text-detection-and-extraction-from-a-natural-image-master | 5.ccformation.m | .m | Text-detection-and-extraction-from-a-natural-image-master/Code/5.ccformation.m | 3,643 | utf_8 | a8b55987197851a6b8ddac8137df7951 | function [ CC ]=ccformation(varargin)
[ED,Val] = parse_inputs(varargin{:});
CC = bwconncomp(ED);
labeled=labelmatrix(CC);
Rgb_label=label2rgb(labeled,@copper,'c','shuffle');
imshow(Rgb_label,'InitialMagnification','fit');
[row_size,column_size,number]=size(ED);... |
github | marclamberti/mooc-machine-learning-master | submit.m | .m | mooc-machine-learning-master/Week-8/mlclass-ex7-008/mlclass-ex7/submit.m | 16,958 | utf_8 | cd11307f72915c0d3b58176b66081197 | function submit(partId, webSubmit)
%SUBMIT Submit your code and output to the ml-class servers
% SUBMIT() will connect to the ml-class server and submit your solution
fprintf('==\n== [ml-class] Submitting Solutions | Programming Exercise %s\n==\n', ...
homework_id());
if ~exist('partId', 'var') || isem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.