The 20-year-old forward only returned to training last week having missed the bulk of pre-season due to a hamstring problem.
A timeframe has not been placed on Diaz's recovery.
A club statement read: "Following the tests carried out today on our player, Brahim Diaz, by the Real Madrid medical department, he has been diagnosed with a muscular injury to his right anterior rectus.
"His recovery will continue to be assessed."
Diaz joined Madrid from Manchester City for an initial €17million in January and started four of their final five LaLiga games last season, scoring his maiden goal in a 3-1 defeat at Real Sociedad.
This bout of fitness problems has proved particularly untimely, denying Diaz the chance to press his claims amid the arrivals of Luka Jovic, Rodrygo and Eden Hazard – although the latter two have also been hit with injury setbacks.