For reference it might be useful running Matlab computations only on one core: matlab -singleCompThread
Tag: MATLAB
Create MATLAB readable avi from bmp frames
Use the following command ffmpeg -vframes 200 -f image2 -i airport1%03d.bmp -f avi -vcodec rawvideo -pix_fmt bgr24 -acodec pcm_s16le airport.avi This will convert all the files airport1000.bmp to airport1200.bmp to an avi file. Using mencoder will allow you to chose the framerate: mencoder “mf://*.bmp” -mf fps=12 -o out.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800
access (lot of small) functions residing in one MATLAB m file
Usually, you create one m-file for one MATLAB function. But what to do if you have many small functions? It’s odd to create a lot of files which just contain some lines of code. The other approach is to put the small functions just inside the m file where they are called from. This is… Continue reading access (lot of small) functions residing in one MATLAB m file
convert a video to a MATLAB readable file in UNIX
Convert the movie by: ffmpeg -y -i input_file.avi -f avi -vcodec rawvideo -pix_fmt bgr24 -acodec pcm_s16le output_file.avi
Compile MATLAB functions in C and link them with Intel MKL CBLAS
The MATLAB utility “mex” (enter “help mex” in command window in MATLAB) is a wrapper for your actual compiler, like gcc. It does not support intels icc. But this is no reason not to use the Intel MKL libraries! Write your code and compile it with: mex cpuMatrixCBLAS.c -I/opt/intel/Compiler/11.1/069/mkl/include/ -L/opt/intel/Compiler/11.1/069/mkl/lib/em64t /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_solver_lp64_sequential.a -Wl,–start-group /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_intel_lp64.a /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_sequential.a /opt/intel/Compiler/11.1/069/mkl/lib/em64t/libmkl_core.a… Continue reading Compile MATLAB functions in C and link them with Intel MKL CBLAS
start MATLAB in command line mode from bash/linux console
Sometimes I want to start matlab without having the (lame) X interface. Instead of, I just use the command line. For this purpose, just run: matlab -nodisplay Or even easier, by adding a small script in /$MATLAB_HOME/bin maybe named “matlabnoX” with the content above. Make sure to chmod the file such that it is runnable!