I've read somewhere that if complex is an adjective, its second syllable is stressed (com-plex), while for noun, the first one (com-plex). But e.g. this link says that adjective can also sound as noun. I also remember that my teacher (many years ago) said "com-plex object", although complex is an adjective here.
I guess stress depends on context of usage. So, what are the cases for stressing first or second syllable in adjective complex? How do I determine which syllable has to be stressed?
For example, how are "complex numbers", "complex object", "complex problem" pronounced?