OOP in Matlab: basics /Tutorial

Software from Kelvin Murphy and Students (UBC)
http://www.cs.ubc.ca/~murphyk/Software/matlabTutorial/html/objectOriented.html#53

A more professional guide to Matlab
https://code.google.com/p/yagtom/

Suggestion:

The danger of premature optimization

Before spending a lot of time optimizing your code, you should first identify the key bottlenecks using the profiler. The usual pattern is that 80% of the the time is spent in 20% of the code, so you can focus your efforts accordingly. Also, remember that correctness is more important than speed!

Friday, May 24, 2013

Getting start with Matlab OOP

http://www.mathworks.com/help/matlab/matlab_oop/developing-classes--typical-workflow.html

difference between

properties (Constant)

can be access as independent variable or function directly.

properties (GetAccess = 'public', SetAccess = 'private')

can only be access outside class through another class

Thursday, May 23, 2013

observer pattern

http://www.oodesign.com/observer-pattern.html
To have a good design means to decouple as much as possible and to reduce the dependencies.

How to install Qt5 on Ubuntu


sudo apt-get install build-essential perl python "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev flex bison gperf libicu-dev libxslt-dev ruby libcups2-dev libgstreamer-plugins-base0.10-dev libssl-dev libpulse-dev libasound2-dev libgtk2.0-dev
wget http://releases.qt-project.org/qt5/5.0.0/single/qt-everywhere-opensource-src-5.0.0.tar.gz
tar -xf qt-everywhere-opensource-src-5.0.0.tar.gz
cd qt-everywhere-opensource-src-5.0.0

./configure -opensource -confirm-license -release -nomake tests -nomake examples -nomake demos
make -j3
sudo make install

Monday, May 20, 2013

Natural Units

http://en.wikipedia.org/wiki/Natural_units

Plank Unit

"Natural units" (particle physics) [edit]

UnitMetric valueDerivation
1 eV−1 of length1.97×10−7 m=(1\text{eV}^{-1})\hbar c
1 eV of mass1.78×10−36 kg= (1 \text{eV})/c^2
1 eV−1 of time6.58×10−16 s=(1\text{eV}^{-1})\hbar
1 eV of temperature1.16×104 K= 1 \text{eV}/k_\text{B}
1 unit of electric charge
(L–H)
5.29×10−19 C=e/\sqrt{4\pi\alpha}
1 unit of electric charge
(G)
1.88×10−18 C=e/\sqrt{\alpha}
In particle physics, the phrase "natural units" generally means:[4][5]
 \hbar = c = k_\text{B} = 1.
where \hbar is the reduced Planck constantc is the speed of light, and kB is the Boltzmann constant.
Like the other systems (see above), the electromagnetism units in Planck units can be based on either Lorentz–Heaviside units or Gaussian units. The unit of charge is different in each.
Finally, one more unit is needed. Most commonly, electron-volt (eV) is used, despite the fact that this is not a "natural" unit in the sense discussed above – it is defined by a natural property, the elementary charge, and the anthropogenic unit of electric potential, the volt. (The SI prefixed multiples of eV are used as well: keV, MeV, GeV, etc.)
With the addition of eV (or any other auxiliary unit), any quantity can be expressed. For example, a distance of 1 cm can be expressed in terms of eV, in natural units, as:[5]
1\, \text{cm} = \frac{1\, \text{cm}}{\hbar c} \approx 51000\, \text{eV}^{-1}

Wednesday, May 8, 2013