How to know the size of a variable in MATLAB

I wrote a simple convenience function to handle just this problem. Usage is: >> x = ones(1000); >> ByteSize(x) 7.63 Mb I run R2007a, so the problem of Java objects not returning sizes may have been fixed in subsequent releases. Here’s the code: function ByteSize(in, fid) % BYTESIZE writes the memory usage of the provide … Read more

fminunc alternate in numpy

There is more information about the functions of interest here: http://docs.scipy.org/doc/scipy-0.10.0/reference/tutorial/optimize.html Also, it looks like you are doing the Coursera Machine Learning course, but in Python. You might check out http://aimotion.blogspot.com/2011/11/machine-learning-with-python-logistic.html; this guy’s doing the same thing.

Turning y axis upside down in MATLAB

The ‘YDir’ axes property can be either ‘normal’ or ‘reverse’. By default it is ‘normal’ for most plots, but some plots will automatically change it to ‘reverse’, such as the image or imagesc functions. You can set the y-axis direction of an axes with either the set function or dot indexing (in newer MATLAB versions): … Read more

How can I interrupt MATLAB when it gets really really busy?

Go to the command window, and hit Ctrl-C a lot. From my experience, on a single-core machine you do not have a chance, unless you do lots of output. On a multi-core or multi-processor machine, you’ll probably stop it eventually, but it takes time. See also http://www.mathworks.com/support/solutions/en/data/1-188VX/index.html Added: it is a good practice to (1) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)