Install locations have defaults, but these defaults can (and are) changed all the time for various reasons. It's not "advertised", since the OS defaults are used, but then the end-user actually makes the decision where to install the application, like pretty much every other software product -- so there's no way of being 100% accurate in knowing where someone installed it, but that's not going to always be correct.
Also, since installation locations are entirely changeable, be sure to include a "I give up, tell me where your MATLAB is" option. It's also entirely possible to have multiple versions installed, as well -- so discovery of multiple versions and/or an override to specify the one you want is also important.
On Mac, the default is to put it in Applications. But given that OSX is more unix-y, I'd try a command like "which matlab".
On Windows, it goes in Program Files (win32/win64), or Program Files (x86) (32-bit install on 64-bit machine). If I were trying to find an installed anything on Windows, though, I'd use the APIs for Installed Programs and then get the information programmatically, as you don't have to use Program Files or Program Files (x86), and installations may be somewhere else entirely for a multitude of reasons.
(glnx86/glnxa64/sol2/hpux ...), you might look in /opt /usr/bin, /bin, /local, or call "which matlab" and see if you get something -- which you may not, as there may be several MATLABs available to people, and they might need to use an alias or run some sort of script to set their environment before starting MATLAB. This platform gets tricky fast, though, as each vendor/distro might have their own place that's their favorite -- and that favorite might be entirely ignored because the application is installed on a NFS mount with a symlink to /usr/bin.