http://www.mathworks.com/matlabcentral/newsreader/view_thread/146397 % Handle storage h = zeros(1, 5); % Data x = 0:0.1:1; % Color data C = [1 0 0; 1 1 0; 0 1 0; 0 1 1; 0 0 1]; % Prepare the axes hold on axis([0 1 0 1]); % Prepare the string cell array s = cell(1, 5); % Plot …
Author Archives: epsilon
Fortran and Fortran array
http://orion.math.iastate.edu/burkardt/papers/fortran.html http://orion.math.iastate.edu/burkardt/papers/fortran_arrays.html
Free-form, fixed-form and file extensions for fortran
http://gcc.gnu.org/wiki/GFortranGettingStarted Free-form, fixed-form and file extensions By default, gfortran is aware of a few file extensions, and its action depends on the extension of the file you ask it to compile. Examples: if the file is named code.f gfortran supposes it is fixed-form source, with no preprocessing needed. if the file is named code.f90 gfortran supposes it is free-form …
Continue reading “Free-form, fixed-form and file extensions for fortran”
List directory only in linux
ls -d */
Bash script tutorial
A link for Bash scripting turorial http://linuxconfig.org/bash-scripting-tutorial
display specific lines in a file
sed -n “20,40p” filename will display lines from 20 to 40 in the file.
copy while preserving timestamps
Sometimes, it is useful to copy files while preserving its timestamps. cp -a source dest scp -p source dest To cp without replacement, we can use rsync -au source/ dest/
replace a string in files, reload files in emacs, change files names in batch,
1) To replace a string oldstring to newstring in some files, do sed -i ‘s/oldstring/newstring/g’ files 2) to reload files in email, just do ctrl c + ctrl v 3) to rename files in batch, do rename ‘s/oldstring/newstring/’ files
Some shortcuts in Linux Terminal
Shift+Ctrl+t new tab Shift+Ctrl+w close tab Shift+Ctrl+n new window Ctrl+{PgUp,PgDown} change tabs Shift+Insert paste from selection buffer, or if that’s empty the clipboard Ctrl+Insert copy selection to clipboard Shift+Ctrl+v paste from clipboard Ctrl+Click Open URL under mouse cursor Keyboard shortcuts for Terminal Ctrl + A = Move cursor to beginning of line Ctrl + E = Move …
in latex, figure numbers using section numbers
Today, When I latex my document, I found that the figure number is displayed as section number. To solve this issue, just put the \caption before the \label in the figure.