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 | ndwork/dworkLib-master | withinPolygon.m | .m | dworkLib-master/withinPolygon.m | 1,901 | utf_8 | eda8885b0cfec2850a7fdc9d5e6830cf |
function status = withinPolygon( polygon, p )
% status = withinPolygon( polygon, p )
% determines if a given number of points is within a polygon
%
% Inputs:
% polygon - 2D array with 2 rows and n columns consisting of polygon
% vertex coordinates
% p - 2D array with 2 rows and n columns of points to... |
github | ndwork/dworkLib-master | proxL2L1.m | .m | dworkLib-master/proxL2L1.m | 987 | utf_8 | 62940357f23966f7435d9ca9a0857d2f |
function out = proxL2L1( in, t, weights )
% out = proxL2L1( in, t [, weights ] )
%
% Returns the proximal operator of f(x) = t * weights .* L2L1( x ), where
% L2L1 is the (possibly weighted) L2,L1 norm.
%
% Inputs:
% in - three dimensional array
% thresh - the thresholding value
%
% Optional Inpu... |
github | ndwork/dworkLib-master | vdSampleMask.m | .m | dworkLib-master/vdSampleMask.m | 2,369 | utf_8 | fd6d705a3de794924622b85ffe6410d6 |
function mask = vdSampleMask( sMask, sigmas, nSamples, varargin )
% mask = vdSampleMask( sMask, sigmas, nSamples [, 'maskType', maskType ] )
%
% Creates a variable density sampling mask according to a seperable distribution
%
% Inputs:
% sMask - the size of the mask (a 1D array corresponding to the number
... |
github | ndwork/dworkLib-master | fitPolyToData2.m | .m | dworkLib-master/fitPolyToData2.m | 1,421 | utf_8 | 1c28d6de012ece32822c07c85c07c058 |
function c = fitPolyToData2( xOrder, yOrder, x, y, z )
% c = fitPolyToData2( xOrder, yOrder, x, y, z ) or
% c = fitPolyToData2( xOrder, yOrder, z )
%
% This function finds a polynomial p so that || z - p(x,y) ||_2 is minimized
%
% Inputs:
% xOrder - the order of the polynomial in x
% yOrder - the order... |
github | ndwork/dworkLib-master | proxSVRG.m | .m | dworkLib-master/proxSVRG.m | 4,592 | utf_8 | 6b101316b93c39b8c7cc84e0551aafbf |
function [ xStar, oValues, relDiffs ] = proxSVRG( x0, stepSize, gGrad, proxth, varargin )
% Implements the accelerated stochastic proximal gradient method with accelerated
% described in "Stochastic Proximal Gradient Descent with Acceleration Techniques"
% by Nitanda
% The gradient has the form of a summation:... |
github | ndwork/dworkLib-master | lsqrFISTA.m | .m | dworkLib-master/lsqrFISTA.m | 2,705 | utf_8 | 3f90d4b02633043de340bfaa0540c822 |
function [out,flag,residual] = lsqrFISTA( A, b, varargin )
%
% Function finds x that minimizes the L2 norm of A*x - b
%
% [out,flag,residual] = lsqrFISTA( A, b [, tolerance, maxIter, x0, t ]);
%
% Inputs:
% A - matrix or function handle
% b - vector
%
% Optional Inputs:
% tolerance - if within th... |
github | ndwork/dworkLib-master | haveXSecsPassed.m | .m | dworkLib-master/haveXSecsPassed.m | 704 | utf_8 | f52e1145bee65123f3a3113b990c76fa |
function xSecsHavePassed = haveXSecsPassed( x )
% Returns 1 if x seconds have passed since the last time this function
% returned 1 and returns 0 otherwise.
% Returns 1 for the first call of the function.
%
% Written by Nicholas Dwork - Copyright 2016
%
% This software is offered under the GNU General ... |
github | ndwork/dworkLib-master | matchingPursuit.m | .m | dworkLib-master/matchingPursuit.m | 1,345 | utf_8 | 28db3195e2e83b40558c3ae8a4696da2 |
function x = matchingPursuit( A, b, K )
% x = matchingPursuit( A, b, K )
%
% Written according to "Matching Pursuit of Images" by Bergeaud and
% Mallat, 1995
% performs matching pursuit optimization that greedily attempts to solve
% minimize (1/2) || A x - b ||_2^2 subject to ||x||_0 <= k
%
% Note that... |
github | ndwork/dworkLib-master | pdhgWLS.m | .m | dworkLib-master/pdhgWLS.m | 4,898 | utf_8 | a47f0c2dafc88ed191acb42d6851d1bf |
function [xStar,objValues] = pdhgWLS( x, proxf, proxgConj, varargin )
% [xStar,objValues] = pdhgWLS( x, proxf, proxgConj [, ...
% 'N', N, 'A', A, 'beta', beta, 'f', f, 'g', g, 'mu', mu, 'tau', tau, ...
% 'theta', theta, 'y', y, 'verbose', verbose ] )
%
% Implements Primal-Dual Hybrid graident method (Cha... |
github | ndwork/dworkLib-master | homographyFromPts2D.m | .m | dworkLib-master/homographyFromPts2D.m | 1,308 | utf_8 | 74df2f9062249001bdafa98b3825f2af |
function H = homographyFromPts2D( pts1, pts2 )
% H = homographyFromPts2D( pts1, pts2 )
%
% Determine the homography that projects pts1 onto pts2 with the Direct
% Linear Transformation.
%
% Inputs:
% pts1 - An Nx2 array where N is the number of points
% pts2 - An Nx2 array where N is the number of po... |
github | ndwork/dworkLib-master | pdhg.m | .m | dworkLib-master/pdhg.m | 5,737 | utf_8 | 37f50afab87330ab389d8775c7e22e4a |
function [xStar,objValues,relDiffs] = pdhg( x, proxf, proxgConj, tau, varargin )
% [xStar,objValues,relDiffs] = pdhg( x, proxf, proxgConj, tau [, ...
% 'A', A, 'f', f, 'g', g, 'N', N, 'normA', normA, 'sigma', sigma, ...
% 'lambda', lambda, 'printEvery', printEvery, 'theta', theta, ...
% 'tol', tol, 've... |
github | ndwork/dworkLib-master | volMatrixProd.m | .m | dworkLib-master/volMatrixProd.m | 1,038 | utf_8 | ba58efef7190fa0c0552df0f3e506657 |
function out = volMatrixProd( vol, A )
% out = volMatrixProd( vol, A )
%
% Inputs:
% vol - 3D array of size NxPxK
% M - 2D array of size MxN
%
% Left matrix multiply A by each slice of vol
%
% Written by Nicholas Dwork - Copyright 2018
%
% This software is offered under the GNU General Public Lic... |
github | ndwork/dworkLib-master | epgMakeR.m | .m | dworkLib-master/epgMakeR.m | 1,330 | utf_8 | 584fea4fc7b139f497363e0bac5059ab |
function out = epgMakeR( alpha, phi )
% out = epgMakeR( alpha, phi )
% The function creates a matrix that multiplies (Mxy,Mxy^*,Mz) to create a left
% handed precession about the axis designated by angle phi.
%
% Inputs:
% alpha is the tip angle (in radians);
% phi is the phase of the axis at which the R... |
github | ndwork/dworkLib-master | trackFeatures3D.m | .m | dworkLib-master/trackFeatures3D.m | 2,888 | utf_8 | d26d4491c23f72d9bf9e4b7e7dd57fff |
function pts2 = trackFeatures3D( pts1, vol1, vol2, varargin )
% pts2 = trackFeatures( pts1, vol1, vol2 [, 'searchWidth', searchWidth, ...
% 'kernelWidth', kernelWidth, 'offset', offset] )
%
% Algorithm tracks points from img1 into img2 using Normalized Cross
% correlation according to "Fast Normalized Cros... |
github | ndwork/dworkLib-master | mri_mapT1InversionRecovery.m | .m | dworkLib-master/mri_mapT1InversionRecovery.m | 3,505 | utf_8 | 9eeb011a29c35146d32e4c6ec8a2fccb |
function [t1Map,t1M0Map] = mri_mapT1InversionRecovery( dataCube, TIs, varargin )
% [t1Map,t1M0Map] = mri_mapT1InversionRecovery( dataCube, TIs, ...
% [, 'mask', mask, 'verbose', verbose ] )
%
% This method is implemented according to equation 6 of "A Robust Methodology
% for In Vivo T1 Mapping" by Barral e... |
github | ndwork/dworkLib-master | fista.m | .m | dworkLib-master/fista.m | 4,237 | utf_8 | e4b1cdaf448f5f28cb2abf987432910b |
function [xStar,objectiveValues,relDiffs] = fista( x, gGrad, proxth, varargin )
% [xStar,objectiveValues,relDiffs] = fista( x, gGrad, proxth [, ...
% 'g', g, 'h', h, 'N', N, 't', t, 'tol', tol, 'verbose', verbose ] )
%
% This function implements the FISTA optimization algorithm
% FISTA finds the x that min... |
github | ndwork/dworkLib-master | makeDVH.m | .m | dworkLib-master/makeDVH.m | 1,356 | utf_8 | 51f1c7ddbe2fe6ea7e2d04a42f762112 |
function [dvh,levels] = makeDVH( data, varargin )
% [dvh,levels] = makeDVH( data [, 'nLevels', nLevels ] )
%
% splits data into equal levels and counts the number of data values
% above each level
%
% Inputs:
% data - array of values
%
% Optional Inputs:
% nLevels - the number of levels
%
% Out... |
github | ndwork/dworkLib-master | gradDescent.m | .m | dworkLib-master/gradDescent.m | 6,225 | utf_8 | aa7a46132814734ef61479c7a81ea2bb |
function [xStar,objectiveValues,relDiffs] = gradDescent( x, gGrad, varargin )
% [xStar,objectiveValues,relDiffs] = gradDescent( x, gGrad [, 'alpha', alpha, 'beta', beta, ...
% 't', t, 'tol', tol, 'useLineSearch', useLineSearch, 'useMomentum', useMomentum, ...
% 'g', g, 'N', N, 'nMaxLineSearchIter', nMaxLineS... |
github | ndwork/dworkLib-master | listTestImages.m | .m | dworkLib-master/listTestImages.m | 1,388 | utf_8 | 223f86c9f028109ed325713e7ea16ad1 |
function testImages = listTestImages( varargin )
% testImages = listTestImages()
%
% List the standard image processing images located in the testImages directory
%
% Outputs:
% testImages - an array of structures for the image files in testImages
%
% Written by Nicholas Dwork - Copyright 2019
%
% ... |
github | ndwork/dworkLib-master | indicatorBound.m | .m | dworkLib-master/indicatorBound.m | 817 | utf_8 | 1fd4523aeafecb13dc679442024fd9ff |
function out = indicatorBound( in, bound )
% out = indicatorBound( in, bound )
%
% Implements the indicator function to verify that all elements are within a bound
% out = indicator( -bound <= in <= bound );
%
% Inputs:
% in - an array of values, real or complex
% bound - a real scalar value specifying... |
github | ndwork/dworkLib-master | normxcorr3.m | .m | dworkLib-master/normxcorr3.m | 2,915 | utf_8 | ca61967f9dda0e5de522135261c2b59d | function C = normxcorr3(T, A, shape)
% C = normxcorr3(TEMPLATE, IMAGE, SHAPE)
%
% TEMPLATE - type double, ndims==3, size <= size of image
% IMAGE - type double, ndims==3
% SHAPE - one of: 'valid', 'same', 'full'. same as conv2 shape parameter
% 'full' by default
%
% ... |
github | ndwork/dworkLib-master | cropData.m | .m | dworkLib-master/cropData.m | 1,874 | utf_8 | 1d6120663815280f2327a9ad6872fe9d |
function out = cropData( data, N )
% out = cropData( data, N )
% Crops out the center region of the data.
% (0,0) is defined according to fftshift
%
% Inputs:
% data - array to be cropped
% N - specified the size of the cropped image
% If N is a scalar, then a cube is extracted
% If N is an array... |
github | ndwork/dworkLib-master | mrs_reconSense.m | .m | dworkLib-master/mrs_reconSense.m | 3,521 | utf_8 | a6314fab4d0b2249911976a9630d7e7d |
function out = mrs_reconSense( kData, sMaps, varargin )
% out = mrs_reconSense( kData, sMaps [, 'kTraj', 'kTraj', 'mu', mu, 'sImg', sImg ] )
%
% Performs model based reconstruction for MR spectroscopy
%
% Inputs:
% kData - array of Fourier values.
% For Cartesian trajectory, it is of size M x N x nCoil... |
github | ndwork/dworkLib-master | rgb2ihs.m | .m | dworkLib-master/rgb2ihs.m | 989 | utf_8 | 5f1cdfcedfa4a18c57dfceab9eff6977 |
function ihs = rgb2ihs( rgb )
% ihs = rgb2ihs( rgb )
% Converts an RGB color image to a Intensity-Hue-Saturation color image
%
% Written by Nicholas Dwork - Copyright 2018
%
% This software is offered under the GNU General Public License 3.0. It
% is offered without any warranty expressed or implied, in... |
github | ndwork/dworkLib-master | fista_wRestart.m | .m | dworkLib-master/fista_wRestart.m | 5,128 | utf_8 | bd501f33075ab6a49f676387640fdf2a |
function [xStar,objectiveValues,relDiffs, restarts] = fista_wRestart( x, gGrad, proxth, q, varargin )
% [xStar,objectiveValues,relDiffs] = fista_wRestart( x, gGrad, proxth [, ...
% 'g', g, 'h', h, 'N', N, 't', t, 'tol', tol, 'verbose', verbose ] )
%
% This function implements the FISTA optimization algorithm... |
github | ndwork/dworkLib-master | checkProx.m | .m | dworkLib-master/checkProx.m | 1,450 | utf_8 | 6ae0e09be485f6f985a0efa9b1cf2805 |
function [ out, err ] = checkProx( x, prox, f, varargin )
% [ out, err ] = checkProx( x, prox, f [, 'nRand', nRand )
%
% u = prox_f(x) iff x - u in subderivative of h at u
% iff f(z) >= f(u) + (x-u)^T (z-u)
%
% Note: if this function fails, then prox is faulty. If it passes, it does... |
github | ndwork/dworkLib-master | evaluatePoly.m | .m | dworkLib-master/evaluatePoly.m | 1,052 | utf_8 | 99940704e2b91e0b295f347a66a08023 |
function [p,dp] = evaluatePoly( c, x )
% [p,dp] = evauatePoly( c, x )
% Evaluates the polynomial defined by the coefficients in c at the
% values of x. This function was written according to section 5.3
% of Numerical Recipes in C
%
% Inputs:
% c - the polynomial coefficients
% p(x) = c(1) + c(2)*x... |
github | ndwork/dworkLib-master | fspecial3d.m | .m | dworkLib-master/fspecial3d.m | 1,248 | utf_8 | befbdd2833e7f03313c0e602374d04ca |
function h = fspecial3d( type, varargin )
% out = fspecial3d( type, parameters )
%
% Creates a 3D filter h of the specified type. The different types are
% listed below.
%
% h = fspecial3d( 'average', hSize )
% hSize can be a 3 element array or a scalar
%
% Written by Nicholas Dwork
switch type... |
github | ndwork/dworkLib-master | samplesFromPMF.m | .m | dworkLib-master/samplesFromPMF.m | 1,113 | utf_8 | 978ad95aa1aa402f6bfbcbe78190a3e6 |
function pmfSamples = samplesFromPMF( pmf, values, varargin )
% pmfSamples = samplesFromPMF( pmf, values [, N ] )
%
% Samples from a specified probability mass function
%
% Inputs:
% values - the image of the random variable (1D array)
% pmf - the corresponding probability mass function
%
% Optional... |
github | ndwork/dworkLib-master | mri_showImg.m | .m | dworkLib-master/mri_showImg.m | 577 | utf_8 | 52a6e2984457b36e62b835c4e5b0764c |
function mri_showImg( varargin )
% mri_showImg( [ file ] )
%
% Inputs:
% file - the P*.7 file to display. If not specified, browser window is
% displayed.
%
% Written by Nicholas Dwork
p = inputParser;
p.addOptional( 'file', [], @(x) true );
p.parse( varargin{:} );
file = p.Results.file;... |
github | ndwork/dworkLib-master | ufft.m | .m | dworkLib-master/ufft.m | 963 | utf_8 | 91b1eee467b5c9558b645c2793632ed9 |
function out = ufft( in, varargin )
% out = ufft( in [, dim ] )
% or
% out = ufft( in [, n, dim ] )
%
% Compute the unitary fft
%
% Written by Nicholas Dwork, Copyright 2019
%
% https://github.com/ndwork/dworkLib.git
%
% This software is offered under the GNU General Public License 3.0. It
%... |
github | ndwork/dworkLib-master | phaseCrossCorrelate.m | .m | dworkLib-master/phaseCrossCorrelate.m | 920 | utf_8 | 656cd2c07970a33f8a0b39638bd8d6ad |
function pcc = phaseCrossCorrelate( img1, img2 )
% pcc = phaseCrossCorrelate( img1, img2 );
% Will output the phase cross correlation of image 1 with image 2 as
% detailed in "An FFT Based Tecnique for Translation, Rotation, and Scale
% Invariant Image Registration"
%
% Inputs:
% img1 - a 2D array repres... |
github | ndwork/dworkLib-master | mri_findMaxT1ContrastAngle.m | .m | dworkLib-master/mri_findMaxT1ContrastAngle.m | 856 | utf_8 | f90be4bb2e727faf944045bf8826958f |
function out = mri_findMaxT1ContrastAngle( T1, TR )
% out = mri_findMaxT1ContrastAngle( T1, TR )
%
% This function calculates the angle that yields maximum contrast
% It is from the paper entitled, "Optimization of Flip Angle for
% T1 Dependent Contrast in MRI"
%
% Inputs:
% T1 and TR must be the same... |
github | ndwork/dworkLib-master | multiScaleSSIM.m | .m | dworkLib-master/multiScaleSSIM.m | 1,972 | utf_8 | e8c383a2c9195272ba2252241c30c9f3 |
function out = multiScaleSSIM( in1, in2, varargin )
% out = multiScaleSSIM( in1, in2 [, 'k1', k1, 'k2', k2, 'L', L, 'N', N ] )
%
% Computes the multi-scale structural similarity metric between inputs 1 and 2 according
% to "multi-scale structural similarity for image quality assessment" by Wang et al.
%
% ... |
github | ndwork/dworkLib-master | mrs_reconRefPeak.m | .m | dworkLib-master/mrs_reconRefPeak.m | 2,771 | utf_8 | 37f785cddd8fc2f9d90d481eb12b2a6d |
function [ recon, sMaps ] = mrs_reconRefPeak( kData, varargin )
% [ recon, sMaps ] = mrs_reconRefPeak( kData [, 'kTraj', kTraj, 'sImg', sImg ] )
%
% Performs the peak reference reconstruction described in "Methodology for
% improved detection of low concentration metabolites in MRS: optimised
% combination ... |
github | ndwork/dworkLib-master | removeRicianMean.m | .m | dworkLib-master/removeRicianMean.m | 1,236 | utf_8 | 947382cdc81b873904e56cf23ff7cb0a |
function out = removeRicianMean( data, noise )
% out = removeRicianMean( data, noise )
%
% Removes the mean of the Rician noise according to "The Rician Distribution of
% Noisy MRI Data" by Gudbjartsson and Patz.
%
% Inputs:
% data - a real array of data with Rician noise
% noise - either a complex arr... |
github | ndwork/dworkLib-master | admm.m | .m | dworkLib-master/admm.m | 2,167 | utf_8 | ebd0b04d81ac3325f8e4ad8290e4e5a0 |
function [xStar,objValues] = admm( x, proxf, proxg, t, varargin )
% [xStar,objValues] = admm( x, proxf, proxg, 'A', A, 'f', f, 'g', g )
%
% minimizes f( x ) + g( A x )
%
% Optional Inputs:
% A - if A is not provided, it is assumed to be the identity
% f - to determine the objective values, f must be prov... |
github | ndwork/dworkLib-master | projV1ontoV2.m | .m | dworkLib-master/projV1ontoV2.m | 648 | utf_8 | 722804a80e4d362bd6d8284d81ebf11a |
function out = projV1ontoV2( v1, v2 )
% out = projectV1ontoV2( v1, v2 )
% Projects vector v1 onto v2
%
% Inputs:
% v1,v2 - vectors (1D arrays) of the same size
%
% Outputs:
% out - a vector the size of v1
%
% Written by Nicholas Dwork - Copyright 2018
%
% This software is offered under the GNU ... |
github | ndwork/dworkLib-master | numericalDiff.m | .m | dworkLib-master/numericalDiff.m | 1,174 | utf_8 | 531f444f5d86b879805127cb881d774c |
function out = numericalDiff( g, x, varargin )
% out = numericalDiff( g, x [, 'dx', dx ] );
%
% Numerically estimates the gradient of function g
%
% Inputs:
% g - function handle that accepts a variable with number of elements of x
% x - the input where the derivative is to be estimated
%
% Outputs:
... |
github | ndwork/dworkLib-master | opticalFlow2D.m | .m | dworkLib-master/opticalFlow2D.m | 8,532 | utf_8 | 5bb7ae356b36b85bd0b1ef100b315b9d |
function [du,dv] = opticalFlow2D( img1, img2, varargin )
% [du,dv] = opticalFlow2D( img1, img2 [, eta] )
%
% Computes the Horn Schunk optical flow vectors between images 1 and 2
%
% Inputs:
% img1/img2 - 2D arrays
%
% Optional Inputs:
% eta - smoothing parameter
%
% Outputs:
% du - a 2D array r... |
github | ndwork/dworkLib-master | semilogynice.m | .m | dworkLib-master/semilogynice.m | 706 | utf_8 | ca375d9d2e929eb717107b1e09b33061 |
function semilogynice( in1, varargin )
% semilogynice( in1 [, in2, 'ax', ax, options ] )
%
% Inputs:
% in1 - 1D array to plot
% in2 - if in2 is supplied, in1 are the domain values and in2 are the
% range values
%
% Optional Inputs:
% ax - the axis to plot onto (used with subplot)
% opti... |
github | ndwork/dworkLib-master | findAndTrackCorners.m | .m | dworkLib-master/findAndTrackCorners.m | 2,628 | utf_8 | dc0ff651cbc9d52f67c6d7330ae34635 |
function [pts1,pts2] = findAndTrackCorners( img1, img2, varargin )
% [pts1,pts2] = findAndTrackCorners( img1, img2 ...
% [, 'N', N, 'buffer', buffer, 'featureWidth', featureWidth, 'w', w, 'k', k, ...
% 'searchWidth', searchWidth, 'offset', offset ] )
%
% Inputs:
% img1/img2 - 2D arrays; find features i... |
github | ndwork/dworkLib-master | hom2Euc.m | .m | dworkLib-master/hom2Euc.m | 532 | utf_8 | 3296b730d3bf4c04d722065c3a33ba52 |
function euc = hom2Euc( hom )
% euc = hom2Euc( hom )
% Convert homogeneous coordinates to Euclidean coordinates
%
% Inputs:
% hom - 2D array of size (N+1)xM where N is the number of dimensions
% representing the homogeneous coordinates of a set of points,
% and M is the number of points.
%
% Outp... |
github | ndwork/dworkLib-master | countNumLinesInFile.m | .m | dworkLib-master/countNumLinesInFile.m | 611 | utf_8 | b2cbf7d38b41a345fbf04c32e77a35c3 |
function nLines = countNumLinesInFile( file )
% nLines = countNumLinesInFile( file );
%
% Inputs:
% file - string with filename
%
% Outputs:
% nLines - the number of lines in the file
%
% Written by Nicholas Dwork - Copyright 2017
%
% This software is offered under the GNU General Public License ... |
github | ndwork/dworkLib-master | nums2cellStrs.m | .m | dworkLib-master/nums2cellStrs.m | 627 | utf_8 | 0da9c905bcc28887a17978ad9c1fb429 |
function cellStrs = nums2cellStrs( numArray )
% cellStrs = nums2cellStrs( numArray )
%
% Converts an array of numeric values to a cell array of strings
%
% Written by Nicholas - Copyright 2018
%
% This software is offered under the GNU General Public License 3.0. It
% is offered without any warranty e... |
github | ndwork/dworkLib-master | isnonnegative.m | .m | dworkLib-master/isnonnegative.m | 568 | utf_8 | 1ea60741b62fd767d48a387d1a542ef8 |
function out = isnonnegative( x )
% out = isnonnegative( x )
%
% Inputs:
% x - a scalar or array
%
% Output:
% true if all elements of x are non-negative and false otherwise
%
% Written by Nicholas Dwork - Copyright 2019
%
% https://github.com/ndwork/dworkLib.git
%
% This software is offered ... |
github | ndwork/dworkLib-master | sinc.m | .m | dworkLib-master/sinc.m | 708 | utf_8 | 9c21f4278740ce9c0da9a42624541b5f |
function out = sinc( in )
% out = sinc( in )
%
% Computes the cardinal sine of all elements of the input
%
% Inputs:
% in - an array (of any number of dimensions) of scalar values
%
% Outputs:
% out - an array of size equal to in with the results of since applied to
% each element
%
% Wri... |
github | ndwork/dworkLib-master | makeMatrixForLinearTrans.m | .m | dworkLib-master/makeMatrixForLinearTrans.m | 1,269 | utf_8 | e7ca69e8ccb753dcd8391b214ed0640d |
function A = makeMatrixForLinearTrans( x, trans, varargin )
% A = makeMatrixForLinearTrans( x, trans [, parallel ] )
%
% Inputs:
% x - an input for the transformation (has the right size; values don't
% matter )
% trans - a function handle for the transformation
%
% Optional Inputs:
% parallel - ... |
github | ndwork/dworkLib-master | grid_2D.m | .m | dworkLib-master/grid_2D.m | 2,391 | utf_8 | a65b6a4efb6c515b751da875a7f9eb5e |
function recon = grid_2D( F, kTraj, N, varargin )
% recon = grid_2D( F, kTraj, N, [ weights, 'alpha', alpha, 'W', W, 'nC', nC ] )
%
% The gridding non-uniform FFT algorithm based on EE369C notes by John Pauly
% and Beatty et. al., IEEE TMI, 2005. Definitions and details according to
% http://nicholasdwork.c... |
github | ndwork/dworkLib-master | dotP.m | .m | dworkLib-master/dotP.m | 643 | utf_8 | 270fa6cc7d91741331ea4d22db5579f0 |
function out = dotP( a, b )
% out = dotP( a, b );
% Computes the dot product between two vectors a and b.
% a . b = sum( a .* conj(b) )
%
% Written by Nicholas Dwork
%
% https://github.com/ndwork/dworkLib.git
%
% This software is offered under the GNU General Public License 3.0. It
% is offered wi... |
github | ndwork/dworkLib-master | volVectorOp.m | .m | dworkLib-master/volVectorOp.m | 1,407 | utf_8 | a30e7e9c479e3d50d5b7c3e266ac0b7f |
function out = volVectorOp( volume, vector, varargin )
% This function performs a volume-vector operation
%
% out = volVectorOp( volume, vector [, dim, 'op', op ] )
%
% Inputs:
% volume - an array
% vector - a 1D array with number of elements equal to dimension of
% vector product
%
% Optional I... |
github | ndwork/dworkLib-master | diChromInterp.m | .m | dworkLib-master/diChromInterp.m | 7,089 | utf_8 | 04bd18596adb2a9962ae9d1d9f8698ba |
function out = diChromInterp( highResImg, lowResImg, sigma, varargin )
% out = diChromInterp( highResImg, lowResImg, sigma [ 'contrasts', true/false, ...
% 'lambda', labmda, 'N', N, 'optAlg', optAlg, 'showScale', showScale, ...
% 'verbose', verbose ] )
%
% This algorithm was published as "Di-chromatic In... |
github | ndwork/dworkLib-master | douglasRachford.m | .m | dworkLib-master/douglasRachford.m | 1,568 | utf_8 | 84f3ba6caae383dcb15ee3f42b005092 |
function out = douglasRachford( x0, proxf, proxg, t, varargin )
% out = douglasRachford( x0, proxf, proxg, t [,
% 'N', N, 'rho', rho, 'verbose', verbose ] )
%
% minimizes f( x ) + g( x )
%
% Inputs:
% x0 - an array specifying the initial input
% proxf - a function handle to the proximal operator of ... |
github | ndwork/dworkLib-master | mri_mapOffRes.m | .m | dworkLib-master/mri_mapOffRes.m | 1,706 | utf_8 | 7f700e9bc060f3d7de804a0645da579d |
function [ offResMap, phaseOffsetMap ] = mri_mapOffRes( dataCube, TEs, varargin )
% [ offResMap, phaseOffsetMap ] = mri_mapOffRes( dataCube, TEs [, 'mask', mask ] )
%
% Inputs:
% dataCube - an MxNxK array of data where each k index represents an
% image captured at a different echo time.
% TEs - a 1D arr... |
github | ndwork/dworkLib-master | mri_makeTrajPts.m | .m | dworkLib-master/mri_makeTrajPts.m | 5,236 | utf_8 | f93198bbc3dae95a573e3b27b67b1a4c |
function traj = mri_makeTrajPts( nDim, type, varargin )
% traj = makeTrajPts( nDim, type, parameters );
%
% traj is an N x nDim array, where N is the number of trajectory points
%
% Inputs:
% nDim - the number of dimensions
% type - the type of trajectory to create
% 'poissonDisc' - poisson disc... |
github | ndwork/dworkLib-master | updateScaleShifts.m | .m | dworkLib-master/updateScaleShifts.m | 4,461 | utf_8 | b42b613fd824eda8d3a53ab9b48b6661 |
function newParams = updateScaleShifts( g, gPrime, xs, ys, beta, alpha, ...
domainShift, stepSize, varargin )
% newParams = updateScaleShiftParams( ...
% g, gPrime, xs, ys, beta, alpha, gamma, stepSize [, 'objective', objective, ...
% 'Lb', Lb, 'Ub', Ub, 'findBeta', findBeta, 'findAlpha', findAlpha, ...
... |
github | ndwork/dworkLib-master | findValueBelowFraction.m | .m | dworkLib-master/findValueBelowFraction.m | 1,169 | utf_8 | 9709e35dee8538abca475c6d501e5aab |
function value = findValueBelowFraction( data, fraction, varargin )
% value = findValueBelowFraction( data, fraction [, 'tol', tol ] )
%
% This function finds the value where fraction amount of the data is
% above this value.
% For example, if fraction is 0.35, then this function finds the value
% where ap... |
github | ndwork/dworkLib-master | padData.m | .m | dworkLib-master/padData.m | 3,063 | utf_8 | 8b339c73ed4dd895bb49be05307e6b6f |
function padded = padData( data, N, varargin )
% padded = padData( data, N [, padValue ] )
%
% Inputs:
% data - an array to be padded
% N - specifies the final size of the padded data (either a scalar, indicating
% the same size for all dimensions, or an array indicating size of each dimension)
%
%... |
github | ndwork/dworkLib-master | mri_reconJSENSE.m | .m | dworkLib-master/mri_reconJSENSE.m | 5,206 | utf_8 | ab15b17c9977eb05cf97bc2e9af06199 |
function [ img, sMaps ] = mri_reconJSENSE( kData, varargin )
%
% Inputs:
% kData - a two dimensional array of complex values; uncollected data have values of 0
% Its size is [ nKy nKx nCoils ].
%
% Optional Inputs:
% maxIter - a scalar reprenting the maximum number of iterations
% polyOrder - e... |
github | ndwork/dworkLib-master | findRotAndTransFromPts.m | .m | dworkLib-master/findRotAndTransFromPts.m | 850 | utf_8 | 48278e2d346f6164f7ca4ec184d30e8d |
function [R,t] = findRotAndTransFromPts( pts1, pts2 )
% [R,t] = findRotAndTrans( pts1, pts2 )
% This function finds the rotation matrix R and the translation matrix t
% such that pt2 = R * pt1 + t;
% It implements the Kabsch algorithm
% https://en.wikipedia.org/wiki/Kabsch_algorithm
%
% Inputs:
% pts... |
github | ndwork/dworkLib-master | showImageCube.m | .m | dworkLib-master/showImageCube.m | 4,367 | utf_8 | 4b451fb6c07366c7ee58dd031ea7f073 |
function imH = showImageCube( cube, varargin )
% imH = showImageCube( cube [, scale, 'border', border, 'borderValue', borderValue, ...
% 'nImgsPerRow', nImgsPerRow, 'range', range, 'sdevScale', sdevScale ] )
%
% Given an MxNxK array, shows each slice as a separate image on a single
% figure.
%
% Inputs... |
github | ndwork/dworkLib-master | ctRadon.m | .m | dworkLib-master/ctRadon.m | 1,848 | utf_8 | d20877096dea276ce685a0710947010c |
function sinogram = ctRadon( img, delta, nDetectors, dSize, thetas )
% sinogram = ctRadon( img, delta, nDetectors, dSize, thetas )
%
% computes the Radon transform using the physical units of an computed
% tomography detector
%
% Inputs:
% img: 2D array - will take the Radon transform of this im... |
github | ndwork/dworkLib-master | circCrossCorrelate.m | .m | dworkLib-master/circCrossCorrelate.m | 1,424 | utf_8 | 47de5bb16dc30c48f237c450244c353c |
function out = circCrossCorrelate( inArray, kernel )
% out = out = circCrossCorrelate( inArray, kernel )
%
% Calculates the circular cross correlation of inArray with kernel.
% The origin of inArray is the first element.
% The origin of kernel is the center element.
%
% Inputs:
% inArray - an N dim... |
github | ndwork/dworkLib-master | findRotBetween3dVecs.m | .m | dworkLib-master/findRotBetween3dVecs.m | 798 | utf_8 | 34101403cb0ee8be25a23815790b6ca6 |
function R = findRotBetween3dVecs( v1, v2 )
% R = findRotBetweenVecs( v1, v2 )
%
% Inputs:
% v1 - a 3 element array representing first vector
% v2 - a 3 element array representing second vector
%
% Outputs:
% R - a 3x3 array representing the rotation matrix
%
% Written by Nicholas Dwork - Copyright... |
github | ndwork/dworkLib-master | fista_wAdaptiveRestartFunction.m | .m | dworkLib-master/fista_wAdaptiveRestartFunction.m | 4,815 | utf_8 | 87863ba1f151ceebab216df4abd855b8 |
function [xStar, objectiveValues, relDiffs, restarts] = fista_wAdaptiveRestartFunction( ...
x, gGrad, proxth, g, h, varargin )
% [xStar,objectiveValues,relDiffs] = fista_wAdaptiveRestartFunction( x, gGrad, proxth, g, h [, ...
% 'N', N, 't', t, 'tol', tol, 'verbose', verbose ] )
%
% This function implements... |
github | ndwork/dworkLib-master | img2Polar.m | .m | dworkLib-master/img2Polar.m | 2,693 | utf_8 | 83b4428ba53cbaaac23a98ba42550067 |
function [outImg,rs,thetas] = img2Polar( img, varargin )
% [outImg,rs,thetas] = img2Polar( img, [ 'dr', dr, 'dTheta', dTheta, ...
% 'rs', rs, 'thetas', thetas, 'method', method, 'extrapval', extrapval ] )
%
% Inputs:
% img - a 2D array
%
% Optional Inputs:
% dr - the difference between adjacent radi... |
github | ndwork/dworkLib-master | mri_computeSensitivityBiotSavart.m | .m | dworkLib-master/mri_computeSensitivityBiotSavart.m | 2,578 | utf_8 | 0190ee48b81f5282ec05f7b98895c0e2 |
function sensitivities = mri_computeSensitivityBiotSavart( segs, locs )
% sensitivities = mri_computeSensitivityBiotSavart( segs, locs )
%
% computes the sensitivity for each coil at all locations in locs
% This code uses the technique described in "MRI image enhancement using
% Biot-Savart law at 3 Tesla" ... |
github | ndwork/dworkLib-master | softThresh.m | .m | dworkLib-master/softThresh.m | 1,123 | utf_8 | 179e90a66f3c2f415f61bfec7e718191 |
function out = softThresh( in, thresh )
% out = softThresh( in, thresh )
%
% Applies the proximal operator of the L1 norm (proxL1)
%
% Note that this functionality for real inputs is implemented by Matlab
% with the wthresh function, but it is part of the Wavelet Toolbox. If
% you don't have that toolbo... |
github | ndwork/dworkLib-master | findDoGFeatures3D.m | .m | dworkLib-master/findDoGFeatures3D.m | 1,451 | utf_8 | a9d353961caa42ea5e6bd0c8d7bf19c0 |
function features = findDoGFeatures3D( vol, varargin )
% features = findDifferenceOfGaussianFeatures3D( vol, ...
% [ 'nFeatures', nFeatures, 'buffer', buffer ] )
% nFeatures is the desired number of features. May return fewer than
% nFeatures if image is to small.
% buffer is the minimum distance two fe... |
github | ndwork/dworkLib-master | iGridT.m | .m | dworkLib-master/iGridT.m | 1,702 | utf_8 | de948c6ee50188e9915fb835bc525619 |
function out = iGridT( k, traj, N, varargin )
% out = iGridT( k, traj, N, [ 'alpha', alpha, 'w', w, 'nC', nC ] )
%
% Gridding (without density correction) is the adjoint of MRI encoding
% (often called inverse gridding). This function applies the transpose
% of inverse gridding to the input data.
% Detai... |
github | SFINA/SFINA-master | branchstatus.m | .m | SFINA-master/matlab/dynamic_simulation_engine/branchstatus.m | 2,358 | utf_8 | ac3df2fd220c23d5c147750dd3cecd14 |
function T = branchstatus(mpc,ccr,reference)
define_constants;
%gives the indices of branches
%mpc=loadcase('case57.m');
k=[1:1:numel(mpc.branch(:,1))]
ref_idx=k;
%reference indices for to and from
ref_a=[];
ref_b=[];
for j=1:length(k)
ref_a=[ref_a;mpc.branch(k(j),1)];
ref_b=[ref_b;mpc.branch(k(j),2)];
end... |
github | SFINA/SFINA-master | branchstatus_voltage.m | .m | SFINA-master/matlab/dynamic_simulation_engine/branchstatus_voltage.m | 2,873 | utf_8 | be848791d31daf688298bff1200bcde8 |
function T = branchstatus_voltage(mpc,ccr,voltage_ref_max,voltage_ref_min)
define_constants;
%gives the indices of branches
%mpc=loadcase('case57.m');
k=[1:1:numel(mpc.branch(:,1))];
%n_bus = numel(mpc.bus(:,1));
ref_idx=k;
%reference indices for to and from
ref_a=[];
ref_b=[];
for j=1:length(k)
ref_a=[ref_a;mp... |
github | SFINA/SFINA-master | branchstatus_power.m | .m | SFINA-master/matlab/dynamic_simulation_engine/branchstatus_power.m | 2,136 | utf_8 | e9451e8540d50f33eec30a80b79f1baf |
function T = branchstatus_power(mpc,ccr,reference)
define_constants;
%gives the indices of branches
%mpc=loadcase('case57.m');
k=[1:1:numel(mpc.branch(:,1))]
ref_idx=k;
%reference indices for to and from
ref_a=[];
ref_b=[];
for j=1:length(k)
ref_a=[ref_a;mpc.branch(k(j),1)];
ref_b=[ref_b;mpc.branch(k(j),2)]... |
github | SFINA/SFINA-master | branchstatus.m | .m | SFINA-master/matlab/static_simulation_engine/branchstatus.m | 2,358 | utf_8 | ac3df2fd220c23d5c147750dd3cecd14 |
function T = branchstatus(mpc,ccr,reference)
define_constants;
%gives the indices of branches
%mpc=loadcase('case57.m');
k=[1:1:numel(mpc.branch(:,1))]
ref_idx=k;
%reference indices for to and from
ref_a=[];
ref_b=[];
for j=1:length(k)
ref_a=[ref_a;mpc.branch(k(j),1)];
ref_b=[ref_b;mpc.branch(k(j),2)];
end... |
github | SFINA/SFINA-master | branchstatus_voltage.m | .m | SFINA-master/matlab/static_simulation_engine/branchstatus_voltage.m | 2,873 | utf_8 | be848791d31daf688298bff1200bcde8 |
function T = branchstatus_voltage(mpc,ccr,voltage_ref_max,voltage_ref_min)
define_constants;
%gives the indices of branches
%mpc=loadcase('case57.m');
k=[1:1:numel(mpc.branch(:,1))];
%n_bus = numel(mpc.bus(:,1));
ref_idx=k;
%reference indices for to and from
ref_a=[];
ref_b=[];
for j=1:length(k)
ref_a=[ref_a;mp... |
github | SFINA/SFINA-master | branchstatus_power.m | .m | SFINA-master/matlab/static_simulation_engine/branchstatus_power.m | 2,136 | utf_8 | e9451e8540d50f33eec30a80b79f1baf |
function T = branchstatus_power(mpc,ccr,reference)
define_constants;
%gives the indices of branches
%mpc=loadcase('case57.m');
k=[1:1:numel(mpc.branch(:,1))]
ref_idx=k;
%reference indices for to and from
ref_a=[];
ref_b=[];
for j=1:length(k)
ref_a=[ref_a;mpc.branch(k(j),1)];
ref_b=[ref_b;mpc.branch(k(j),2)]... |
github | xiumingzhang/grabcut-master | compute_pairwise.m | .m | grabcut-master/compute_pairwise.m | 2,981 | utf_8 | 98be17f0c5992a063b6ae5e54d370089 | function pairwise = compute_pairwise(im_sub, gamma)
%COMOUTE_PAIRWISE Part of GrabCut. Compute the pairwise terms.
%
% Inputs:
% - im_sub: 2D subimage, on which Graph Cut is performed
% - gamma: gamma parameter
%
% Output:
% - pairwise: a dense no_edgesx6 matrix of doubles. Each row is of the
%format [i, j, e00, ... |
github | Mericam/document-scanner-master | rectifyDocument.m | .m | document-scanner-master/rectifyDocument.m | 6,031 | utf_8 | ec4f0e0f58a331ee461cff87bac3f128 | %{
Copyright (c) 2015, Tom Mertens, tom.mertens@gmail.com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditio... |
github | caxenie/artemic-master | pose_generator.m | .m | artemic-master/final_SLAM_code/pose_generator.m | 187 | utf_8 | 70a8733ce51c2a3c768ec4f32d62a002 | %%
% Aplicatie SLAM offline pt ARTEMIC
%
% Functie care returneaza pozitiile posibile
%%
function poses = pose_generator(~)
poses = [0 0;-1 -1;1 1;1 -1;-1 1;0 -1;0 1;-1 0;1 0];
return
end |
github | caxenie/artemic-master | save_map.m | .m | artemic-master/final_SLAM_code/save_map.m | 488 | utf_8 | ed1fa9870da0c95113a7ba38b9205f98 | %%
% Aplicatie SLAM offline pt ARTEMIC (pentru demo algoritm)
%
% Functie care salveaza harta (de fapt valorile pentru construirea hartii)
%%
function save_map(r,num_readings)
for(i=1:num_readings)
% secventierea citirilor
pause(0.250);
% informatia de pozitie
saved_pose(i,:) = posit... |
github | caxenie/artemic-master | bayes_fusion.m | .m | artemic-master/final_SLAM_code/bayes_fusion.m | 536 | utf_8 | 0baaa686b248ed2944adfb4f7dc1ea4d | %%
% Aplicatie SLAM offline pt ARTEMIC
%
% Functia de fuziune a senzorilor utilizand regula lui Bayes
%%
function world = bayes_fusion(world, model, offset)
prev = world(offset(1)+1:offset(1)+length(model),...
offset(2)+1:offset(2)+length(model));
idx = find(~isnan(model));
new = prev;
... |
github | caxenie/artemic-master | compute_score.m | .m | artemic-master/final_SLAM_code/compute_score.m | 490 | utf_8 | 7b40c497de420d75e9fa40bcd7151820 | %%
% Aplicatie SLAM offline pt ARTEMIC
%
% Functia de estimare a potrivirii hartii pe termen scurt cu harta pe
% termen lung; scorul reda o dimensionare a rezultatului comparatiei
%%
function score = compute_score(world, model, offset)
world = world(offset(1)+1:offset(1)+length(model),...
offset(2... |
github | caxenie/artemic-master | save_readings.m | .m | artemic-master/final_SLAM_code/save_readings.m | 611 | utf_8 | 80655cdb7a9c52521da2dd2be8b47e4e | %%
% Aplicatie SLAM offline pt ARTEMIC (pentru demo algoritm)
%
% Functie de salvare a valorilor citite de la sonare
%%
function save_readings(r)
% initializare robot pentru testare algoritm
robotInitSim(r)
% operare asincrona a robotului
runAsync(r)
try
% algoritm de explorare aleatorie a mediului
wander(r,30... |
github | caxenie/artemic-master | sonar_model.m | .m | artemic-master/final_SLAM_code/sonar_model.m | 3,147 | utf_8 | c6711b7ecfa59cc6e541a08f2f98b58f | %%
% Aplicatie SLAM offline pt ARTEMIC
%
% Functie care implementeaza modelul sonarelor
%%
function model = sonar_model(sonars_readings, heading)
% jumatate din unghiul de deschidere a conului
beta = 7;
% range maxim sonar
range = 26;
% scare de reprezentare a hartii
scale = 35;
% toleranta... |
github | caxenie/artemic-master | get_dependency.m | .m | artemic-master/robot_app_with_SLAM_interface/c++/data-sets/get_dependency.m | 323 | utf_8 | e4940a845f6a686b60cd900449ea8c86 | % pentru extragerea caracteristicii liniarizate pe portiuni
function get_dependency(omega_vector,pwm_vector)
syms U w real;
len = length(omega_vector);
for i = 2:len
U = pwm_vector(i-1)+((w-omega_vector(i-1))/(omega_vector(i)-omega_vector(i-1)))*(pwm_vector(i)-pwm_vector(i-1));
i
Upwm = vpa(U)
end;
... |
github | SergioRAgostinho/five_point_algorithm-master | five_point_algorithm.m | .m | five_point_algorithm-master/five_point_algorithm.m | 18,503 | utf_8 | fe2b7a2689a24d93e0630def262df03c | function [E_all, R_all, t_all, Eo_all] = five_point_algorithm( pts1, pts2, K1, K2 )
%FIVE_POINT_ALGORITHM Given five points matches between two images, and the
% intrinsic parameters of each camera. Estimate the essential matrix E, the
% rotation matrix R and translation vector t, between both images. This
% algorith... |
github | firemodels/cfast-master | addverstr.m | .m | cfast-master/Utilities/Matlab/scripts/addverstr.m | 1,563 | utf_8 | 3dd8a165b47f780d168c9e40465fc80c | % McDermott
% 6-23-2015
% addverstr.m
function []=addverstr(ha,fn,pt,varargin)
Font_Name = 'Times';
Font_Interpreter = 'TeX';
if length(varargin)==0
VerStr_Scale_X = 0.65;
VerStr_Scale_Y = 1.05;
else
VerStr_Scale_X = varargin{1};
VerStr_Scale_Y = varargin{2};
end
if exist(fn,'file')
VerStr = imp... |
github | firemodels/cfast-master | stripcell.m | .m | cfast-master/Utilities/Matlab/scripts/stripcell.m | 236 | utf_8 | 559840f621a84353189547e00f255492 | % McDermott
% 6-11-2009
% stripcell.m
%
% Stip cell array of empty cells
function [C] = stripcell(CELL_ARRAY)
i = 1;
for j=1:length(CELL_ARRAY)
if iscellstr(CELL_ARRAY(j))
C(i) = CELL_ARRAY(j);
i = i+1;
end
end |
github | firemodels/cfast-master | parseplus.m | .m | cfast-master/Utilities/Matlab/scripts/parseplus.m | 285 | utf_8 | a44845d38f8a54b894b4c7b75baedabf | % McDermott
% 12-30-2015
% parseplus.m
%
% [S] = parseplus(character_string)
%
% Uses textscan to parse a character string that is delimited with a "+".
function [S] = parseplus(character_string)
cell_array = textscan(char(character_string),'%s','delimiter','+');
S = cell_array{:}'; |
github | firemodels/cfast-master | parsepipe.m | .m | cfast-master/Utilities/Matlab/scripts/parsepipe.m | 278 | utf_8 | e75adaeaee09e1eba23691d0ff208575 | % McDermott
% 6-08-2009
% parsepipe.m
%
% [S] = parsepipe(character_string)
%
% Uses textscan to parse a character string that is delimited with a "|".
function [S] = parsepipe(character_string)
cell_array = textscan(character_string,'%s','delimiter','|');
S = cell_array{:}'; |
github | firemodels/cfast-master | scatplot.m | .m | cfast-master/Utilities/Matlab/scripts/scatplot.m | 16,498 | utf_8 | 08b919a74169d1961f58fda820dc1b5d | % R. McDermott
% 7-06-2009
% scatplot.m
%
% Generate scatter plots. Must first run dataplot.m to generate
% saved_data and drange.
%
% [] = scatplot(saved_data, drange, Scatterplot_Inputs_File, Manuals_Dir)
%
% Arguments:
% saved_data - cell array of packed data, may be obtained by running
% the dataplot.m funct... |
github | firemodels/cfast-master | dvcread.m | .m | cfast-master/Utilities/Matlab/scripts/dvcread.m | 1,478 | utf_8 | 71e149110b17e506f0d9d2c8c3930ff0 | % McDermott
% 6-02-2009
% dvcread.m
%
% function [H X] = dvcread(filename,header_row,data_row)
%
% header_row = row where header names are stored; names converted to H
% vector.
%
% data_row = row where numeric data starts
%
% X = matrix of numeric data; columns correspond to entries in H.
%
% Read a _devc.csv file for... |
github | firemodels/cfast-master | justplot.m | .m | cfast-master/Utilities/Matlab/scripts/justplot.m | 15,695 | utf_8 | 129544b0a009a3787e55da5ac22bdf22 | % R. McDermott and C. Cruz and S. Hostikka, modified by R. Peacock for just
% plotting graphs without any statistics
% 6-11-2014
% justplot.m
%
% [saved_data, drange] = dataplot(Dataplot_Inputs_File, Working_Dir, Manuals_Dir, [drange])
%
% Output:
% saved_data - cell array containing data needed in scatplot.m
%
% ... |
github | firemodels/cfast-master | dataplot.m | .m | cfast-master/Utilities/Matlab/scripts/dataplot.m | 23,857 | utf_8 | 641431c337e91c2a3769ca125fc55cca | % R. McDermott and C. Cruz and S. Hostikka
% 6-06-2012
% dataplot.m
%
% [saved_data, drange] = dataplot(Dataplot_Inputs_File, EXP_Dir, OUT_Dir, Manuals_Dir, [drange])
%
% Output:
%
% saved_data - cell array containing data needed in scatplot.m
%
% drange - data range needed for scatplot.m, must be commensurate wi... |
github | firemodels/cfast-master | parse.m | .m | cfast-master/Utilities/Matlab/scripts/parse.m | 266 | utf_8 | cc0f9193fb2517584f78c7c1a0878953 | % McDermott
% 6-08-2009
% parse.m
%
% [S] = parse(character_string)
%
% Uses textscan to parse a character string that is delimited with a "|".
function [S] = parse(character_string)
cell_array = textscan(character_string,'%s','delimiter','|');
S = cell_array{:}'; |
github | UCBASiCS/FFAST-master | parse_output.m | .m | FFAST-master/MATLAB/parse_output.m | 730 | utf_8 | 6245c018a4b52d6cbc4003a6403c1343 | % parse output file
function signal = parse_output()
fid = fopen('ffastOutput.txt', 'r');
signal = [];
tline = fgets(fid);
while ischar(tline)
p1 = find(tline == ':');
binIdx = str2double(tline(1:p1-1));
tline = tline(p1+2:end-2);
p1 = find(tline == ',');
rpart = str2double(tline(1:p1-1));
ipart... |
github | ParticulateFlow/LIGGGHTS-PUBLIC-master | lmp2cfg.m | .m | LIGGGHTS-PUBLIC-master/tools/matlab/lmp2cfg.m | 8,711 | utf_8 | 343f9a061b25b2adf8f299708590a3f9 | function lmp2cfg(varargin)
% Converts LAMMPS dump file to Extended CFG Format (No velocity) to be used
% with AtomEye (http://164.107.79.177/Archive/Graphics/A/)
% Input :
% Necessary (in order)
% timestep,Natoms,x_bound,y_bound,z_bound,H,atom_data,mass,
% cfg file name, dumpfile name
% Optional
% ... |
github | yuhan210/video-indexing-master | voc_eval.m | .m | video-indexing-master/fast-rcnn/lib/datasets/VOCdevkit-matlab-wrapper/voc_eval.m | 1,389 | utf_8 | fd77d0da53b2585aa65e0da5edc5fe33 | function res = voc_eval(path, comp_id, test_set, output_dir, rm_res)
VOCopts = get_voc_opts(path);
VOCopts.testset = test_set;
for i = 1:length(VOCopts.classes)
cls = VOCopts.classes{i};
res(i) = voc_eval_cls(cls, VOCopts, comp_id, output_dir, rm_res);
end
fprintf('\n~~~~~~~~~~~~~~~~~~~~\n');
fprintf('Results:\n... |
github | VlagaPalych/Stable-master | RotToQuat.m | .m | Stable-master/Libs/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 | VlagaPalych/Stable-master | NormQuat.m | .m | Stable-master/Libs/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;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.