The 20-times major winner, who struggled with back issues at the start of this year before pulling out of Wimbledon and the Tokyo Olympics, last played in August at the Citi Open in Washington.
He announced ahead of the U.S. Open that the injury to his left foot would rule him out for the rest of the year.
"I want to recover from this injury in good condition," the 35-year-old Spaniard, currently ranked sixth, said.
"I don't know when I will play again, I work a lot every day, I follow a specific plan with a marked roadmap...
"There are always things that I can't control one hundred per cent, but inside my head I'm clear on what my objectives are and I trust that things will follow a positive course."