Mechanical behavior of polymer and ceramic matrix nanocomposites