President Reagan said yesterday that he was feeling "pretty good" after a night of vomiting and nausea, and White House spokesman Marlin Fitzwater announced that the president will undergo a semiannual cancer checkup Friday that he said was unrelated to yesterday's illness.

"This examination was previously scheduled and was not related to this morning's episode of gastroenteritis," Fitzwater said yesterday.

Because of his upset stomach, Reagan canceled plans to attend the funeral yesterday morning of former White House aide Edward V. Hickey Jr., the chairman of the Federal Maritime Commission, who was stricken with an apparent heart attack Saturday. The president went ahead with a meeting and luncheon with Japanese Prime Minister Noburo Takeshita but consumed only flat ginger ale and consomme while the visiting party dined on salmon bisque and cornish hen.

"Evidently, I ate something that disagreed with me," said Reagan, who said he could not recall what he had for dinner the night before. "The doctor thinks something's going around but I have a hard time believing that because everything else seems so normal," Reagan said at a picture-taking session with Takeshita.

The president, who will be 77 next month, is entering his eighth year in office. He has survived a serious chest wound after he was shot in a March 1981 assassination attempt and major colon cancer surgery in 1985. Reagan also has undergone surgery for various minor ailments, including a prostate condition a year ago and four common skin cancers.

Army Col. John E. Hutton Jr., the president's physician, said yesterday in a statement issued by Fitzwater that Reagan had suffered from "a mild episode of gastroenteritis" and was otherwise "in good health." No medication was prescribed, Hutton said.

Fitzwater said Reagan would enter Bethesda Naval Hospital for his checkup, which will include a colonoscopy, chest X-rays and heart and stress tests. After the physical examination, the president and first lady Nancy Reagan plan to go directly from the hospital to Camp David where they will stay until Monday.

The Reagans will spend an extended weekend at Camp David because Monday, when the Rev. Martin Luther King Jr.'s birthday will be officially observed, is a federal holiday. The president plans to make a telephone call on Friday to students at Martin Luther King Junior Elementary School in Southeast Washington, Fitzwater had announced previously.

Reagan appeared pale at the departure ceremony for Takeshita but minimized his overnight illness. "I feel pretty good," he said.

The president said he did not see Hutton about his stomach illness until morning because he "didn't feel it serious enough to warrant medical attention" during the night.