Diaz's appearance Thursday came as part of taping for an mtvU program called "Stand-In" in which celebrities teach a class. On Tuesday, Madonna lectured students at New York's Hunter College.
A champion of environmental causes, Diaz served as a sidekick for friend and renowned environmental architect William McDonough, a consulting professor at Stanford.
"He's very charismatic, captivating," Diaz said of McDonough, who Time magazine once called "Hero for the Planet." "Bill is one of those people who is thinking big, but is also producing."
Students gasped and giggled when Diaz interrupted the class during McDonough's lecture, and later lined up to snap pictures with the actress on their cell phones.
Diaz, 33, stars in the recently released "In Her Shoes."