Why/when should I prefer MATLAB over Octave?

In 2008 I tried doing the same thing. I quickly noticed the following show stoppers: Toolboxes are not as complete and not as well tested. Particularly the image processing toolbox that my work relied heavily upon (the big show stopper was that imtransform was not implemented). The Octave debugger and profiler were primitive compared to … Read more

LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MT_StaticRelease’ doesn’t match value ‘MD_DynamicRelease’ in file.obj

This error can occur when you are statically linking your project with a library (typically a file with .lib extension) but the linker setting in your Visual Studio project are set to dynamically link (meaning the link will occur during runtime, usually with a .dll file). To define that you need the project to use … Read more

cocktail party algorithm SVD implementation … in one line of code?

I was trying to figure this out as well, 2 years later. But I got my answers; hopefully it’ll help someone. You need 2 audio recordings. You can get audio examples from http://research.ics.aalto.fi/ica/cocktail/cocktail_en.cgi. reference for implementation is http://www.cs.nyu.edu/~roweis/kica.html ok, here’s code – [x1, Fs1] = audioread(‘mix1.wav’); [x2, Fs2] = audioread(‘mix2.wav’); xx = [x1, x2]’; yy … Read more

Setting graph figure size

The properties that can be set for a figure is referenced here. You could then use: figure_number = 1; x = 0; % Screen position y = 0; % Screen position width = 600; % Width of figure height = 400; % Height of figure (by default in pixels) figure(figure_number, ‘Position’, [x y width height]);

Hash tables in MATLAB

Consider using MATLAB’s map class: containers.Map. Here is a brief overview: Creation: >> keys = {‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, … ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’, ‘Nov’, ‘Dec’, ‘Annual’}; >> values = {327.2, 368.2, 197.6, 178.4, 100.0, 69.9, … 32.3, 37.3, 19.0, 37.0, 73.2, 110.9, 1551.0}; >> rainfallMap = containers.Map(keys, values) rainfallMap = containers.Map handle … Read more

Why does numpy std() give a different result to matlab std()?

The NumPy function np.std takes an optional parameter ddof: “Delta Degrees of Freedom”. By default, this is 0. Set it to 1 to get the MATLAB result: >>> np.std([1,3,4,6], ddof=1) 2.0816659994661326 To add a little more context, in the calculation of the variance (of which the standard deviation is the square root) we typically divide … Read more