Diaz, 40, and Musk, 41, got to know each other after she bought one of the electric sports cars earlier this year, we hear.

But sources tell us Musk — said to be the inspiration for “Iron Man” genius billionaire Tony Stark played by Robert Downey Jr. — has gotten close to Diaz and has been increasingly traveling to Los Angeles from Tesla headquarters in Palo Alto. He’s been going to LA so regularly, Musk often arrives without giving his colleagues a heads-up he’s in town. The reason, we’re told, is because he’s “visiting Cameron.”

Sources said Diaz, who is filming the romantic comedy “The Other Woman” alongside Leslie Mann and Kate Upton, is a big fan of Musk, a South African-born entrepreneur who launched software companies Zip2 and PayPal and space exploration firm Space X before launching Tesla Motors.

Diaz bought a Tesla Model S EV earlier this year, an energy-friendly electric sedan with no emissions and a top speed of about 130 mph.

Musk, worth $4.5 billion, has been married and divorced twice, most recently to British actress Talulah Riley, 27, with whom he split in 2012 and later reconciled. The couple in mid-May attended the Maxim Hot 100 party together in LA, where Riley is living.

Diaz, meanwhile, split with New York Yankee third baseman Alex Rodriguez two years ago, and appears to have been unattached since.

While reps for neither Diaz nor Musk got back to us, perhaps the single Diaz is looking to settle down. On Monday, passengers on a Delta flight from Nice, France, overheard the actress going “gaga” over Uma Thurman and Arpad Busson’s daughter Luna, whom Busson held close to his chest in a Baby Bjorn.

After Thurman showed off Luna to Diaz and fellow passenger Nicole Kidman, Diaz “gushed how she’s wanted to have a baby,” an onlooker told us.