Now, I can't pretend to know anything about Matlab, but does it really provide both static and shared libraries?