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 | toastpp/toastpp-master | plotmeshsolnofig.m | .m | toastpp-master/script/matlab/utilities/plotmeshsolnofig.m | 1,292 | utf_8 | ddc7ac3c6b70888bb00376c2bc16668a | %
% plot function C2 on mesh (n_nodes, p)
%
function plotmeshsolnofig(n_nodes, p, n_elements, node, C2, cmin, cmax)
scale = 1.0;
%figure;
for i=1:n_nodes
x(i)=p(i,1);
y(i)=p(i,2);
z(i)=p(i,3);
end
for i=1:n_elements
ie=node(i,1)+1;
je=node(i,2)+1;
ke=node(i,3)+1;
le=node(i,... |
github | toastpp/toastpp-master | mkcircle.m | .m | toastpp-master/script/matlab/utilities/mkcircle.m | 4,232 | utf_8 | 786ae8b8e8591a5d0f316944b2a99401 | % Return the data for constructing a circular mesh
%
% [vtx,idx,eltp] = mkcircle(rad,nsect,nring,nbnd)
%
% rad [real]: radius [mm]
% nsect [integer]: number of element sectors (tangential element
% resolution; suggestion: 6)
% nring [integer]: number of element rings (radial resolution, e.... |
github | toastpp/toastpp-master | relpath.m | .m | toastpp-master/script/matlab/utilities/relpath.m | 1,026 | utf_8 | c6a6c3e78ad9c5e740665b9a04e6d059 | % Returns a relative path from srcpath to file, where both srcpath and
% file contain absolute paths (or at least relative paths starting from
% the same node)
function rpath = relpath(file,srcpath)
fs = filesep;
[h1,r1]=strtok(srcpath,fs);
[h2,r2]=strtok(file,fs);
% step 1: remove identical leading components
while... |
github | toastpp/toastpp-master | plotmeshsolcut.m | .m | toastpp-master/script/matlab/utilities/plotmeshsolcut.m | 1,460 | utf_8 | 58e80b6ee855945114cf4a5f9db7f7a7 | %
% plot function C2 on mesh (n_nodes, p)
%
% display only elements that lie behind x = 0 plane
%
function plotmeshsolcuty(n_nodes, p, n_elements, node, C2, cmin, cmax, nx,ny,nz,d)
scale = 1.0;
%figure;
for i=1:n_nodes
x(i)=p(i,1);
y(i)=p(i,2);
z(i)=p(i,3);
end
for i=1:n_elements
ie=nod... |
github | toastpp/toastpp-master | plotmeshsolt.m | .m | toastpp-master/script/matlab/utilities/plotmeshsolt.m | 1,299 | utf_8 | 7a151a9310c75f9d340cd8d1848fe357 | %% New plot function. For 6 noded-triangle meshes
% Declare figure _ before_ this is called
%
%
function plotmeshsolt(n_nodes, p, n_elements, node, C2, cmin, cmax,tle)
scale = 1.0;
for i=1:n_nodes
x(i)=p(i,1);
y(i)=p(i,2);
z(i)=p(i,3);
end
for i=1:n_elements
ie=node(i,1)+1;
je=node(i,2)+1;
k... |
github | toastpp/toastpp-master | demo_matlab_rec2.m | .m | toastpp-master/script/matlab/html/tutorials/demo_matlab_rec2.m | 7,742 | utf_8 | da9c4c6fcf7a4cb0d1d84f325acbee51 | % Toast-Matlab web example 5:
% A simple reconstruction of absorption and scattering distributions in
% a 2-D problem from frequency domain boundary data
% (c) Martin Schweiger and Simon Arridge
% www.toastplusplus.org
function demo_matlab_rec2
freq = 100; % modulation frequency [MHz]
tau = 1e-6; % regularisation... |
github | toastpp/toastpp-master | nonuniqueness.m | .m | toastpp-master/script/matlab/html/tutorials/demo_nonunique/nonuniqueness.m | 4,927 | utf_8 | b157f985b16f552129c6e960166a0d24 | % This example demonstrates a non-uniqueness condition in DOT:
% Transillumination amplitude data from a steady-state measurement at a
% single wavelength are not sufficient for reconstructing both absorption
% and scattering distributions.
%
% This is demonstrated by generating data from a model with homogeneous
... |
github | toastpp/toastpp-master | toast_demo1.m | .m | toastpp-master/script/matlab/demos/toast_demo1.m | 22,684 | utf_8 | 5bd746db8ded4e8d5760f536daf3c820 | function varargout = toast_demo1(varargin)
% TOAST_DEMO1 M-file for toast_demo1.fig
% TOAST_DEMO1, by itself, creates a new TOAST_DEMO1 or raises the
% existing
% singleton*.
%
% H = TOAST_DEMO1 returns the handle to a new TOAST_DEMO1 or the handle to
% the existing singleton*.
%
% ... |
github | toastpp/toastpp-master | toast_demo7.m | .m | toastpp-master/script/matlab/demos/toast_demo7.m | 17,264 | utf_8 | 0923beda0daaafe36aa21bdfe63fa4d2 | function varargout = toast_demo7(varargin)
% TOAST_demo7 M-file for toast_demo7.fig
% TOAST_demo7, by itself, creates a new TOAST_demo7 or raises the existing
% singleton*.
%
% H = TOAST_demo7 returns the handle to a new TOAST_demo7 or the handle to
% the existing singleton*.
%
% TOAST_... |
github | toastpp/toastpp-master | toast_tut1.m | .m | toastpp-master/script/matlab/demos/toast_tut1.m | 7,643 | utf_8 | db2ca1cfab4aba8aa596551cba536bc0 | function toast_tut1
% ======================================================================
% Sample code: reconstruction of absorption image from log amplitude data
% using a Gauss-Newton Krylov solver.
% This version:
% - reconstructs for linear parameters (no log transformation)
% - does not use regularisation
%... |
github | toastpp/toastpp-master | toast_demo3.m | .m | toastpp-master/script/matlab/demos/toast_demo3.m | 10,108 | utf_8 | 65e34f0beb2e6688686ddcb78e18609b | function varargout = toast_demo3(varargin)
% TOAST_DEMO3 M-file for toast_demo3.fig
% TOAST_DEMO3, by itself, creates a new TOAST_DEMO3 or raises the existing
% singleton*.
%
% H = TOAST_DEMO3 returns the handle to a new TOAST_DEMO3 or the handle to
% the existing singleton*.
%
% TOAST_... |
github | toastpp/toastpp-master | toast_demo1a.m | .m | toastpp-master/script/matlab/demos/toast_demo1a.m | 13,015 | utf_8 | 8ac0572d9eff295bc7d9af3f21ce2a5f | function varargout = toast_demo1a(varargin)
% TOAST_demo1a M-file for toast_demo1a.fig
% TOAST_demo1a, by itself, creates a new TOAST_demo1a or raises the existing
% singleton*.
%
% H = TOAST_demo1a returns the handle to a new TOAST_demo1a or the handle to
% the existing singleton*.
%
% ... |
github | toastpp/toastpp-master | toast_demo6.m | .m | toastpp-master/script/matlab/demos/toast_demo6.m | 18,270 | utf_8 | 9f5cc1dc9874a75b889f44df61a7ddc0 | function varargout = toast_demo6(varargin)
% TOAST_DEMO6 M-file for toast_demo6.fig
% TOAST_DEMO6, by itself, creates a new TOAST_DEMO6 or raises the existing
% singleton*.
%
% H = TOAST_DEMO6 returns the handle to a new TOAST_DEMO6 or the handle to
% the existing singleton*.
%
% TOAST_... |
github | toastpp/toastpp-master | toast_demo5.m | .m | toastpp-master/script/matlab/demos/toast_demo5.m | 17,713 | utf_8 | c6197871c560d24cd7ccd4f403bd2073 | function varargout = toast_demo5(varargin)
% TOAST_DEMO5 M-file for toast_demo5.fig
% TOAST_DEMO5, by itself, creates a new TOAST_DEMO5 or raises the existing
% singleton*.
%
% H = TOAST_DEMO5 returns the handle to a new TOAST_DEMO5 or the handle to
% the existing singleton*.
%
% TOAST_... |
github | toastpp/toastpp-master | toast_demo4.m | .m | toastpp-master/script/matlab/demos/toast_demo4.m | 9,822 | utf_8 | 698cbdeafdd1600ecbb99b2b3c3da617 | function varargout = toast_demo4(varargin)
% TOAST_DEMO4 M-file for toast_demo4.fig
% TOAST_DEMO4, by itself, creates a new TOAST_DEMO4 or raises the existing
% singleton*.
%
% H = TOAST_DEMO4 returns the handle to a new TOAST_DEMO4 or the handle to
% the existing singleton*.
%
% TOAST_... |
github | toastpp/toastpp-master | toast_demo2.m | .m | toastpp-master/script/matlab/demos/toast_demo2.m | 18,669 | utf_8 | 228d547046c346db8f56ad273d01b39e | function varargout = toast_demo2(varargin)
% TOAST_DEMO2 M-file for toast_demo2.fig
% TOAST_DEMO2, by itself, creates a new TOAST_DEMO2 or raises the existing
% singleton*.
%
% H = TOAST_DEMO2 returns the handle to a new TOAST_DEMO2 or the handle to
% the existing singleton*.
%
% TOAST_... |
github | toastpp/toastpp-master | toastFields.m | .m | toastpp-master/script/matlab/toast2/toastFields.m | 1,660 | utf_8 | 6f82d7a8bfe0974cf26929553b867d4e | % toastFields - Calculate complex photon density fields
%
% Syntax: phi = toastFields(mesh,basis,qvec,mua,mus,ref,freq,method,tol)
%
% Parameters:
% mesh (toastMesh instance):
% mesh object
% basis (toastBasis instance):
% basis object (set to 0 to return fields in mesh basis)
%... |
github | toastpp/toastpp-master | toastRecon.m | .m | toastpp-master/script/matlab/toast2/toastRecon.m | 12,316 | utf_8 | 43a4a3c80d1faa7b5539f252ae15706b | function toastRecon(prm)
%toastRecon - High-level toast reconstruction function.
%
% Synopsis: toastRecon(prm)
% prm: reconstruction parameter structure
%
% A high-level convenience function which runs a toast reconstruction with
% the parameters defined in prm.
% prm is a toastParam instance containing in... |
github | toastpp/toastpp-master | toastSetVerbosity.m | .m | toastpp-master/script/matlab/toast2/toastSetVerbosity.m | 288 | utf_8 | e80b41f39d601e6a3e393a94345569a7 | %toastSetVerbosity - set the level of diagnostic output
%
% Synopsis: toastSetVerbosity(level)
%
% level: verbosity level (integer >= 0), where 0 is no output, larger
% numbers provide more output.
function toastSetVerbosity(level)
toastmex(uint32(1000),uint32(level));
end
|
github | toastpp/toastpp-master | toastRecon.m | .m | toastpp-master/script/matlab/toast/toastRecon.m | 12,645 | utf_8 | 4cbe7666b5251e67f6716c182f9f6633 | function toastRecon(prm)
%toastRecon - High-level toast reconstruction function.
%
% Synopsis: toastRecon(prm)
% prm: reconstruction parameter structure
%
% Runs a toast reconstruction with the parameters defined in prm.
% prm contains information about measurements, meshes and grids,
% tolerance limits fo... |
github | toastpp/toastpp-master | toastFwdCW.m | .m | toastpp-master/script/matlab/toast/toastFwdCW.m | 4,277 | utf_8 | d36f6bc7ed71f3c8471b26f06ef82d8b | function cwdata = toastFwdCW(prm)
%toastFwdCW - High-level toast diffusion forward model.
%
% Synopsis: cwdata = toastFwd(prm)
% prm: model parameter structure
% cwdata: boundary data (log intensity)
%
% Calculates continuous wave (CW) boundary measurement data,
% given a mesh, optical coefficient dis... |
github | toastpp/toastpp-master | toastReadParam.m | .m | toastpp-master/script/matlab/toast/toastReadParam.m | 4,448 | utf_8 | 773aae08392fa4ee0a61ed0ecdfe4e3c | function prm = toastReadParam(prmfile)
%toastReadParam - Read a TOAST parameter file.
%
% Synopsis: prm = toastReadParam(prmfile)
% prmfile: parameter file name (string)
% prm: parameter structure
%
% This function reads the toast reconstruction parameters used by
% toastRecon from a file and stores the... |
github | toastpp/toastpp-master | toastFwd.m | .m | toastpp-master/script/matlab/toast/toastFwd.m | 6,088 | utf_8 | 53415643988f54f990f1e9183064b962 | function [mdata pdata] = toastFwd(prm)
%toastFwd - High-level toast diffusion forward model.
%
% Synopsis: [mdata pdata] = toastFwd(prm)
% prm: model parameter structure
% mdata: boundary data (log amplitude)
% pdata: boundary data (phase)
%
% Calculates boundary measurement data, given a mesh, o... |
github | toastpp/toastpp-master | toastReconMultispectralCW.m | .m | toastpp-master/script/matlab/toast/toastReconMultispectralCW.m | 10,041 | utf_8 | 5dfa70ebf35aa4437f01a4e78e719510 | function toastReconMultispectralCW(prm)
%toastReconMultispectralCW - Multispectral reconstruction from CW data.
%
% Synopsis: toastReconMultispectralCW(prm)
% prm: reconstruction parameter structure
%
% Runs a toast reconstruction with the parameters defined in prm.
% prm contains information about measurements, mes... |
github | toastpp/toastpp-master | toastWriteParam.m | .m | toastpp-master/script/matlab/toast/toastWriteParam.m | 5,558 | utf_8 | ae4a29775dbbdb0f8cf38ddba0dfcdae | function toastWriteParam (prmfile, prm)
%toastWriteParam - Write parameters to a TOAST parameter file.
%
% Synopsis: toastWriteParam(prmfile,prm)
% prmfile: parameter file name (string)
% prm: parameter structure
%
% This function writes the parameters in a standard TOAST parameter
% structure to a file.... |
github | toastpp/toastpp-master | cylphantom.m | .m | toastpp-master/test/3D/matlab/cylphantom.m | 4,904 | utf_8 | ffdc26488929fe41181c1f68fd802323 | function [mua mus] = cylphantom(nx,ny,nz,mode)
mua = ones(nx,ny,nz) * 0.01;
mus = ones(nx,ny,nz) * 1;
% geometry
cnt1 = [0.5 0.5 0.3];
rad1 = [0.3 0.15 0.3];
phi1 = 0;
theta1 = pi/3;
cnt2 = [0.5 0.3 0.7];
rad2 = 0.15;
cnt3 = [0.35 0.7 0.75];
rad3 = 0.07;
cnt4 ... |
github | toastpp/toastpp-master | headphantom.m | .m | toastpp-master/test/3D/matlab/headphantom.m | 2,810 | utf_8 | 91507c2a3c00d5e07a134be0866be63a | function [mua mus] = headphantom(hMesh,nx,ny,nz,mode)
mua = ones(nx,ny,nz) * 0.01;
mus = ones(nx,ny,nz) * 1;
% geometry
cnt1 = [0.4 0.7 0.4];
rad1 = 0.15;
cnt2 = [0.7 0.8 0.6];
rad2 = 0.12;
switch mode
case 1 % 'truth' prior
v1 = 0.02;
mua = Dra... |
github | toastpp/toastpp-master | reconCW2.m | .m | toastpp-master/test/2D/matlab/reconCW2.m | 7,149 | utf_8 | 81fdff99bae186a3b988d382ea19741f | function reconCW2
% Sample code: reconstruction of absorption image from log amplitude data
% using a Gauss-Newton Krylov solver.
% This version:
% - reconstructs for log mua parameters
% - does not use regularisation
% - uses noise-free data
disp('MATLAB-TOAST sample script:')
disp('2D image reconstruction with G... |
github | toastpp/toastpp-master | reconCW1.m | .m | toastpp-master/test/2D/matlab/reconCW1.m | 7,055 | utf_8 | 698c3535f4468bf2d314789e9cbf509f | function reconCW1
% Sample code: reconstruction of absorption image from log amplitude data
% using a Gauss-Newton Krylov solver.
% This version:
% - reconstructs for linear parameters (no log transformation)
% - does not use regularisation
% - uses noise-free data
disp('MATLAB-TOAST sample script:')
disp('2D imag... |
github | whitefusion/Dealiasing-master | matrix_mult.m | .m | Dealiasing-master/code/matrix_mult.m | 1,207 | utf_8 | 522ff7981da427838515dc1368fff6a0 | %% function form of matrix multiplication
% ----- a : high resolution image
% ----- delta: movement
% ----- k : inverse of upsample factor (if upsample factor = 3 , k = 1/3)
function [downsample,coeff,result_conv] = matrix_mult(a,delta,k)
part = mod(abs(delta),k)/k;
shift = fix(delta/k);
coeff = ones(1,(... |
github | whitefusion/Dealiasing-master | readImg.m | .m | Dealiasing-master/code/readImg.m | 4,786 | utf_8 | 8bf3c1dced037927e2be95362d6d7b4d | %[data,header]=readImg(fName,framesToRead)
%
%-fName is the base file name for the (header,binary) pair of files. Can
% include the .hdr or .img extension.
%-framesToRead is optional. If provided, it is assumed to be an array
% containing the indices of frames to be read. Any repeatitions are
% removed from the... |
github | whitefusion/Dealiasing-master | reconRow.m | .m | Dealiasing-master/code/reconRow.m | 1,354 | utf_8 | 785d11842ab26d1bd1b8e5279442dc45 | % do reconstruction on a single row
% ----- a0: high resolution image
% ----- downset: low resolution sequence
% ----- k : downsample factor
% ----- s_set: movement set
% return ---- a0: updated(reconstruted result)
% -----r : residue
function [a0,r] = reconRow(a0,downset,k,s_set)
%% functional form
% a sequenc... |
github | whitefusion/Dealiasing-master | matrix_T_mult.m | .m | Dealiasing-master/code/matrix_T_mult.m | 1,812 | utf_8 | 0709474b596f60561ef8b580921c3aa8 | % the function that performs transpose matrix multiplication given downsample factor
% and movement
% ----- downsample: low resolution image
% ----- k : downsample factor
% ----- delta: movement
function temp_upsamp = matrix_T_mult(downsample,k,delta)
part = mod(abs(delta),k)/k;
coeff = ones(1,(1/k)+1);
sh... |
github | whitefusion/Dealiasing-master | estimate_shift.m | .m | Dealiasing-master/code/estimate_shift.m | 549 | utf_8 | bdd084eebc9a0a94f594523a71132ee8 | % This function estimate shift using dft registration algorithm, the output
% contain the info of horizontal and vertical translation.
% ----- dataset : low resolution sequence except the first image(moving image)
% ----- ref : the reference image ( the first image at sequence)
function s_set = estimate_shift(dataset,... |
github | whitefusion/Dealiasing-master | im.m | .m | Dealiasing-master/code/im.m | 4,170 | utf_8 | cc703594d408f2c3e3a5be51a9f2a5c2 |
function [imhh,txhh,lnhh]=im(A,varargin)
% [imh,txh,lnh]=IM(A,'name1',val1,...) - Displays an image of the stack of
% 2D images in 3-dimensional array A. Optionally returns image, test,
% and line handles.
%
% Can specify plot properties in command:
% NAME,VAL Default Function
% =========... |
github | whitefusion/Dealiasing-master | dftregistration.m | .m | Dealiasing-master/code/efficient_subpixel_registration/dftregistration.m | 8,234 | utf_8 | 7dc727aebf333c1a5cef2b2821265218 |
function [output Greg] = dftregistration(buf1ft,buf2ft,usfac)
% function [output Greg] = dftregistration(buf1ft,buf2ft,usfac);
% Efficient subpixel image registration by crosscorrelation. This code
% gives the same precision as the FFT upsampled cross correlation in a
% small fraction of the computation time an... |
github | DataMining4Science/coursera-ml-class-master | submit.m | .m | coursera-ml-class-master/mlclass-ex8/submit.m | 17,515 | utf_8 | 2949fbde41e47f99c42171e2e0a39efc | function submit(partId, webSubmit)
%SUBMIT Submit your code and output to the ml-class servers
% SUBMIT() will connect to the ml-class server and submit your solution
fprintf('==\n== [ml-class] Submitting Solutions | Programming Exercise %s\n==\n', ...
homework_id());
if ~exist('partId', 'var') || isem... |
github | DataMining4Science/coursera-ml-class-master | submitWeb.m | .m | coursera-ml-class-master/mlclass-ex8/submitWeb.m | 807 | utf_8 | a53188558a96eae6cd8b0e6cda4d478d | % submitWeb Creates files from your code and output for web submission.
%
% If the submit function does not work for you, use the web-submission mechanism.
% Call this function to produce a file for the part you wish to submit. Then,
% submit the file to the class servers using the "Web Submission" button on the ... |
github | DataMining4Science/coursera-ml-class-master | submit.m | .m | coursera-ml-class-master/mlclass-ex6/submit.m | 16,836 | utf_8 | d4c87e5dbf32a81bdaf04fd017fe4cb3 | function submit(partId, webSubmit)
%SUBMIT Submit your code and output to the ml-class servers
% SUBMIT() will connect to the ml-class server and submit your solution
fprintf('==\n== [ml-class] Submitting Solutions | Programming Exercise %s\n==\n', ...
homework_id());
if ~exist('partId', 'var') || isem... |
github | DataMining4Science/coursera-ml-class-master | porterStemmer.m | .m | coursera-ml-class-master/mlclass-ex6/porterStemmer.m | 9,902 | utf_8 | 7ed5acd925808fde342fc72bd62ebc4d | function stem = porterStemmer(inString)
% Applies the Porter Stemming algorithm as presented in the following
% paper:
% Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14,
% no. 3, pp 130-137
% Original code modeled after the C version provided at:
% http://www.tartarus.org/~martin/PorterStemmer/c.tx... |
github | DataMining4Science/coursera-ml-class-master | submitWeb.m | .m | coursera-ml-class-master/mlclass-ex6/submitWeb.m | 827 | utf_8 | bfb2fa08cac9d8d797e3071d3fdd7ca1 | % submitWeb Creates files from your code and output for web submission.
%
% If the submit function does not work for you, use the web-submission mechanism.
% Call this function to produce a file for the part you wish to submit. Then,
% submit the file to the class servers using the "Web Submission" button on ... |
github | DataMining4Science/coursera-ml-class-master | submit.m | .m | coursera-ml-class-master/mlclass-ex4/submit.m | 17,129 | utf_8 | 917c487f37cf14037c77e3c57ad78ce1 | function submit(partId, webSubmit)
%SUBMIT Submit your code and output to the ml-class servers
% SUBMIT() will connect to the ml-class server and submit your solution
fprintf('==\n== [ml-class] Submitting Solutions | Programming Exercise %s\n==\n', ...
homework_id());
if ~exist('partId', 'var') || isem... |
github | DataMining4Science/coursera-ml-class-master | submitWeb.m | .m | coursera-ml-class-master/mlclass-ex4/submitWeb.m | 827 | utf_8 | bfb2fa08cac9d8d797e3071d3fdd7ca1 | % submitWeb Creates files from your code and output for web submission.
%
% If the submit function does not work for you, use the web-submission mechanism.
% Call this function to produce a file for the part you wish to submit. Then,
% submit the file to the class servers using the "Web Submission" button on ... |
github | DataMining4Science/coursera-ml-class-master | submit.m | .m | coursera-ml-class-master/mlclass-ex1/submit.m | 17,317 | utf_8 | 14dfeccc6eb749406cb5d77fabb6bf47 | function submit(partId, webSubmit)
%SUBMIT Submit your code and output to the ml-class servers
% SUBMIT() will connect to the ml-class server and submit your solution
fprintf('==\n== [ml-class] Submitting Solutions | Programming Exercise %s\n==\n', ...
homework_id());
if ~exist('partId', 'var') || isem... |
github | DataMining4Science/coursera-ml-class-master | submitWeb.m | .m | coursera-ml-class-master/mlclass-ex1/submitWeb.m | 827 | utf_8 | bfb2fa08cac9d8d797e3071d3fdd7ca1 | % submitWeb Creates files from your code and output for web submission.
%
% If the submit function does not work for you, use the web-submission mechanism.
% Call this function to produce a file for the part you wish to submit. Then,
% submit the file to the class servers using the "Web Submission" button on ... |
github | DataMining4Science/coursera-ml-class-master | submit.m | .m | coursera-ml-class-master/mlclass-ex2/submit.m | 17,086 | utf_8 | 7b02ce6b9daa919a9a66ef0adb401b07 | function submit(partId, webSubmit)
%SUBMIT Submit your code and output to the ml-class servers
% SUBMIT() will connect to the ml-class server and submit your solution
fprintf('==\n== [ml-class] Submitting Solutions | Programming Exercise %s\n==\n', ...
homework_id());
if ~exist('partId', 'var') || isem... |
github | DataMining4Science/coursera-ml-class-master | submitWeb.m | .m | coursera-ml-class-master/mlclass-ex2/submitWeb.m | 827 | utf_8 | bfb2fa08cac9d8d797e3071d3fdd7ca1 | % submitWeb Creates files from your code and output for web submission.
%
% If the submit function does not work for you, use the web-submission mechanism.
% Call this function to produce a file for the part you wish to submit. Then,
% submit the file to the class servers using the "Web Submission" button on ... |
github | DataMining4Science/coursera-ml-class-master | submit.m | .m | coursera-ml-class-master/mlclass-ex3/submit.m | 17,041 | utf_8 | 07a62d95df0814b4ffbc6c2f4b433e22 | function submit(partId, webSubmit)
%SUBMIT Submit your code and output to the ml-class servers
% SUBMIT() will connect to the ml-class server and submit your solution
fprintf('==\n== [ml-class] Submitting Solutions | Programming Exercise %s\n==\n', ...
homework_id());
if ~exist('partId', 'var') || isem... |
github | DataMining4Science/coursera-ml-class-master | submitWeb.m | .m | coursera-ml-class-master/mlclass-ex3/submitWeb.m | 827 | utf_8 | bfb2fa08cac9d8d797e3071d3fdd7ca1 | % submitWeb Creates files from your code and output for web submission.
%
% If the submit function does not work for you, use the web-submission mechanism.
% Call this function to produce a file for the part you wish to submit. Then,
% submit the file to the class servers using the "Web Submission" button on ... |
github | DataMining4Science/coursera-ml-class-master | submit.m | .m | coursera-ml-class-master/mlclass-ex5/submit.m | 17,211 | utf_8 | 057662350ffa8db95583373185a26a6b | function submit(partId, webSubmit)
%SUBMIT Submit your code and output to the ml-class servers
% SUBMIT() will connect to the ml-class server and submit your solution
fprintf('==\n== [ml-class] Submitting Solutions | Programming Exercise %s\n==\n', ...
homework_id());
if ~exist('partId', 'var') || isem... |
github | DataMining4Science/coursera-ml-class-master | submitWeb.m | .m | coursera-ml-class-master/mlclass-ex5/submitWeb.m | 827 | utf_8 | bfb2fa08cac9d8d797e3071d3fdd7ca1 | % submitWeb Creates files from your code and output for web submission.
%
% If the submit function does not work for you, use the web-submission mechanism.
% Call this function to produce a file for the part you wish to submit. Then,
% submit the file to the class servers using the "Web Submission" button on ... |
github | DataMining4Science/coursera-ml-class-master | submit.m | .m | coursera-ml-class-master/mlclass-ex7/submit.m | 16,958 | utf_8 | cd11307f72915c0d3b58176b66081197 | function submit(partId, webSubmit)
%SUBMIT Submit your code and output to the ml-class servers
% SUBMIT() will connect to the ml-class server and submit your solution
fprintf('==\n== [ml-class] Submitting Solutions | Programming Exercise %s\n==\n', ...
homework_id());
if ~exist('partId', 'var') || isem... |
github | DataMining4Science/coursera-ml-class-master | submitWeb.m | .m | coursera-ml-class-master/mlclass-ex7/submitWeb.m | 827 | utf_8 | bfb2fa08cac9d8d797e3071d3fdd7ca1 | % submitWeb Creates files from your code and output for web submission.
%
% If the submit function does not work for you, use the web-submission mechanism.
% Call this function to produce a file for the part you wish to submit. Then,
% submit the file to the class servers using the "Web Submission" button on ... |
github | meco-group/gilc-master | pendulum_dynamics.m | .m | gilc-master/matlab/examples/pendulum_dynamics.m | 1,467 | utf_8 | 0888b32e4323eb19e363718a4f0899c3 | % This file is part of gILC.
%
% gILC - Generic Iterative Learning Control for Nonlinear Systems
% Copyright (C) 2012 Marnix Volckaert, KU Leuven
% 2016 Armin Steinhauser, KU Leuven
%
% gILC is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as p... |
github | paynterf/MagCalTool-master | MgnCalibration.m | .m | MagCalTool-master/MgnCalibration.m | 2,839 | utf_8 | 0b5e1c93ae41b7bbabf51fb4be371722 | function [U,c] = MgnCalibration(X)
% performs magnetometer calibration from a set of data
% using Merayo technique with a non iterative algoritm
% J.Merayo et al. "Scalar calibration of vector magnemoters"
% Meas. Sci. Technol. 11 (2000) 120-132.
%
% X : a Nx3 (or 3xN) data matrix
% each row ... |
github | prashanth-prakash/wheel-msi-master | refer.m | .m | wheel-msi-master/refer.m | 545 | utf_8 | de4492b0ba7a23aea4f8eab2518a4cc1 |
function tr = refer(x)
% x=10;
ref=[];
fr = [];
y=[0.5 1 2 3 4];
Y=y*x;
for value = Y
if(value>4)
if(value<31)
fr = [fr value];
end
end
end
n=length(fr);
tr=zeros(2*n,532);
i=1;
while i<=n
for t=1:532;
ref(1,t)=sin(2*pi*fr(i)*t/256);
ref(2,t)=cos(2... |
github | mingyuliutw/CoGAN-master | classification_demo.m | .m | CoGAN-master/caffe/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | JoepVanlier/mexNL2SOL-master | compileNL2SOL.m | .m | mexNL2SOL-master/compileNL2SOL.m | 3,518 | utf_8 | 7ad1b4f3d267182d47aac59f8c6863c0 | % This function compiles the NL2SOL code with the mex wrapper.
% It should be called to produce a mex file which is callable. Note that this requires
% both a C compiler as well as a FORTRAN compiler to be available on the system.
%
% NL2SOL is part of the PORT library. More specifically:
% Algorithm 573: NL2SOL—An ... |
github | eldar/deepcut-master | plotRPC.m | .m | deepcut-master/lib/eval/plotRPC.m | 887 | utf_8 | 75731508a8dcc258648c8f8ef8f4e3c8 | % function [precision, recall, sorted_scores] = plotRPC(class_margin, true_labels, totalpos, colorVal, lineType, legendName, bPlot)
function [precision, recall] = plotRPC(precision, recall, colorVal, lineType, titleName)
% if (nargin < 7)
% bPlot = true;
% end
%
% N = length(true_labels);
% ndet = N;
%
% npos = ... |
github | eldar/deepcut-master | loadannotations.m | .m | deepcut-master/lib/utils/loadannotations.m | 11,369 | utf_8 | 392f3a17873054d2d579f0fc387c56ea | % This file is part of the implementation of the human pose estimation model as described in the paper:
% Leonid Pishchulin, Micha Andriluka, Peter Gehler and Bernt Schiele
% Strong Appearance and Expressive Spatial Models for Human Pose Estimation
% IEEE International Conference on Computer Vision (ICCV'13), Sydn... |
github | eldar/deepcut-master | saveannotations.m | .m | deepcut-master/lib/utils/saveannotations.m | 6,660 | utf_8 | 2248f8d4d6b563c873685a6572f11862 | % annotations - annotation list
% outputfilename
% rescale_factor - rescale all annorects by this factor (default = 1)
% score_factor - multiply all scores by this factor (default = 1)
% abs_path - if false all image filenames will be saved as relative (default = true)
%
%function saveannotations(annotations, outputfil... |
github | eldar/deepcut-master | struct2xml.m | .m | deepcut-master/lib/utils/struct2xml.m | 850 | utf_8 | b288fae1b1afdf0a28081ae46eb06901 | function res = struct2xml(s)
res = [];
names = fieldnames(s);
nl_char = sprintf('\n');
for i = 1:length(names)
% skip empty fields
if isempty(s.(names{i}))
continue;
end
if isnumeric(s.(names{i}))
if length(s.(names{i})) > 1
%warning(['ignoring field ' names{i} ': arrays ar... |
github | eldar/deepcut-master | extract_pair_distribution.m | .m | deepcut-master/lib/utils/extract_pair_distribution.m | 308 | utf_8 | c7eb1fdcd5799f3be2f375c01c92958c | function [ res ] = extract_pair_distribution( p, distr, j1, j2 )
num_c = p.idpr_num_clusters;
res = distr(idpr_joint_range(j1, num_c), idpr_joint_range(j2, num_c));
end
function res = idpr_joint_range(joint_no, num_clusters)
s = sum(num_clusters(1:joint_no-1));
res = s+1:s+num_clusters(joint_no);
end |
github | eldar/deepcut-master | splitpath.m | .m | deepcut-master/lib/utils/splitpath.m | 275 | utf_8 | a8d0a1a2b7ae9fd710b9fbd1f4aee9aa | %function [path, filename] = splitpath(str)
function [path, filename] = splitpath(str)
slashidx = strfind(str, '/');
if isempty(slashidx)
path = [];
filename = str;
else
path = str(1:slashidx(end)-1);
filename = str(slashidx(end)+1:end);
end
end |
github | eldar/deepcut-master | rcnn_scoremaps_save.m | .m | deepcut-master/lib/utils/rcnn_scoremaps_save.m | 2,725 | utf_8 | f2033832f2feceb670aea15a8966f297 | function rcnn_scoremaps_save(config, rcnn_model_file)
root_dir = config.dataset_root_dir;
imdb_test = config.imdb_func(root_dir, 'test', config);
roidb = imdb_test.roidb_func(imdb_test);
fprintf('loading model\n');
rcnn_model = rcnn_load_model(rcnn_model_file, true);
scoremaps = []; cnt = 1;
for i =... |
github | eldar/deepcut-master | splitpathext.m | .m | deepcut-master/lib/utils/splitpathext.m | 309 | utf_8 | 4487c41eda32b5a5a798fd8aabf98349 | % function [path, filename, ext] = splitpathext(str)
function [path, filename, ext] = splitpathext(str)
[path, filename] = splitpath(str);
ptidx = strfind(filename, '.');
if isempty(ptidx)
ext = [];
else
ext = filename(ptidx(end)+1:end);
filename = filename(1:ptidx(end)-1);
end
end |
github | eldar/deepcut-master | padZeros.m | .m | deepcut-master/lib/utils/padZeros.m | 162 | utf_8 | ea6d175507a2fb18a438ef49cc8c418c | %
% function res = padZeros(str, npad)
%
function res = padZeros(str, npad)
n = length(str);
assert(n <= npad);
res = [repmat('0', 1, npad - n) str];
|
github | eldar/deepcut-master | compute_idpr_entropy.m | .m | deepcut-master/lib/utils/compute_idpr_entropy.m | 413 | utf_8 | 88b0b7c6ea2e4aebcc7a7921ba0a2e87 | function e = compute_idpr_entropy( distr )
e1 = 0;
for i = 1:size(distr, 1)
e1 = e1 + compute_entropy(distr(i,:));
end
e1 = e1/size(distr, 1)
e2 = 0;
for i = 1:size(distr, 2)
e2 = e2 + compute_entropy(distr(:,i));
end
e2 = e2/size(distr, 2)
e = compute_entropy(distr(:));
end
function e = compute_entropy(... |
github | eldar/deepcut-master | rcnn_scoremaps.m | .m | deepcut-master/lib/utils/rcnn_scoremaps.m | 1,760 | utf_8 | 5d5019e867afca5093dd9ff781ac49a9 | function rcnn_scoremaps(config, rcnn_model_file)
root_dir = config.dataset_root_dir;
imdb_test = config.imdb_func(root_dir, 'test', config);
roidb = imdb_test.roidb_func(imdb_test);
rcnn_model = rcnn_load_model(rcnn_model_file, true);
fh = figure;
for i = 1:numel(roidb.rois), image = imdb_test.image_a... |
github | eldar/deepcut-master | find_conn_comp.m | .m | deepcut-master/lib/multicut/find_conn_comp.m | 2,401 | utf_8 | 960673364e91687bab5704ded197784a | % Algorithm for finding connected components in a graph
% Valid for undirected graphs only
% INPUTS: adj - adjacency matrix
% OUTPUTS: a list of the components comp{i}=[j1,j2,...jk}
% Other routines used: find_conn_compI.m (embedded), degrees.m, kneighbors.m
% GB, Last updated: October 2, 2009
function comp_mat = fi... |
github | eldar/deepcut-master | compute_simple_feature.m | .m | deepcut-master/lib/multicut/hdf5/compute_simple_feature.m | 1,126 | utf_8 | eb14e9ceda4c1fc190053fd1394db1f6 | function feature = compute_simple_feature(det,frame_rate_norm)
% compute spatial-temporal feature between two detections
% needs to be normalized by frame rate
det1 = det(1,:);
det2 = det(2,:);
[h1,xCenter1,yCenter1, t1] = get_detail(det1);
[h2,xCenter2,yCenter2, t2] = get_detail(det2);
h_cmp = (h1+h2)/2;
offset_t =... |
github | eldar/deepcut-master | displayKeypoints.m | .m | deepcut-master/lib/vis/displayKeypoints.m | 490 | utf_8 | b084b820d89f95b219578f27bc838ae2 | function res = displayKeypoints(imidx, keypointsAll, stuff)
im = imread(keypointsAll(imidx).imgname);
joints_orig = keypoints2joints(stuff.keypointsAll(imidx).det);
joints_tomp = keypoints2joints(keypointsAll(imidx).det);
figure(1);
vis_pred(im, joints_orig);
figure(2);
vis_pred(im, joint... |
github | eldar/deepcut-master | vis_multicut_pipeline.m | .m | deepcut-master/lib/vis/vis_multicut_pipeline.m | 13,985 | utf_8 | 327b7b348f7ad5f5703796e92d0649f5 | function vis_multicut_pipeline(expidx,firstidx,nImgs)
p = exp_params(expidx);
multicutDir = p.multicutDir;
fprintf('multicutDir: %s\n',multicutDir);
keypointsDir = multicutDir;
resDir = multicutDir;
visDir = [multicutDir '/vis/'];
if (isfield(p,'testGTnopad'))
load(p.testGTnopad,'annolist');
bProject = true;... |
github | eldar/deepcut-master | vis_combined_scoremap.m | .m | deepcut-master/lib/vis/vis_combined_scoremap.m | 2,126 | utf_8 | c3d471485d0356d320e645db20c86152 | function vis_combined_scoremap(expidx, img_idx, ends)
p = exp_params(expidx);
load(p.testGT)
im_fn = annolist(img_idx).image.name;
[~,im_name,~] = fileparts(im_fn);
im = imread(im_fn);
scmap_name = fullfile(p.unary_scoremap_dir, [im_name '.mat']);
load(scmap_name, 'scoremaps');
colors = [1 0 1; 1 1 0; 0 1 1; 1 0 0;... |
github | eldar/deepcut-master | get_spatial_features_same_part_regr.m | .m | deepcut-master/lib/pose/get_spatial_features_same_part_regr.m | 10,603 | utf_8 | 5e1089bf41651ac6a725187381d0c65c | function [X_pos, keys_pos, boxes_pos, X_neg, keys_neg, boxes_neg] = get_spatial_features_same_part_regr(expidx,cidx)
RandStream.setGlobalStream ...
(RandStream('mt19937ar','seed',42));
p = exp_params(expidx);
fprintf('cidx: %d\n',cidx);
save_file = [p.pairwiseDir '/feat_spatial_cidx_' num2str(cidx) '.mat'];... |
github | eldar/deepcut-master | visualise_pairwise_probabilities.m | .m | deepcut-master/lib/pose/visualise_pairwise_probabilities.m | 11,319 | utf_8 | 1fa773ddf944a43ab5e8c3feeb112917 | function pw_prob = visualise_pairwise_probabilities(expidx,firstidx,nImgs, cidx1, cidx2, bVis)
if (ischar(expidx))
expidx = str2num(expidx);
end
if (nargin < 2)
firstidx = 1;
end
if (ischar(firstidx))
firstidx = str2num(firstidx);
end
if (nargin < 3)
nImgs = 1;
elseif ischar(nImgs)
nImgs = str2n... |
github | eldar/deepcut-master | get_sticks_segmentation.m | .m | deepcut-master/lib/pose/get_sticks_segmentation.m | 4,247 | utf_8 | f4a731fa6576a5a11c36a2745382758f | function [ scmap_all,poly ] = get_sticks_segmentation( p, im, joints )
stride = 4; %p.stride;
half_stride = stride/2;
scale_factor = p.scale_factor;
sz = 17;
scmap_height = ceil(size(im, 1) * scale_factor / stride);
scmap_width = ceil(size(im, 2) * scale_factor / stride);
joint_pairs = [1 2; 2 3; 6 5; 4 5; 7 8; 8 9;... |
github | eldar/deepcut-master | cnn_process_image.m | .m | deepcut-master/lib/pose/cnn_process_image.m | 2,082 | utf_8 | 632db58540a4487242a82f56f5b16d83 | function [feat_prob, locreg_pred, next_pred, rpn_prob, rpn_bbox] = cnn_process_image(input, net, sigmoid)
% switch width and height for Caffe
input = permute(input, [2 1 3]);
blob_size = [size(input), 1];
net.blobs('data').reshape(blob_size);
blob_size = [size(input), 1];
batch = zeros(b... |
github | eldar/deepcut-master | cnn_process_image_tiled.m | .m | deepcut-master/lib/pose/cnn_process_image_tiled.m | 4,143 | utf_8 | 841d103bf3af203f69b73b6329b4d543 | function [scoremaps, locreg_pred, nextreg_pred] = cnn_process_image_tiled(input, net, sigmoid, im_bg_width, im_bg_height, stride)
max_size = 1000;
rf = 224; %receptive field
cut_off = rf/stride;
num_tiles_x = get_num_tiles(im_bg_width, max_size);
num_tiles_y = get_num_tiles(im_bg_height, max_size)... |
github | eldar/deepcut-master | test_spatial_app_neighbour.m | .m | deepcut-master/lib/pose/test_spatial_app_neighbour.m | 19,302 | utf_8 | be33e2ff5c3e9305cd2656d24cd4827b | function test_spatial_app_neighbour(expidx,firstidx,nImgs,bRecompute,bVis)
fprintf('test_spatial_hist()\n');
if (ischar(expidx))
expidx = str2num(expidx);
end
if (ischar(firstidx))
firstidx = str2num(firstidx);
end
if (nargin < 2)
firstidx = 1;
end
if (nargin < 3)
nImgs = 1;
elseif ischar(nImgs)
... |
github | eldar/deepcut-master | compute_rotation_classes.m | .m | deepcut-master/lib/pose/compute_rotation_classes.m | 4,547 | utf_8 | 5b12622ed83d02ed1ac467ab23c53be2 | function compute_rotation_classes(expidx, image_set)
fprintf('rcnn_compute_rotation_classes()\n');
p = exp_params(expidx);
pidxs = p.pidxs;
[~,parts] = util_get_parts24();
num_joints = length(pidxs);
spatidxs = {[22 17],[22 16],[22 23],[22 4],[22 5],[16 14],[17 19],[4 2],[5 7],[2 0],[7 9],[14 12],[19 21]};
% conv... |
github | eldar/deepcut-master | get_spatial_features_diff_dx_dy.m | .m | deepcut-master/lib/pose/get_spatial_features_diff_dx_dy.m | 4,592 | utf_8 | 4123447d22fef99629103f2f683e149f | % ------------------------------------------------------------------------
function [X_pos, keys_pos, boxes_pos, X_neg, keys_neg, boxes_neg] = get_spatial_features_diff_dx_dy(imgidxs, p, gt_roidb, cidxs, bVis, annolist)
% -----------------------------------------------------------------------
scale = p.scale;
nFeatSam... |
github | eldar/deepcut-master | get_spatial_features_diff_dx_dy_dense.m | .m | deepcut-master/lib/pose/get_spatial_features_diff_dx_dy_dense.m | 6,867 | utf_8 | 35bfc0cf26d5571d5d49eee9d92a01a6 | % ------------------------------------------------------------------------
function [X_pos, keys_pos, boxes_pos, X_neg, keys_neg, boxes_neg] = get_spatial_features_diff_dx_dy_dense(expidx,cidx)
% -----------------------------------------------------------------------
RandStream.setGlobalStream ...
(RandStream(... |
github | eldar/deepcut-master | cnn_test_dense_unaries.m | .m | deepcut-master/lib/pose/cnn_test_dense_unaries.m | 11,148 | utf_8 | 0b029fec933f831ec03cf05dc45363ec | function cnn_test_dense_unaries( expidx, image_set, bVis, firstidx, nImgs, net_bin_file_param)
p = exp_params(expidx);
if (nargin < 4)
firstidx = 1;
elseif ischar(firstidx)
firstidx = str2num(firstidx);
end
if strcmp(image_set, 'test')
load(p.testGT)
else
load(p.trainGT)
end
num_images = size(annoli... |
github | eldar/deepcut-master | get_spatial_features_neighbour.m | .m | deepcut-master/lib/pose/get_spatial_features_neighbour.m | 9,092 | utf_8 | 6d15c0b010028e31ed9f6f88c46c18f7 | function [X_pos, keys_pos, boxes_pos, X_neg, keys_neg, boxes_neg] = get_spatial_features_neighbour(expidx,cidx)
RandStream.setGlobalStream ...
(RandStream('mt19937ar','seed',42));
p = exp_params(expidx);
allpairs = isfield(p, 'allpairs') && p.allpairs;
if allpairs
load(p.pairwise_relations, 'graph');
... |
github | eldar/deepcut-master | cnn_prepare_dense_training_data.m | .m | deepcut-master/lib/pose/cnn_prepare_dense_training_data.m | 4,255 | utf_8 | 005582247732cb038b153d3a58704def | function cnn_prepare_dense_training_data( expidx, start_idx, text )
if nargin < 2
start_idx = 0;
end
if nargin < 3
text = true;
end
p = exp_params(expidx);
pidxs = p.pidxs;
num_joints = length(pidxs);
if p.person_part
num_joints = num_joints+1;
end
parts = get_parts();
% load annolist
load(p.trainGT);
... |
github | eldar/deepcut-master | get_augm_spatial_features_diff_neighbour_locref.m | .m | deepcut-master/lib/pose/multicut/get_augm_spatial_features_diff_neighbour_locref.m | 1,250 | utf_8 | 0c6289652148d58a16c9cb64eb4543d6 | function featAugm = get_augm_spatial_features_diff_neighbour_locref(feat)
% relative coord of 2 detections
delta = feat(:, 1:2);
a = compute_angle(delta(:,1), delta(:,2));
delta_forward = feat(:, 5:6);
a_forward = compute_angle(delta_forward(:,1), delta_forward(:,2));
delta1 = delta - delta_forward;
dist1 = sqrt(del... |
github | eldar/deepcut-master | get_augm_spatial_features_diff_neighbour.m | .m | deepcut-master/lib/pose/multicut/get_augm_spatial_features_diff_neighbour.m | 1,575 | utf_8 | 8965be1171257cacb83e148b4a6bf061 | function featAugm = get_augm_spatial_features_diff_neighbour(feat, p)
if nargin < 2
one_direction = false;
no_angle = false;
else
one_direction = isfield(p, 'pairwise_one_direction') && p.pairwise_one_direction;
no_angle = isfield(p, 'pairwise_no_angle') && p.pairwise_no_angle;
end
% relative coord of... |
github | eldar/deepcut-master | get_augm_spatial_features_same_regr.m | .m | deepcut-master/lib/pose/multicut/get_augm_spatial_features_same_regr.m | 524 | utf_8 | 7d7107724600a0ee89da688c3d3b2df0 | function featAugm = get_augm_spatial_features_same_regr(feat)
% relative coord of 2 detections
deltaX = feat(:, 1);
deltaY = feat(:, 2);
dist_sq = deltaX.^2 +deltaY.^2;
dist = sqrt(dist_sq);
featAugm = cat(2, dist, dist_sq);
end
function angle = compute_angle(deltaX, deltaY)
angle = atan2(deltaY,deltaX);
angle = wr... |
github | arokem/V1_MT_model-master | circularize.m | .m | V1_MT_model-master/circularize.m | 355 | utf_8 | 76c4e5f551bec7c9beef43294f107d50 | %function out=circularize(in)
%
%Maps the input to the interval [0,2pi], such that negative values are
%mapped as 2pi-in
function out=circularize(in)
out=in;
for k=1:length(out)
while out(k)<0 || out(k)>2*pi
if out(k)>2*pi
out(k)=out(k)-2*pi;
elseif out(k)<0
out(k)=2*pi-ab... |
github | SushmaDG/Surveillance-Robot-master | speed_control.m | .m | Surveillance-Robot-master/src/grizzly_simulator/scripts/speed_control.m | 3,380 | utf_8 | 4e985227ec77c48a150a4f90e7e8e81e | function speed_control()
%%% Constants
r = 0.32; % [m] Wheel radius
N = 50; % Gear reduction
V_max = 48; % [V] Max voltage
i_cont = 100; % [A] Max continuous current
i_max = 200; % [A] Max current
Kv = 77; % [RPM/V] Motor constant
Kt = 0.13; % [Nm/A] Motor constant
Ra = 0.010; % [ohm] Coil ... |
github | LucvW/PositioningTIPS-master | getArduinoData.m | .m | PositioningTIPS-master/getArduinoData.m | 2,542 | utf_8 | c15b40b84e0c03dd3d6c3a12ee8222cc | % Readout arduino
% Uses functions setupSerial and readTemp provided by http://www.instructables.com/id/Arduino-and-Matlab-let-them-talk-using-serial-comm/step3/Matlab-lets-tame-the-beast/
% C. Treffers & L. van Wietmarschen, TU Delft 14-6-2016
function [position, normal, error] = getArduinoData(arduino)
% This f... |
github | huxiaoman7/Numerical-Analysis-code-master | chebyshev_interp.m | .m | Numerical-Analysis-code-master/Chapter4/chebyshev_interp.m | 2,924 | utf_8 | cacc8e146bcccb3c262aaebbc37ddb21 | function [nodes, fcn_values, div_diff_fcn] = chebyshev_interp(n)
% This creates an interpolant of order n to the function
% fcn(x) on [-1,1], which is given below as a function
% subprogram. The nodes are the Chebyshev zeroes of the
% degree n+1 Chebyshev polynomial on [-1,1]. The program
% gives two plots: first ... |
github | huxiaoman7/Numerical-Analysis-code-master | ncs.m | .m | Numerical-Analysis-code-master/Chapter4/ncs.m | 2,638 | utf_8 | bd5c1e9b852f4fb5b2b5e6f00f563234 | function y_eval = ncs(x_nodes,y_nodes,x_eval)
m=length(x_nodes);
n=m-2;
a=zeros(1,n); b=zeros(1,n); c=zeros(1,n); f=zeros(1,n);
for i=1:n
b(i)=(x_nodes(i+2)-x_nodes(i))/3;
end
for i=2:n
a(i)=(x_nodes(i+1)-x_nodes(i))/6;
end
for i=1:n-1
c(i)=(x_nodes(i+2)-x_nodes(i+1))/6;
end
for i=1:n
f(i)=(y_nodes(i+2... |
github | huxiaoman7/Numerical-Analysis-code-master | plot_sint.m | .m | Numerical-Analysis-code-master/Chapter1/plot_sint.m | 3,480 | utf_8 | ee0a038c0097f957e165a7aa0a00232e | function ans = plot_sint_total
% TITLE: Plot Taylor polynomials for the "sine integral"
% about x = 0.
%
% This plots several Taylor polynomials and their errors
% for increasing degrees. The particular function being
% approximated is Sint(x) on [0,b], with x = 0 the point of
% expansion for creating the Tay... |
github | huxiaoman7/Numerical-Analysis-code-master | secant.m | .m | Numerical-Analysis-code-master/Chapter3/secant.m | 2,062 | utf_8 | 7198e622f2d51830051c107dea0a97e3 |
function root = secant(x0,x1,error_bd,max_iterate,index_f)
%
% function secant(x0,x1,error_bd,max_iterate,index_f)
%
% This implements the secant method for solving an
% equation f(x) = 0. The function f(x) is given below.
%
% The parameter error_bd is used in the error test for the
% accuracy of each iterate. The ... |
github | huxiaoman7/Numerical-Analysis-code-master | bisect.m | .m | Numerical-Analysis-code-master/Chapter3/bisect.m | 2,123 | utf_8 | e04070c9da2d897b2c978b6402e641f2 | function root=bisect(a0,b0,ep,max_iterate,index_f)
%
% function bisect(a0,b0,ep,max_iterate,index_f)
%
% This is the bisection method for solving an equation f(x)=0.
%
% The function f is defined below by the user. The function f is
% to be continuous on the interval [a0,b0], and it is to be of
% opposite signs at a0... |
github | huxiaoman7/Numerical-Analysis-code-master | newton.m | .m | Numerical-Analysis-code-master/Chapter3/newton.m | 2,197 | utf_8 | 7cd188b77a6718ab225a47aa9d204fe9 | function root = newton(x0,error_bd,max_iterate,index_f)
%
% function newton(x0,error_bd,max_iterate,index_f)
%
% This is Newton's method for solving an equation f(x) = 0.
%
% The functions f(x) and deriv_f(x) are given below.
% The parameter error_bd is used in the error test for the
% accuracy of each iterate. The p... |
github | huxiaoman7/Numerical-Analysis-code-master | trapezoidal.m | .m | Numerical-Analysis-code-master/Chapter5/trapezoidal.m | 1,812 | utf_8 | 073f6648d9f8cb36c079726bbec97ca1 | function [integral,difference,ratio]=trapezoidal(a,b,n0,index_f)
%
% function [integral,difference,ratio]=trapezoidal(a,b,n0,index_f)
%
% This uses the trapezoidal rule with n subdivisions to
% integrate the function f over the interval [a,b]. The
% values of n used are
% n = n0,2*n0,4*n0,...,256*n0
% T... |
github | huxiaoman7/Numerical-Analysis-code-master | gaussint.m | .m | Numerical-Analysis-code-master/Chapter5/gaussint.m | 986 | utf_8 | 07c899196f3a79a67022153d3ff34123 | function [val,bp,wf]=gaussint(a,b,n,index_f)
% [val,bp,wf]=gaussint(fun,a,b,n) integrates
% a function from a to b using an n-point
% Gauss rule which is exact for a polynomial
% of degree 2*n-1. Concepts on page 93 of
% 'Methods of Numerical Integration' by
% Philip Davis and Philip Rabinowitz yield
% the base points... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.