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 | microsoft/ADBench-master | admComputeDerivFor2.m | .m | ADBench-master/submodules/adimat-0.6.2-5288/arrderivclassdef/admComputeDerivFor2.m | 1,872 | utf_8 | bd61363a24880665a296a31c7be64199 | % function [Hessian, Jacobian, varargout] = ...
% admComputeDerivFor2(diffFunction, seedV, seedW, ...
% independents, dependents, fNargout, varargin)
%
% Compute derivatives in second order FM with RE opt_derivclass or
% opt_sp_derivclass.
%
% see also admDiffFor2, admOptions, adimat_derivc... |
github | erlerobot/dronecode_matlab-master | arduino_make_rtw_hook.m | .m | dronecode_matlab-master/APM/APM2_Simulink_Blockset/APM2/arduino/arduino_make_rtw_hook.m | 6,749 | utf_8 | 6a83246ec89fee18ad05c82b4b8aebaf | function arduino_make_rtw_hook(hookMethod, modelName, ~, ~, ~, ~)
% ARDUINO_MAKE_RTW_HOOK
% Copyright 1996-2011 The MathWorks, Inc.
switch hookMethod
case 'error'
% Called if an error occurs anywhere during the build. If no error occurs
% during the build, then this hook will not be called. V... |
github | erlerobot/dronecode_matlab-master | sl_customization.m | .m | dronecode_matlab-master/APM/APM2_Simulink_Blockset/APM2/arduino/sl_customization.m | 598 | utf_8 | 4a1c84554775f0129e6e35d7706b1eaf | function sl_customization(cm)
% SL_CUSTOMIZATION for Arduino PIL connectivity config
% Copyright 2008-2010 The MathWorks, Inc.
cm.registerTargetInfo(@loc_createSerialConfig);
% local function
function config = loc_createSerialConfig
config = rtw.connectivity.ConfigRegistry;
config.ConfigName = 'Arduino connectivity... |
github | mattpitkin/yamm-master | mchol.m | .m | yamm-master/src/mchol.m | 3,774 | utf_8 | e4e994ed27f042078f8d4acb5f1b09cf | %
% [L,D,E,pneg]=mchol(G)
%
% Given a symmetric matrix G, find a matrix E of "small" norm and c
% L, and D such that G+E is Positive Definite, and
%
% G+E = L*D*L'
%
% Also, calculate a direction pneg, such that if G is not PD, then
%
% pneg'*G*pneg < 0
%
% Note that if G is PD, then the routine will r... |
github | shanghong/Multiband-RF-pulse-Design-master | b2a.m | .m | Multiband-RF-pulse-Design-master/b2a.m | 773 | utf_8 | 7662f31f316049f39fae8239feca9819 | % function [aca] = b2a(bc);
%
% This function takes a b polynomial, and returns the minimum phase,
% minimum power a polynomial
%
% Inputs:
% bc - beta polynomial coefficients
%
% Outputs:
% aca - minimum phase alpha polynomial
%
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior Uni... |
github | shanghong/Multiband-RF-pulse-Design-master | dinf.m | .m | Multiband-RF-pulse-Design-master/dinf.m | 525 | utf_8 | 6697ad36b31225053c7097db69346939 | % dinf -- calculate D infinity for a linear phase filter
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function d = dinf(d1,d2)
a1 = 5.309e-3;
a2 = 7.114e-2;
a3 = -4.761e-1;
a4 = -2.66e-3;
a5 = -5.941e-1;
a6 = -4.278e-1;
l10d1 = log10(d1);
l10d2 = log10(d2);
[m1 n1] = s... |
github | shanghong/Multiband-RF-pulse-Design-master | rf_ripple_GFA.m | .m | Multiband-RF-pulse-Design-master/rf_ripple_GFA.m | 9,813 | utf_8 | ef37cb7e0c3cefd323260bf86d384280 | function [range_B, ripple_B] = rf_ripple_GFA(FA, ripple_M, ptype, appro, dbg)
%
% For SLR algorithm with generalized flip-angle, calculate spec of ripple
% for Beta polynomial given flip-angle, ripple of magnetization, pulse type
%
% Inputs:
% FA -- in degree, flip angle
% ripple_M -- absolute ripple of magne... |
github | shanghong/Multiband-RF-pulse-Design-master | mag2mp.m | .m | Multiband-RF-pulse-Design-master/mag2mp.m | 1,167 | utf_8 | 08dbda7ffd611b17c2a19b8eae6f6356 | % mag2mp - take the magnitude of the fft of a signal, and return the
% fft of the analytic signal.
%
% as = mag2mp(ms)
% as - fft of analytic signal
% ms - magnitude of analytic signal fft.
%
% If you have a waveform B that you want to the minimum phase
% version of, then
% 1) pad B out by adding zeros up to a... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_upsample.m | .m | Multiband-RF-pulse-Design-master/fir_upsample.m | 3,029 | utf_8 | 68e16275187b5c38fd42b3bef289b922 | function h_new = fir_upsample(h, dt1, dt2, dbg)
%
% h_new = fir_upsample(h, dt1, dt2, dbg)
%
% upsampling filter
%
% Inputs:
% h: filter coefficient
% dt1: in ms, previous sampling interval
% dt2: in ms, new sampling interval
% dbg: show debug plot
%
% Outputs:
% h_new: filter after ups... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_flip_zero.m | .m | Multiband-RF-pulse-Design-master/fir_flip_zero.m | 6,220 | utf_8 | 7d86c9ffe4d1a356442948a854232dc2 | function h_new = fir_flip_zero(h, dbg)
%
% h_new = fir_flip_zero(h, dbg)
%
% Flip zeros of a filter to get all the possible filters with same
% frequency respones magnitude but different phase, among which choose
% the one with min peak value
%
% Inputs:
% h: original filter
% dbg: ... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_ap_cvx.m | .m | Multiband-RF-pulse-Design-master/fir_ap_cvx.m | 10,324 | utf_8 | a9ad515f1513f56e3b90b90447553cb0 | function [h, status] = fir_ap_cvx(n, f, a, d, obj, Peak, dbg)
% fir_ap_cvx - FIR filter design using cvx
%
% function [h, status] = fir_ap_cvx(n, f, a, d, obj, Peak, dbg)
%
% Design n-tap arbitrary-phase filter that meets multiband frequency
% respones manitude specification.
% Additional function:
% (1)... |
github | shanghong/Multiband-RF-pulse-Design-master | msinc.m | .m | Multiband-RF-pulse-Design-master/msinc.m | 372 | utf_8 | 0432dea54c363f8bbd9ed32bff365d9c | % h = msinc(n,m)
%
% Returns a hamming windowed sinc of length n, with m sinc-cycles,
% which means a time-bandwidth of 4*m
%
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function ms = msinc(n,m)
x = [-n/2:(n-1)/2]/(n/2);
snc = sin(m*2*pi*x+0.00001)./(m*2*pi*x+0.00001)... |
github | shanghong/Multiband-RF-pulse-Design-master | ab2rf.m | .m | Multiband-RF-pulse-Design-master/ab2rf.m | 733 | utf_8 | 56218e6173e1416f78e1fe356a6c4291 | % ab2rf - take two polynomials for alpha and beta, and return an
% rf waveform that would generate them.
%
% COMPLEX RF VERSION
%
% rf = ab2rf(a, b)
% a, b - polynomials for alpha and beta
% rf - rf waveform that produces alpha and beta under the hard pulse
% approximation.
%
% written by John Pauly, 1992
... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_min_order_qprog_phs.m | .m | Multiband-RF-pulse-Design-master/ss/fir_min_order_qprog_phs.m | 5,144 | utf_8 | bd71b4306fb1232c58193c1d206ef67b | % Based on
% "FIR Filter Design via Spectral Factorization and Convex Optimization"
% by S.-P. Wu, S. Boyd, and L. Vandenberghe
%
% Determines minimum-order linear-phase filter that meets
% amplitude/ripple specifications.
%
% function [h, status] = fir_min_order(n, f, a, d, dbg)
%
% Inputs: --- similar to cfirpm
% ... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_min_order.m | .m | Multiband-RF-pulse-Design-master/ss/fir_min_order.m | 5,486 | utf_8 | 2e41ee4692233933c0af99b06a2cf320 | % Determines minimum-order linear-phase filter that meets
% amplitude/ripple specifications.
%
% function [h, status] = fir_min_order(n, f, a, d, odd_or_even, a_min, dbg)
%
% Inputs: --- similar to cfirpm
% n: max number of taps to try
% f: frequency bands
% a: amplitude at band edges
% d: ripple in bands
% ... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_linprog.m | .m | Multiband-RF-pulse-Design-master/ss/fir_linprog.m | 9,142 | utf_8 | 95ddea671ef59c40f425088188459321 |
function [h, status] = fir_linprog(n, f, a, d, h0, dbg)
% FIR_LINPROG - FIR filter design using linear programming
%
% Design n-tap linear-phase filter that meets multiband frequency
% specification. If h0 is provided, it is used as an initial
% estimate of the filter taps.
%
% function [h, status] = fir_linprog... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_expand.m | .m | Multiband-RF-pulse-Design-master/ss/fir_expand.m | 9,421 | utf_8 | aabcb2bdcde0dd57f6e7bcd5ce4e88d5 | % function [h, fn, an, dn] = fir_expand(n, f, a, d, a_min, dbg)
%
% Inputs:
% n: number of taps
% f: frequency bands
% a: amplitude at band edges
% d: ripple in bands
% a_min: minimum amplitude to allow, default if empty is min(0,min(a-d));
% dbg: flag to turn on debugging statements/plots
%
% Outputs
% ... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_min_order_linprog.m | .m | Multiband-RF-pulse-Design-master/ss/fir_min_order_linprog.m | 5,502 | utf_8 | f6b3334647a6a178c047ddc020804544 | % Based on
% "FIR Filter Design via Spectral Factorization and Convex Optimization"
% by S.-P. Wu, S. Boyd, and L. Vandenberghe
%
% Determines minimum-order linear-phase filter that meets
% amplitude/ripple specifications.
%
% function [h, status] = fir_min_order(n, f, a, d, dbg)
%
% Inputs: --- similar to cfirpm
% ... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_minphase_power.m | .m | Multiband-RF-pulse-Design-master/ss/fir_minphase_power.m | 5,795 | utf_8 | 4841572be322094f628b4994b3bcc219 | % Determines minimum-order minimum-phase filter that has a magnitude
% response that meets the magnitude amplitude/ripple specifications.
% It will only return filters with an odd number of taps.
%
% function [h, status] = fir_minphase_power(n, f, a, d, use_max, dbg)
%
% Inputs: --- similar to cfirpm
% n: max numbe... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_pm.m | .m | Multiband-RF-pulse-Design-master/ss/fir_pm.m | 6,112 | utf_8 | bd23dea5bd85862b03817e8337d0f05d |
function [h, status] = fir_pm(n, f, a, d, a_min, dbg)
% FIR_LINPROG - FIR filter design using Parks-McLellan algs
%
% Design n-tap linear-phase filter that meets multiband frequency
% specification.
%
% function [h, status] = fir_pm(n, f, a, d, dbg)
%
% Inputs:
% n: number of taps returned
% f: frequenc... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_minphase.m | .m | Multiband-RF-pulse-Design-master/ss/fir_minphase.m | 5,784 | utf_8 | 17367df31d4d45ecef3dec4ba23b0106 | % Determines minimum-order minimum-phase filter that has a magnitude
% response that meets the magnitude amplitude/ripple specifications.
% It will only return filters with an odd number of taps.
%
% function [h, status] = fir_minphase(n, f, a, d, use_max, dbg)
%
% Inputs: --- similar to cfirpm
% n: max number of t... |
github | shanghong/Multiband-RF-pulse-Design-master | fir_pm_minpow.m | .m | Multiband-RF-pulse-Design-master/ss/fir_pm_minpow.m | 9,931 | utf_8 | 6efef3522e545c93fbbee04f40558a17 |
function [h, status] = fir_pm_minpow(n, f, a, d, a_min, dbg)
% FIR_PM_MINPOW - FIR filter design using Parks-McLellan algs,
% with attempt to minimize power
%
% Design n-tap linear-phase filter that meets multiband frequency
% specification.
%
% function [h, status] = fir_pm_minpow(n, f, a,... |
github | shanghong/Multiband-RF-pulse-Design-master | t2hz.m | .m | Multiband-RF-pulse-Design-master/rf_tools/t2hz.m | 423 | utf_8 | c3a73b25e6c6525a20d9cb52348f4471 | %
% Takes dimensionless x used by abr, and scales it to kHz based
% on pulse duration t (ms), using a particularly mysterious algorithm.
%
% fs = t2hz(x,t)
%
% x -- normalized frequency x vector used by abr
% t -- pulse duration in ms
%
% fs -- scaled frequency axis, in kHz
%
% written by John Pauly... |
github | shanghong/Multiband-RF-pulse-Design-master | fmp.m | .m | Multiband-RF-pulse-Design-master/rf_tools/fmp.m | 561 | utf_8 | 2334f0615f92b5174757da816745c5e8 | %
% Generate an equal ripple minimum phase filter starting with a linear
% phase filter.
%
% Called by dzmp.
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function hmp = fmp(h)
l = length(h);
if rem(l,2) == 0,
disp('filter length must be odd');
return;
end;
lp ... |
github | shanghong/Multiband-RF-pulse-Design-master | b2a.m | .m | Multiband-RF-pulse-Design-master/rf_tools/b2a.m | 682 | utf_8 | 56fd4cd9204f83ab859fe3d46d6e80ef | % function [aca] = b2a(bc);
%
% This function takes a b polynomial, and returns the minimum phase,
% minimum power a polynomial
%
% Inputs:
% bc - beta polynomial coefficients
%
% Outputs:
% aca - minimum phase alpha polynomial
%
function [aca] = b2a(bc)
n = length(bc);
% calculate minimum phase alpha
bcp = bc... |
github | shanghong/Multiband-RF-pulse-Design-master | dinf.m | .m | Multiband-RF-pulse-Design-master/rf_tools/dinf.m | 525 | utf_8 | 6697ad36b31225053c7097db69346939 | % dinf -- calculate D infinity for a linear phase filter
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function d = dinf(d1,d2)
a1 = 5.309e-3;
a2 = 7.114e-2;
a3 = -4.761e-1;
a4 = -2.66e-3;
a5 = -5.941e-1;
a6 = -4.278e-1;
l10d1 = log10(d1);
l10d2 = log10(d2);
[m1 n1] = s... |
github | shanghong/Multiband-RF-pulse-Design-master | ab2inv.m | .m | Multiband-RF-pulse-Design-master/rf_tools/ab2inv.m | 326 | utf_8 | 30089bcc7a15245071286410c8259cc0 | % mz = ab2inv(a,b) -- or -- mz = ab2inv(ab)
%
% Computes the inversion profile 1-2*b.*conj(b)
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function mz = ab2inv(a,b);
if nargin == 1,
[m n] = size(a);
b = a(:,(n/2+1):n);
a = a(:,1:n/2);
end;
mz = 1-2*conj(b... |
github | shanghong/Multiband-RF-pulse-Design-master | csg.m | .m | Multiband-RF-pulse-Design-master/rf_tools/csg.m | 1,163 | utf_8 | 67e370272ef2d52e61bc0e0830a2af08 | % function [nk] = csg(k,mxg,mxs)
%
% This routine takes a k-space trajectory and time warps it to
% meet gradient amplitude and slew rate constraints.
%
% Inputs:
% k -- k-space trajectory, scaled to cycles/cm
% mxg -- maximum gradient, G/cm
% mxs -- maximum slew rate, (G/cm)/ms
%
% Outputs:
% ... |
github | shanghong/Multiband-RF-pulse-Design-master | verse.m | .m | Multiband-RF-pulse-Design-master/rf_tools/verse.m | 467 | utf_8 | c2236159d782535ee0e9b74b2692b5ee | % rfv = verse(gv,rf)
%
% Computes the versed version of rf for a given time-vayring gradient gv
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function rfv = verse(g,rf)
[m n] = size(g);
if m<n, g = g.'; end;
[m n] = size(rf);
if m<n,
rf = conj(rf');
[m n] = size(rf);
... |
github | shanghong/Multiband-RF-pulse-Design-master | fftcp.m | .m | Multiband-RF-pulse-Design-master/rf_tools/fftcp.m | 371 | utf_8 | 2f8287fdabc60cb289e5152952772681 | %
% A centered FFT, padded with zeros to a specified length
%
% hf = fftcp(h,n)
%
% h -- input waveform
% n -- fft length
%
% hf -- centered, padded fft of h
%
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function hf = fftcp(h,n)
l = length(h);
hf = fftc([ze... |
github | shanghong/Multiband-RF-pulse-Design-master | dzlp.m | .m | Multiband-RF-pulse-Design-master/rf_tools/dzlp.m | 472 | utf_8 | 0cc5a4b8a955aed84968398a2990ce15 | % dzlp -- design a linear phase filter by calling remez with the
% proper arguments
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function h = dzlp(n,tb,d1,d2)
di = dinf(d1,d2);
w = di/tb;
f = [0 (1-w)*(tb/2) (1+w)*(tb/2) (n/2)]/(n/2);
m = [1 1 0 0];
w = [1 d1/d2]... |
github | shanghong/Multiband-RF-pulse-Design-master | csg2.m | .m | Multiband-RF-pulse-Design-master/rf_tools/csg2.m | 1,107 | utf_8 | 1a897c7cbb0b798717f5ada408e158d4 | % function [nk] = csg(k,mxg,mxs)
%
% This routine takes a k-space trajectory and time warps it to
% meet gradient amplitude and slew rate constraints.
%
% Inputs:
% k -- k-space trajectory, scaled to cycles/cm
% mxg -- maximum gradient, G/cm
% mxs -- maximum slew rate, (G/cm)/ms
%
% Outputs:
% ... |
github | shanghong/Multiband-RF-pulse-Design-master | abr.m | .m | Multiband-RF-pulse-Design-master/rf_tools/abr.m | 863 | utf_8 | ba1a3b04ee073467f208db4d220bb093 | % abr - compute the Cayley-Klein parameters for the rotation produced
% by an RF pulse. Uses Le Roux's convention on beta
%
% [a b] = abr(rf,<g,> x);
% a, b = Cayley-Klein paramters
% rf = n point rf waveform
% g = optional gradient waveform
% x = vectors of spatial positions to compute a and b.
%
% ... |
github | shanghong/Multiband-RF-pulse-Design-master | ab2st.m | .m | Multiband-RF-pulse-Design-master/rf_tools/ab2st.m | 317 | utf_8 | 616d6ad2d30f915a082a47e0318910a1 | % mxy = ab2se(a,b) -- or -- mxy = ab2se(ab)
%
% Computes the "straight through" term a.*a
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function mxy = ab2st(a,b);
if nargin == 2,
mxy = i*a.*a;
elseif nargin == 1,
mxy = i*a(:,1).*a(:,1);
else
ab2xx
end
|
github | shanghong/Multiband-RF-pulse-Design-master | dzmp.m | .m | Multiband-RF-pulse-Design-master/rf_tools/dzmp.m | 528 | utf_8 | 9968cc19da6302a4b4e42e421839e9da | % dzmp -- design a minimum phase filter by first designing a linear phase
% filter and factoring it into two terms
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function h = dzmp(n,tb,d1,d2)
n2 = 2*n-1;
di = 0.5*dinf(2*d1,0.5*d2.*d2);
w = di/tb;
f = [0 (1-w)*(tb/2... |
github | shanghong/Multiband-RF-pulse-Design-master | ab2sat.m | .m | Multiband-RF-pulse-Design-master/rf_tools/ab2sat.m | 327 | utf_8 | 07fdc8679545a30daf96f1e1c71d4f26 | % mz = ab2sat(a,b) -- or -- mz = ab2sat(ab)
%
% Computes the saturation profile 1-2*b.*conj(b)
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function mz = ab2sat(a,b);
if nargin == 1,
[m n] = size(a);
b = a(:,(n/2+1):n);
a = a(:,1:n/2);
end;
mz = 1-2*conj(b... |
github | shanghong/Multiband-RF-pulse-Design-master | mag2mp.m | .m | Multiband-RF-pulse-Design-master/rf_tools/mag2mp.m | 1,167 | utf_8 | 08dbda7ffd611b17c2a19b8eae6f6356 | % mag2mp - take the magnitude of the fft of a signal, and return the
% fft of the analytic signal.
%
% as = mag2mp(ms)
% as - fft of analytic signal
% ms - magnitude of analytic signal fft.
%
% If you have a waveform B that you want to the minimum phase
% version of, then
% 1) pad B out by adding zeros up to a... |
github | shanghong/Multiband-RF-pulse-Design-master | dimp.m | .m | Multiband-RF-pulse-Design-master/rf_tools/dimp.m | 208 | utf_8 | 16451c4583b2a18e963c9eccbdb10625 | % dimp -- calculate D infinity for a minimum phase filter
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function d=dimp(d1,d2)
d = 0.5*dinf(2*d1,0.5*d2.*d2);
|
github | shanghong/Multiband-RF-pulse-Design-master | gt2cm.m | .m | Multiband-RF-pulse-Design-master/rf_tools/gt2cm.m | 460 | utf_8 | f5cf423c2adf0362687fdc592ddfaf95 | %
% Takes dimensionless x used by abr, and scales it to cm based
% on a gradient strength g (G/cm) and pulse duration t (ms)
%
% xs = gt2cm(x,g,t)
%
% x -- normalized frequency x vector used by abr
% g -- Gradient strength, G/cm
% t -- pulse duration in ms
%
% xs -- scaled spatial axis, in cm
%
... |
github | shanghong/Multiband-RF-pulse-Design-master | msinc.m | .m | Multiband-RF-pulse-Design-master/rf_tools/msinc.m | 372 | utf_8 | 0432dea54c363f8bbd9ed32bff365d9c | % h = msinc(n,m)
%
% Returns a hamming windowed sinc of length n, with m sinc-cycles,
% which means a time-bandwidth of 4*m
%
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function ms = msinc(n,m)
x = [-n/2:(n-1)/2]/(n/2);
snc = sin(m*2*pi*x+0.00001)./(m*2*pi*x+0.00001)... |
github | shanghong/Multiband-RF-pulse-Design-master | fftc.m | .m | Multiband-RF-pulse-Design-master/rf_tools/fftc.m | 216 | utf_8 | 4c1f1b8abff335837a89a244046bfe3f | %
% fft wrt the center of the array, instead of the first sample
%
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function y=fftc(x)
y = fftshift(fft(fftshift(x)));
|
github | shanghong/Multiband-RF-pulse-Design-master | ab2rf.m | .m | Multiband-RF-pulse-Design-master/rf_tools/ab2rf.m | 642 | utf_8 | 90a2d1b18c27f5b95f098e0d8dbed4dd | % ab2rf - take two polynomials for alpha and beta, and return an
% rf waveform that would generate them.
%
% COMPLEX RF VERSION
%
% rf = ab2rf(a, b)
% a, b - polynomials for alpha and beta
% rf - rf waveform that produces alpha and beta under the hard pulse
% approximation.
%
function [rf] = ab2rf(ac,bc)
... |
github | shanghong/Multiband-RF-pulse-Design-master | cplot.m | .m | Multiband-RF-pulse-Design-master/rf_tools/cplot.m | 216 | utf_8 | 95e77449a34a7d7c1ad863e7d8a25fb1 | %
% cplot(x) - plot complex function;
%
% written by John Pauly, 1989
% (c) Board of Trustees, Leland Stanford Junior University
function cplot(x)
l = length(x);
t = [1:l]/(l+1);
plot(t,real(x),t,imag(x));
|
github | shanghong/Multiband-RF-pulse-Design-master | dz2d.m | .m | Multiband-RF-pulse-Design-master/rf_tools/dz2d.m | 1,352 | utf_8 | d4f1dce53003e0b901a393b96bf6c7d1 | % function [rf, g] = dz2d(nt,bw,tbp,ns,mxg,mxs)
%
% Designs a 2D rf pulse with a inward spiral gradient
%
% Inputs:
% nt -- number of turns in spiral
% bw -- spatial bandwidth, cycles/cm
% tbp -- "time-bandwdith" product for rf,
% ns -- number of samples
% mxg -- maximum gradient G/cm
% mxs -- max... |
github | shanghong/Multiband-RF-pulse-Design-master | ab2se.m | .m | Multiband-RF-pulse-Design-master/rf_tools/ab2se.m | 306 | utf_8 | 224675c4638cca53d25868e619b593e9 | % mxy = ab2se(a,b) -- or -- mxy = ab2se(ab)
%
% Computes the spin-echo profile i*b.*b
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function mxy = ab2se(a,b);
if nargin == 1,
[m n] = size(a);
b = a(:,(n/2+1):n);
a = a(:,1:n/2);
end
mxy = i*b.*b; |
github | utotch/RobotFormationControl-master | loop_sample.m | .m | RobotFormationControl-master/loop_sample.m | 424 | utf_8 | ef9064d325ee0e99e706f3662f380eac | function loop_sample()
userData.continue=true;
hFig=figure(1);
set(hFig,'UserData',userData);
set(hFig,'KeyPressFcn',{@onKeyPressed});
while(true);
disp('loop...');
userData=get(hFig,'UserData');
if (~userData.continue)
break;
end
pause(1);
end
end
function onKeyPressed(src,event)
disp('on... |
github | utotch/RobotFormationControl-master | CameraManager.m | .m | RobotFormationControl-master/CameraManager.m | 522 | utf_8 | e209ee6b585ca262b2a6dfd0efb734be | classdef CameraManager
properties
videoInputRef;
numDevices=0;
end
methods
function obj=CameraManager()
obj.videoInputRef=vi_create();
obj.numDevices=vi_list_devices(obj.videoInputRef);
fprintf(1, '%d cameras detected.\n', obj.numDevices);
end
function camera=setupCameraDevice(obj,id,width,height,fps)
assert(0<... |
github | utotch/RobotFormationControl-master | FormationManager.m | .m | RobotFormationControl-master/FormationManager.m | 2,036 | utf_8 | e8f31d2234e669ebce7683e3a65b2226 | classdef FormationManager < handle
properties(Constant)
% Default9=[-0.5 0 0.5 -0.5 0 0.5 -0.5 0 0.5;
% 0.5 0.5 0.5 0 0 0 -0.5 -0.5 -0.5];
Default9=[-1 0 1 -1 0 1 -1 0 1;
1 1 1 0 0 0 -1 -1 -1];
Side45=[-1 -1 -1 -1 1 1 1 1 1;
0.75 0.25 -0.25 -0.75 0.95 0.5 0 -0.5 -0.95];
Side54=... |
github | utotch/RobotFormationControl-master | CameraDevice.m | .m | RobotFormationControl-master/CameraDevice.m | 994 | utf_8 | 381f0d502babd4b3b47df30b52c51725 | classdef CameraDevice
properties(Constant)
end
methods(Static)
end
properties
cameraManagerRef;
deviceId;
width=640;
height=480;
fps=30;
% pixels;
end
methods
function obj=CameraDevice(cameraManagerRef,deviceId,width,height,fps)
obj.cameraManagerRef=cameraManagerRef;
obj.deviceId=deviceId;
obj.width=width;
obj.... |
github | utotch/RobotFormationControl-master | RobotController.m | .m | RobotFormationControl-master/RobotController.m | 2,946 | utf_8 | b32747f811d83d1b6983edd3fc864ff8 | classdef RobotController < handle
properties
hMuran;
hOmnikit;
numRobots;
angleFeedbackController;
xyFeedbackController;
end
methods
function obj=RobotController(hMuran,hOmnikit,numRobots,fps)
assert(isa(hOmnikit,'utotch.arduino.OmnikitRemote'));
obj.hMuran=hMuran;
obj.hOmnikit=hOmnikit;
obj.numRobots=num... |
github | utotch/RobotFormationControl-master | StrokeManager.m | .m | RobotFormationControl-master/StrokeManager.m | 1,036 | utf_8 | c47b34bcf18ba0a6f1e5a4151b529071 | classdef StrokeManager < handle
properties
hMuran;
hStrokeStateRemote;
end
methods
function obj=StrokeManager(hMuran)
obj.hMuran=hMuran;
obj.hStrokeStateRemote=utotch.muran.StrokeStateRemote;
end
function b=isConnected(obj)
b=obj.hStrokeStateRemote.isConnected;
end
function connect(obj)
obj.hStrokeStat... |
github | utotch/RobotFormationControl-master | HelloClass.m | .m | RobotFormationControl-master/HelloClass.m | 4,784 | utf_8 | a143cfbb12aca72f56eeb4d303f209c6 | classdef HelloClass < handle
properties
message=[];
lastKey;
isContinue=true;
motorValue=1.0;
hMotorValueSlider;
end
methods(Static)
function deltaT=cameraCaputreTest(width,height,fps)
if ~exist('width','var'); width=640; end;
if ~exist('height','var'); height=480; end;
if ~exist('fps','var'); fps=30; end;
devi... |
github | xionluhnis/stereosynth-master | pm_select.m | .m | stereosynth-master/toolbox/pm_select.m | 2,211 | utf_8 | 58d7ae4c2e01257701df2cb77d153d52 | %PM_QUERY Compute a knnf query on a set of images
%
% INPUT
% - query the image query
% - images either the image directory or a list of images (str or img)
% - options query options
%
% OUTPUT
% - knnf the resulting knnf
% - data struct with fields:
% - left: the left ima... |
github | xionluhnis/stereosynth-master | load_img.m | .m | stereosynth-master/toolbox/load_img.m | 325 | utf_8 | 35936fa28accf43029102564e793e089 | function img = load_img(file)
if ends_with(file, '.mat')
img = load_mat(file);
else
img = im2double(imread(file));
end
end
function res = ends_with(str, pat)
S = length(str);
P = length(pat);
if S < P
res = 0;
else
res = strcmp(str(end-P+1:end), pat);
en... |
github | xionluhnis/stereosynth-master | laplacian_pyr.m | .m | stereosynth-master/toolbox/laplacian_pyr.m | 529 | utf_8 | a1c6b179308ba686b95a17b4be9cb92c | %LAPLACIAN_PYR Compute a laplacian pyramid from a gaussian pyramid
% from 1=coarsest to N=finest level
%
% BASED ON
% https://github.com/rayryeng/laplacianBlend
%
function pyr = laplacian_pyr( gauss_pyr )
levels = length(gauss_pyr);
pyr = cell(1, levels);
% first scale is the same as gaussia... |
github | xionluhnis/stereosynth-master | pm_flow.m | .m | stereosynth-master/toolbox/pm_flow.m | 2,437 | utf_8 | 28c8ab725c6fbefc3e9e384985cf8abf | function [ uv ] = pm_flow( left, right, options )
%PM_FLOW Summary of this function goes here
% Detailed explanation goes here
addpath('bin');
if nargin < 3
options = struct();
end
if ~isfield(options, 'flow_type')
options.flow_type = 'flow';
options.use_xy = true;
end... |
github | xionluhnis/stereosynth-master | pm_query.m | .m | stereosynth-master/toolbox/pm_query.m | 3,244 | utf_8 | 80794ecec999a8b9102bce58c08c2c5e | %PM_QUERY Compute a knnf query on a set of images
%
% INPUT
% - query the image query
% - images either the image directory or a list of images (str or img)
% - options query options
%
% OUTPUT
% - knnf the resulting knnf
% - data struct with fields:
% - left: the left ima... |
github | xionluhnis/stereosynth-master | multires_nnf.m | .m | stereosynth-master/toolbox/multires_nnf.m | 2,060 | utf_8 | 048f14de9fe30a4bb69a7432d9fbcb0b | function [ nnf ] = multires_nnf( A, B, options, method )
mexpath = fullfile(pwd, '..', 'bin');
addpath(mexpath);
% default arguments
if nargin < 3
options.method = @isnnf;
end
if nargin < 4
method = param(options, 'method', @isnnf);
end
min_scale = param(options, 'm... |
github | xionluhnis/stereosynth-master | load_patchweb.m | .m | stereosynth-master/toolbox/load_patchweb.m | 5,319 | utf_8 | 5c9fc6ddcfdc529b32db12635e023409 | %LOAD_PATCHWEB - load a patch web workspace
%
% SYNOPSIS
%
% ws = load_patchweb();
% ws = load_patchweb(params);
% ws = load_patchweb(path);
% ws = load_patchweb(..., p, val);
%
% INPUT
% - params the parameter of the workspace
% - basedir the path to the workspace base with default parameters
% ... |
github | xionluhnis/stereosynth-master | cache_flow.m | .m | stereosynth-master/toolbox/cache_flow.m | 1,196 | utf_8 | f4dfc5fa83505d47614ee7dab9317c28 | function [ ] = cache_flow( basedir )
% get the images
images = find_images(basedir);
% compute motion flow
flow_dir = fullfile('libs', 'flow_code_v2');
util_dir = fullfile(flow_dir, 'utils');
addpath(flow_dir, genpath(util_dir));
uv_dir = fullfile(basedir, '.uv');
if ~exist(uv... |
github | xionluhnis/stereosynth-master | pyr_kernel.m | .m | stereosynth-master/toolbox/pyr_kernel.m | 324 | utf_8 | c7b06a0f546836fd89ed7931ab31a7fd | % Function that generates a 5 x 5 filtering kernel
% used for Laplacian Pyramidal blending
% a is usually 0.4
%
% BASED ON
% https://github.com/rayryeng/laplacianBlend
%
function [ker] = pyr_kernel(a)
if nargin < 1
a = 0.4;
end
w_1d = [0.25 - a/2 0.25 a 0.25 0.25 - a/2];
ker = w_1d' * w_1d;
e... |
github | xionluhnis/stereosynth-master | find_images.m | .m | stereosynth-master/toolbox/find_images.m | 679 | utf_8 | f7bf6ed0d9e340cc528783b029f139e4 | function img_files = find_images( path )
dir_files = dir(path);
img_files = cell(0, 0);
for i = 1:length(dir_files)
if dir_files(i).isdir
continue;
end
fname = fullfile(path, dir_files(i).name);
if is_image(fname)
img_files{end+1} = fname;
end
... |
github | xionluhnis/stereosynth-master | pyr_levels.m | .m | stereosynth-master/toolbox/pyr_levels.m | 563 | utf_8 | 071f4c410a155860a679e797e4f26d58 | % PYR_LEVELS - compute the number of pyramid levels
%
% BASED ON
% https://github.com/rayryeng/laplacianBlend
%
function L = pyr_levels(im)
% Figure out how many levels we need for the image pyramid
% Ensures that smallest scale has resolution whose minimum dimension
% (smallest row or column) is 16
... |
github | xionluhnis/stereosynth-master | pyr_collapse.m | .m | stereosynth-master/toolbox/pyr_collapse.m | 450 | utf_8 | 31fdb0d71d8166e83a0f86479d33876e | % Given a Laplacian pyramid, starting from the smallest scale,
% expand it, then add to upper scale. Repeat this until we get to the
% original scale and this is the output
%
% BASED ON
% https://github.com/rayryeng/laplacianBlend
%
function out = pyr_collapse(Lpyr)
stack = Lpyr;
levels = length(Lpyr);
f... |
github | xionluhnis/stereosynth-master | pyr_reduce.m | .m | stereosynth-master/toolbox/pyr_reduce.m | 532 | utf_8 | 4baa0b052736e4ea59870865039a2d54 | % Method that subsamples an image
% Given an r x c image, we blur the image first
% using the filter kernel produced by generating_kernel,
% the subsample the rows and columns by a factor of 2
%
% BASED ON
% https://github.com/rayryeng/laplacianBlend
%
function [out] = pyr_reduce(im)
% Blur the image
img_b... |
github | xionluhnis/stereosynth-master | gaussian_pyr.m | .m | stereosynth-master/toolbox/gaussian_pyr.m | 560 | utf_8 | c8439b9a3418f4f47365d8427f2ca53c | % Create a Gaussian pyramid
% Essentially this uses reduce for a total of levels times.
% Each image in one scale is half the size of the previous scale
% First scale is simply the original image
%
% BASED ON
% https://github.com/rayryeng/laplacianBlend
%
function [gaussout] = gaussian_pyr(im, levels)
if nargi... |
github | xionluhnis/stereosynth-master | pyr_expand.m | .m | stereosynth-master/toolbox/pyr_expand.m | 735 | utf_8 | e10d930873e62636df459c294b04ed4e | % Function that takes an r x c image, and creates an expanded version
% of size 2r x 2c. The r x c image is interleaved in checkerboard style
% and then blurred using the generating kernel
%
% BASED ON
% https://github.com/rayryeng/laplacianBlend
%
function [expout] = pyr_expand(im, dim)
% Allocate memory for... |
github | xionluhnis/stereosynth-master | stereo_synth.m | .m | stereosynth-master/toolbox/stereo_synth.m | 14,055 | utf_8 | c7cb26cc53f4caa134fb53371c900dce | %STEREO_SYNTH Synthesize a stereo frame from a query using many images
%
% INPUT
% - query the image query
% - images either the image directory or a list of images (str or img)
% - options query options
%
% OUTPUT
% - result the synthesized frame
% - data additional data linked to the result... |
github | xionluhnis/stereosynth-master | denoise_robust2.m | .m | stereosynth-master/libs/flow_code_v2/utils/denoise_robust2.m | 3,458 | utf_8 | df87e1aa42b9d1cf97b545f04334f531 | function I = denoise_robust2(In, lambda, method, num_iter)
% function I = denoise_robust(In, lambda, gt)
%
% Denoise with a robust function by gradient descent
% (I-In)^2 + lambda*rho(f*I), where f is filter
%
% Author: Deqing Sun, Department of Computer Science, Brown University
% Contact: dqsun@cs.brown.edu
% $... |
github | xionluhnis/stereosynth-master | computeColor.m | .m | stereosynth-master/libs/flow_code_v2/utils/flowColorCode/computeColor.m | 3,178 | utf_8 | 399f4a33a2991cc15b437bc679aa251d | function img = computeColor(u,v)
% computeColor color codes flow field U, V
% According to the c++ source code of Daniel Scharstein
% Contact: schar@middlebury.edu
% Author: Deqing Sun, Department of Computer Science, Brown University
% Contact: dqsun@cs.brown.edu
% $Date: 2007-10-31 21:20:30 (Wed, 31 O... |
github | xionluhnis/stereosynth-master | flann_search.m | .m | stereosynth-master/libs/flann-1.8.4-src/src/matlab/flann_search.m | 3,564 | utf_8 | a5a9b7cb6bc8b49d8f0f6c2737c17608 | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
%Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
%
%THE BSD LICENSE
%
%Redistribution and use in source and binary forms, with or without
%modification, are permitted provided that the following conditions
%are met:
%
... |
github | xionluhnis/stereosynth-master | flann_load_index.m | .m | stereosynth-master/libs/flann-1.8.4-src/src/matlab/flann_load_index.m | 1,578 | utf_8 | f9bcc41fd5972c5c987d6a4d41bdc796 | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
%Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
%
%THE BSD LICENSE
%
%Redistribution and use in source and binary forms, with or without
%modification, are permitted provided that the following conditions
%are met:
%
... |
github | xionluhnis/stereosynth-master | test_flann.m | .m | stereosynth-master/libs/flann-1.8.4-src/src/matlab/test_flann.m | 10,328 | utf_8 | 151c22994b0192f8a071649ad26fbc6b | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
%Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
%
%THE BSD LICENSE
%
%Redistribution and use in source and binary forms, with or without
%modification, are permitted provided that the following conditions
%are met:
%
... |
github | xionluhnis/stereosynth-master | flann_free_index.m | .m | stereosynth-master/libs/flann-1.8.4-src/src/matlab/flann_free_index.m | 1,614 | utf_8 | 5d719d8d60539b6c90bee08d01e458b5 | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
%Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
%
%THE BSD LICENSE
%
%Redistribution and use in source and binary forms, with or without
%modification, are permitted provided that the following conditions
%are met:
%
... |
github | xionluhnis/stereosynth-master | flann_save_index.m | .m | stereosynth-master/libs/flann-1.8.4-src/src/matlab/flann_save_index.m | 1,563 | utf_8 | 5a44d911827fba5422041529b3c01cf6 | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
%Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
%
%THE BSD LICENSE
%
%Redistribution and use in source and binary forms, with or without
%modification, are permitted provided that the following conditions
%are met:
%
... |
github | xionluhnis/stereosynth-master | flann_set_distance_type.m | .m | stereosynth-master/libs/flann-1.8.4-src/src/matlab/flann_set_distance_type.m | 1,926 | utf_8 | 8ba72989a4ac1bd6b30bec841b9def25 | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
%Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
%
%THE BSD LICENSE
%
%Redistribution and use in source and binary forms, with or without
%modification, are permitted provided that the following conditions
%are met:
%
... |
github | xionluhnis/stereosynth-master | LMgist.m | .m | stereosynth-master/libs/gist/LMgist.m | 8,240 | utf_8 | bfdf40d00f3439f3864ce453bfce69d6 | function [gist, param] = LMgist(D, HOMEIMAGES, param, HOMEGIST)
%
% [gist, param] = LMgist(D, HOMEIMAGES, param);
% [gist, param] = LMgist(filename, HOMEIMAGES, param);
% [gist, param] = LMgist(filename, HOMEIMAGES, param, HOMEGIST);
%
% For a set of images:
% gist = LMgist(img, [], param);
%
% When calling LMgist with... |
github | xionluhnis/stereosynth-master | showGist.m | .m | stereosynth-master/libs/gist/showGist.m | 1,954 | utf_8 | 926839f0ab3e7182c10a1b52d06e5e31 | function showGist(gist, param)
%
% Visualization of the gist descriptor
% showGist(gist, param)
%
% The plot is color coded, with one color per scale
%
% Example:
% img = zeros(256,256);
% img(64:128,64:128) = 255;
% gist = LMgist(img, '', param);
% showGist(gist, param)
[Nimages, Ndim] = size(gist);
nx = c... |
github | luoyetx/rcpr-annotated-master | rcprTest1.m | .m | rcpr-annotated-master/rcprTest1.m | 7,275 | utf_8 | aff2d62d37858ecf68c7841864868ead | function p = rcprTest1( Is, regModel, p, regPrm, iniData, ...
verbose, prunePrm)
% Apply robust cascaded shape regressor.
%
% USAGE
% p = rcprTest1( Is, regModel, p, regPrm, bboxes, verbose, prunePrm)
%
% INPUTS
% Is - cell(N,1) input images
% regModel - learned multi stage shape regressor (see rcprTrain)
... |
github | luoyetx/rcpr-annotated-master | regApply.m | .m | rcpr-annotated-master/regApply.m | 4,052 | utf_8 | 45698e985fbf94375effbda6a610f209 | function ysSum = regApply(p,X,regInfo,regPrm)
% Apply boosted regressor.
%
% USAGE
% ysSum = regApply(p,X,regInfo,regPrm)
%
% INPUTS
% p - [NxD] initial pose
% X - [NxF] N length F feature vectors
% regInfo - structure containing regressor info, output of regTrain
% regPrm
% .type - [1] type o... |
github | luoyetx/rcpr-annotated-master | poseNMS_K.m | .m | rcpr-annotated-master/video_tracking/poseNMS_K.m | 13,397 | utf_8 | 617c3911d5d26473ea0bb2c64e31b002 | function [Y,e,eData,eSmth,eCnst] = poseNMS_K( X, S, R, K, varargin )
%% "Merging Pose Estimates Across Space and Time". X.P. Burgos-Artizzu,
% D.Hall, P.Perona, P.Dollar. BMVC 2013, Bristol, UK.
%
% Compute sequence of trajectories explaining observed detections, for a
% given number of objects K known. (For unknown n... |
github | luoyetx/rcpr-annotated-master | poseNMS.m | .m | rcpr-annotated-master/video_tracking/poseNMS.m | 4,675 | utf_8 | 8b37b12c25925c379452b6274e0c60c4 | function Y = poseNMS( X, S, R, maxK, prmTrack )
%% "Merging Pose Estimates Across Space and Time". X.P. Burgos-Artizzu,
% D.Hall, P.Perona, P.Dollar. BMVC 2013, Bristol, UK.
%
% Compute sequence of trajectories explaining observed detections for a
% unknown number of objects (Section 2.3 in paper).
% (For known numb... |
github | RedMarbles/pdt_360deg_git-master | use_cimgmatlab.m | .m | pdt_360deg_git-master/libs/CImg/examples/use_cimgmatlab.m | 1,242 | utf_8 | c7cefea57d7bf6077ec6a77f3bdda6b6 | /*-----------------------------------------------------------------------
File : use_cimgmatlab.m
Description: Example of use for the CImg plugin 'plugins/cimgmatlab.h'
which allows to use CImg in order to develop matlab external
functions (mex functions).
User should be familiar with Matlab C/C++ mex functi... |
github | CyberZHG/Sketch-Based-master | checkNumericalGradient.m | .m | Sketch-Based-master/Temp/checkNumericalGradient.m | 2,009 | utf_8 | d6b37f7ff21330c7c910731e3371787e | function [] = checkNumericalGradient()
% This code can be used to check your numerical gradient implementation
% in computeNumericalGradient.m
% It analytically evaluates the gradient of a very simple function called
% simpleQuadraticFunction (see below) and compares the result with your numerical
% solution. Your num... |
github | CyberZHG/Sketch-Based-master | sparseAutoencoderCost.m | .m | Sketch-Based-master/Temp/sparseAutoencoderCost.m | 4,206 | utf_8 | 362630c92fb938eae7c30c6bcb938aaf | function [cost,grad] = sparseAutoencoderCost(theta, visibleSize, hiddenSize, ...
lambda, sparsityParam, beta, data)
% visibleSize: the number of input units (probably 64)
% hiddenSize: the number of hidden units (probably 25)
% lambda: weight decay parameter
% sparsityPar... |
github | CyberZHG/Sketch-Based-master | sampleIMAGES.m | .m | Sketch-Based-master/Temp/sampleIMAGES.m | 2,117 | utf_8 | 4949dae65d0896e8e533d4502a3a3e49 | function patches = sampleIMAGES()
% sampleIMAGES
% Returns 10000 patches for training
load('IMAGES.mat', 'IMAGES');
patchsize = 8; % we'll use 8x8 patches
numpatches = 10000;
% Initialize patches with zeros. Your code will fill in this matrix--one
% column per patch, 10000 columns.
patches = zeros(patchsize*patc... |
github | CyberZHG/Sketch-Based-master | feedForwardAutoencoder.m | .m | Sketch-Based-master/Temp/feedForwardAutoencoder.m | 1,332 | utf_8 | 48b3aece47a28e4c49643323aa097154 | function [activation] = feedForwardAutoencoder(theta, hiddenSize, visibleSize, data)
% theta: trained weights from the autoencoder
% visibleSize: the number of input units (probably 64)
% hiddenSize: the number of hidden units (probably 25)
% data: Our matrix containing the training data as columns. So, data(:,i) i... |
github | bryantaylor1979/stock-shock-source-master | CalculateWrapper.m | .m | stock-shock-source-master/Stock Calculator/CalculateWrapper.m | 4,723 | utf_8 | d9d32011aec3b596a95f188223578c1f | function [] = CalculateWrapper(symbols,Calculation)
%This function calculates the daily price difference.
%
%Calculate the daily price difference
%
%Example:
%Calculation = { 'DayDiff'; ...
% 'PriceMean'};
%CalculateWrapper('all',Calculation);
%
%Written by: Bryan Taylor
%Date Create... |
github | bryantaylor1979/stock-shock-source-master | StockCalculator.m | .m | stock-shock-source-master/Stock Calculator/StockCalculator.m | 3,445 | utf_8 | 55b2ea1822816913e2bae1c8911db826 | function [] = StockCalculator()
% Stock Calulator
global handles Status
addpath('C:\SourceSafe\Stocks & Shares\Programs\Trade Guide\Callback');
addpath('C:\SourceSafe\Stocks & Shares\Programs\Stock Calculator\Calculations');
addpath('C:\SourceSafe\Stocks & Shares\Programs\Stock Calculator\SharedFiles');
addpath... |
github | bryantaylor1979/stock-shock-source-master | SetElapsedTime.m | .m | stock-shock-source-master/Stock Calculator/SetElapsedTime.m | 325 | utf_8 | 998ca66fec01b4f848f1b2d52d016b45 |
function [] = SetElapsedTime()
global handles
time = toc; %in seconds
seconds = floor(rem(time,60));
totalminutes = floor(time/60);
minutes = rem(totalminutes,60);
hours = floor(totalminutes/60);
set(handles.elapsedtime,'String',['Elapsed Time: ',num2str(hours),'h ',num2str(minutes),'m ',num2str(seconds),'... |
github | bryantaylor1979/stock-shock-source-master | CalculationSelection.m | .m | stock-shock-source-master/Stock Calculator/CalculationSelection.m | 2,480 | utf_8 | 8d8753b976c0d27da8f158f6a4e0bc6e | function [] = CalculationSelection();
%Written by: Bryan Taylor
%Date Created: 4th March 2008
global h
[h.figure] = CreateFigure();
Border.Bottom = 50;
Border.Top = 10;
Border.Sides = 10;
ListBoxWidth = 180;
ListBoxHeight = 400;
ListboxSpacing = 100;
CompleteList = CalculationDeclartion;
load Ca... |
github | bryantaylor1979/stock-shock-source-master | waitbar2.m | .m | stock-shock-source-master/Stock Calculator/waitbar2.m | 1,771 | utf_8 | f509ac6ca151a61dd441399ee40177fb | function [varargout] = waitbar2(varargin)
% Waitbar
warning off
[x] = size(varargin,2);
if x == 2 % update
h = varargin{1};
Percentage = varargin{2};
[image] = CreateImage(Percentage);
Image2 = get(h.figure,'CDATA');
%merge image
[x1,y1,z1] = size(Image2);
x1 = x1/2;
... |
github | bryantaylor1979/stock-shock-source-master | NoiseRemoval.m | .m | stock-shock-source-master/Stock Calculator/SharedFiles/NoiseRemoval.m | 3,570 | utf_8 | de267894fe9eb7af91976d271bd4c843 | function [P] = NoiseRemoval(varargin)
%This function removes daily noise. This function needs to be optimised but
%when set up correctly will remove daily noise.
%
%Optional Inputs:
% Noise Threshold:- If the daily variation is less than this value the
% stock price will be assumed to be the same. This is e... |
github | bryantaylor1979/stock-shock-source-master | LogInDetails.m | .m | stock-shock-source-master/Stock Calculator/SharedFiles/LogInDetails.m | 5,639 | utf_8 | 703ef1031b6ef1f4cb0a995613f33e98 | function varargout = LogInDetails(varargin)
% LOGINDETAILS M-file for LogInDetails.fig
% LOGINDETAILS, by itself, creates a new LOGINDETAILS or raises the existing
% singleton*.
%
% H = LOGINDETAILS returns the handle to a new LOGINDETAILS or the handle to
% the existing singleton*.
%
% ... |
github | bryantaylor1979/stock-shock-source-master | SymbolInformation.m | .m | stock-shock-source-master/Stock Calculator/SharedFiles/SymbolInformation.m | 2,287 | utf_8 | 77782265be3c903e670b4578e7775aaa | function [OutPutArray] = SymbolInformation(varargin)
%Similar to StockDateRange but for the whole database
%
%Example:
%[OutPutArray] = SymbolInformation()
global handles
[log,conn] = parseinputs(varargin);
%list all stocks in database
[tablelist] = GetAllTableNames(conn);
[x] = size(tablelist,1);
dat... |
github | bryantaylor1979/stock-shock-source-master | TradeGuide.m | .m | stock-shock-source-master/Stock Calculator/SharedFiles/TradeGuide.m | 4,595 | utf_8 | 5d5507ec70f0c813c0034eb447f083f2 | function [buy,sell,tradesignal,changemarker,pP]=tradeguide(varargin)
%Gives Buy and Sell signals for maximum practical profit.
%Ignores small trend changes or flat days and follow biggest local trends.Profitable spikes are included.
%Tradeguide signal offers practical trading benchmark training set for Neural Networ... |
github | bryantaylor1979/stock-shock-source-master | StockQuote.m | .m | stock-shock-source-master/Stock Calculator/SharedFiles/StockQuote.m | 5,153 | utf_8 | 3c55693767066f8222f204a4963afb2e | function [varargout] = StockQuote(varargin)
%STOCKQUOTE
% This is similiar to stockquotequery but in gets data from local
% database
%
%INPUTS
% Conn - Connection Object
% symbol- symbol of data required.
% {'datenum';'close';'open';'high';'low'} or
% 'close'
% fieldname- field... |
github | bryantaylor1979/stock-shock-source-master | CalcMovingAv.m | .m | stock-shock-source-master/Stock Calculator/Calculations/CalcMovingAv.m | 3,451 | utf_8 | 56a900a996ed0becdfe3b1cd0a928946 | function [Out] = CalcMovingAv(symbols,NumberOfDays)
%Calculate stock price moving average
% Detailed explanation goes here
%
%Example:
%Calculate a month moving average
%[MovingAv] = CalcMovingAv('AA',30);
%
%Example:
%Calculate all the moving averages for the whole database.
%
%Copyright 2007, CoLogic, Inc... |
github | bryantaylor1979/stock-shock-source-master | getYahooHistorical.m | .m | stock-shock-source-master/hist_quotes/getYahooHistorical.m | 19,847 | utf_8 | e644d887d8e6400ce707f45455eb2d57 | function DATASET = getYahooHistorical(varargin)
%% compulsory inputs
SymbolName = varargin{1};
% defaults
args.startdate = today-2; %Datenum of the start of the world!
args.enddate = today;
args.method = 'fetch'; %fetch or sqq
args.conn = [];
args.freq = 'd'; %d, w, m, v(dvidends)
... |
github | bryantaylor1979/stock-shock-source-master | getdata.m | .m | stock-shock-source-master/dividend_backtesting/getdata.m | 1,457 | utf_8 | 09e732642dd64c9e1c44abef0841351d | % http://www.quantatrisk.com/2013/08/28/yahoo-stock-data-in-matlab-and-a-model-for-dividend-backtesting/
%%
% Yahoo! Stock Data in Matlab and a Model for Dividend Backtesting
% (c) 2013 QuantAtRisk.com, by Pawel Lachowicz
function [adjClose, div] =getdata(stock)
% It is a well known opinion (based on many years of m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.