Functions by Categories
Brick Toolbox, Version 2.0 06-Jan-2017
Contents
ARRAY MANIPULATION
manipulate dimensions and shape
| column, row, third, fourth | Reshape ND array to column vector, row vector, or vector in the 3rd or 4th dimension |
| matrix, threed | Reshape ND array to 2D or 3D array |
| fn_reshapepermute | Full capability for dimensions and shape manipulation |
| fn_add, fn_mult, fn_subtract, fn_div, fn_eq | Operations between arrays whose dimensions only partially match |
| fn_indices | Convert between global and per-dimension indices |
| fn_interleave | Interleave data |
| fn_sizecompare | Check whether two size vectors are equivalent |
apply function to elements of array or cell array
| fn_map | Apply a given function to the elements, columns or rows of an array (more versatile than Matlab arrayfun) |
| fn_find | Look for non-empty elements, or which evaluate to true when applying a certain function |
| fn_isemptyc | Which elements of a cell array are empty |
| fn_itemlengths | Return lengths of all elements inside a cell array |
simple processing
min, max, mean,...
| fn_min, fn_max | Global minimum or maximum of an array and its coordinates |
| fn_minmax | Basic min/max operations (e.g. intersection or union of 2 ranges) |
| fn_localmax | Find local maxima in a vector |
| fn_mean, fn_means | Average over several dimensions, average successive argumments |
| fn_meanc | Return mean and confidence interval |
| fn_meanangle | Average of angles (result in [-pi pi]) |
| nmean, nmedian, nstd, nste, nrms, nsum | Treat NaNs as missing values for mean/median/std/ste/rms/sum computations |
| fn_triggeravg | Local average of data around specific indices in a given dimension |
| fn_arrangepergroup, fn_avgpergroup | Reorganize an array according to labels describing a specific dimension, or average accross different repetitions of the same label |
other
| fn_sym | Convert a symmetric matrix to a vector and vice-versa |
| fn_timevector | Convert set of times to vector of counts and vice-versa |
MATLAB TYPES
string
| fn_strcut | Cut string into pieces according to specified separator |
| fn_strrep | Replace several text sequences in string |
structures
conversions
| fn_num2str | Convert numeric to char, unless input is already char!, can return a cell array |
| fn_idx2str | Convert indices to a compact string representation, e.g. '1:2 5:8' for [1 2 5 6 7 8] |
| fn_str2double | Convert to numeric if not already numeric |
| fn_strcat | Concatenate strings and numbers into a single string, with optional separator sequence |
| fn_float | Convert integer to single, keep single or double as such |
PROGRAMMING
handy shortcuts
| fn_switch, fn_cast | Shortcut for avoiding using if/else and switch |
| fn_disp, fn_display | Display multiple arguments at once, display a variable name and value in a single line |
| fn_dispandexec | Display commands in Matlab and executes them |
| fn_subsref | Shortcut for calling Matlab subsref function |
| fn_ismemberstr | Check whether string is part of a set of strings (faster than Matlab ismember) |
| fn_flags | Detect flags in the arguments of a function |
| dealc | Assign elements of an array to multiple outputs |
| fn_mod | Return modulus between 1 and n instead of between 0 and n-1 |
| fn_regexptokens | Get the tokens of a regexp as a simple cell array |
tools
| fn_progress, pg | Print the state of a calculation |
| fn_hash | Unique hash number for an array/cell/structure (Copyright M Kleder) |
debugging
| fn_dbstack | Display current function name, with indent according to stack length |
| fn_basevars | Load base workspace variables in caller workspace and vice-versa |
FILES
shortcuts
| fn_cd | User definition of shortcut to fast access directories |
| fn_fileparts, fn_fileext | Get specific file parts, replace file extension |
| fn_ls | Return folder content |
| fn_mkdir | Create a directory if it does not exist |
| fn_movefile | Rename files in current directory using regular expression |
user selection
| fn_getfile | Select file and remember the containing folder of the last selected file |
| fn_savefile | User select file for saving and remember last containing folder |
| fn_getdir | Select directory and remember last containing folder |
handy
| locate | Reveal file in Explorer (Windows only) |
IMPORT/EXPORT
read/save file
read file
| fn_readbin | Read binary file containing some header followed by numerical data |
save figure
Matlab workspaces
| fn_exportvar | Export data to a Matlab variable in base workspace |
MATHEMATICS
filtering
optimization
| fn_fit | Fit the parameters of a given function |
| dichotomy | Uses dichotomy method for one-dimensional optimization |
statistics
statistics + display
machine learning
tools
IMAGE PROCESSING
basic operations
regions of interest
| fn_maskselect | Manual selection of a mask inside an image |
| fn_subrect | Manual selection of a rectangular mask inside an image |
| fn_poly2mask | Get the mask of a polygon interior |
| fn_imvect | Convert an image to a vector of pixels inside a mask, and vice-versa |
| fn_roiavg | Compute average signal from a region of interest |
coregistration
GUI programs
DATA DISPLAY
shortcuts
figure
| fn_figure | Raise figures by name rather than by number (shortcut: ff) |
| fn_isfigurehandle | Is handle a plausible figure handle |
| fn_subplot | Subplots cover the figure without leaving any space |
drawings
time courses displays
time courses tools
| fn_axis | Set axis range for a better visual aspect than 'axis tight' |
| fn_nicegraph | Improve aspect of graph display |
| fn_plotscale | Add horizontal and vertical scale bars to graph |
| fn_linespecs | Handle abbreviated plot options (e.g. 'r.') |
special 2D displays
2D tools
| fn_imdistline | Show the distance between two points (enhanced version of Matlab imdistline) |
| fn_scale | Scale bar for image display |
color tools
| fn_colorset, fn_colorbyname | Different sets of colors, conversion between color numerical value and name |
| fn_showcolormap | Display a color map in a given axes or in a separate figure |
| hsl2rgb | Convert from Hue/Saturation/Luminance coordinates to RGB |
movie displays
mesh computations and displays
display ND data
interactive displays
| fn_imvalue | Automatic link graphs and images for point selection and zooming |
| fn_review | Navigate with arrow keys inside a set of data |
| fn_4Dview | Navigation inside 3D, 4D or 5D imaging data |
GUI PROGRAMMING
shortcuts
| fn_evalcallback | Evaluate a callback, i.e. a char array, function handle or cell array |
| fn_get, fn_set | Get and set mutiple properties of multiple objects at once |
figure
| fn_watch | Change the pointer to a watch during long computations |
| panelorganizer | Divide a figure into resizeable panels |
object positions
mouse actions
pre-defined arrangements of controls
| fn_okbutton | Small 'ok' button waits to be pressed |
| fn_menu | Utility to create a basic GUI made of a line of buttons |
special controls
| fn_multcheck | Special control made of multiple check boxes |
| fn_buttongroup | Set of radio buttons or toggle buttons |
| fn_slider | Special control that improves the functionality of Matlab slider |
| fn_sliderenhance | Allow a slider uicontrol to evaluate its callback during scrolling |
| fn_stepper | Edit a numeric value, includes increment/decrement buttons |
| fn_sensor | Special control whose value is changed by clicking and dragging |
| fn_clipcontrol | A wrapper of fn_sensor that controls the clipping range applied to an image |
| fn_filecontrol | Select a file |
elaborate controls
dialogs
GUI oriented-object programming
| interface | Parent class to create cool graphic interfaces |
| fn_propcontrol | Create controls automatically linked to an object property |
| deleteValid | Delete valid objects among the list of objects obj (particularly useful for Matlab graphic handles) |
| disableListener | Momentarily disable a listener (returns an onCleanup oject that reenable it when being garbage collected) |
MISCELLANEOUS
shortcuts
| alias | Create command shortcuts |
system
| fn_lmstat | Get information about how many Matlab floating licenses are used on the network |
| fn_hostname | Return an identifiant specific to the computer in use |
| fn_email | Send e-mails from Matlab! Automatically attach figures, M-files and more |
memory and pointers
| whoisbig | Get information about large variables |
| fn_getPr | Get the address of the data stored in a variable: usefull to understand when two variables share the same data in memory |
| fn_pointer | A structure that can be modified when being passed to functions |
| pointer | Implement a pointer to any Matlab object |
graphics
| fn_figmenu | An automatic custom menu for figures: save figure, distance tool, ... |
figure edition
| fn_extractsvgdata | Extract data from SVG file! (PDFs can be converted to SVG with InkScape free software) |
| fn_getcolorindices | Extract from image displays by checking the color bar |
| fn_color2bw | GUI to let user choose the best conversion to convert color image to grayscale |
| fn_editsignal | Manually edit your signals data points! |