matlab script to iterate through a struct and extract names and values function [ names values ] = structIterator( struct, prependName,delimiter, names, values ) %STRUCTITERATOR This utility function iterates through all fields in struct. %If fields doesn’t contain a struct it construct and stores iterated and concatenated field names separated by delimiter in the vector […]
Author Archive
note on using checkinstall to construct deb for poppler
By thomas in checkinstall, popplerthe command that successfully created a deb file was checkinstall –fstrans=no –install=no -D Should maybe be called with sudo
monitor system events on ubuntu
By thomas in linux, ubuntuto monitor system events such as connecting/disconnecting usb devices do tail -f /var/log/syslog
RQ decomposition in matlab
By thomas in matlabSource: http://www.mathworks.com/matlabcentral/newsreader/view_thread/237007 function [R Q]=rq(A) % function [R Q]=rq(A) % A [m x n] with m R=flipud(R.’); R(:,1:m)=R(:,m:-1:1); Q=Q.’; Q(1:m,:)=Q(m:-1:1,:); end % Bruno
Tags: rq
rsync to copy home directory
By thomas in linuxsudo rsync -ah –exclude-from=/home/thomas/rsyncExcludeFile /home/ /home2/ tailing / are important the /home/thomas/rsyncExcludeFile file is a file containing directories and files not to sync such as Music
Tags: rsync
constructing uniform list by specifying starting, end and wished length
By thomas in matlabMatlab method for constructing a range or vector by specifying start, end and number of wanted elements the following is an anonymous function rangeConstructor = @(starting,ending,num) starting:(ending-starting)/(num-1):ending
Thousand separator in latex when using pgfplot
By thomas in latexSet thousand separator in latex. \pgfkeys{/pgf/number format/set thousands separator={}}
Tags: pgfplot
Image processing: opening and closing
By thomas in image processingOpening: Erosion followed by dilation. Closing: Dilation followed by erosion The operations are not inverse of each others
Java array initialization
By thomas in javaAllocate memory int[] intArray = new int[10]; this will be initialized with zeros int[] intArray={0,0,0,0}; or int[] intArray=new int[4]{0,0,0,0}; Filling arrays of the primitive types can also be done with Arrays.fill(intArray,20); The above will set all indexes in the intArray to 20 The same can be done with classes e.g: MyClass[] instances = new MyCLass[10]; […]