President Reagan, ending a bitter two-year controversy within his administration, has decided to allow China to buy American computers and other so-called "dual purpose" high-technology equipment, administration officials confirmed yesterday.

Administration officials said the president has sided with Commerce Secretary Malcolm Baldrige over Defense Secretary Caspar Weinberger, who objected to the sales because of the potential military use of the equipment.

Despite the defeat for Weinberger, officials close to the argument warned yesterday that "you can expect that there will still be heel-dragging at the Department of Defense."

"Dual purpose" technology is short-hand for computer, telecommunications and other equipment that--although designed for civilians--might also be converted for military applications.

The president's decision was conveyed to Baldrige about a month ago in a telephone conversation he had with White House officials from Tokyo, en route to Peking on an official visit. Baldrige passed the word on to Premier Zhao Ziyang.

Sources said that while he was on his way to China as co-chairman of the U.S.-China Joint Commission on Commerce and Trade, Baldrige called key White House staffers from Tokyo and said he felt he had to have an "up or down" decision from the president before meeting with Chinese officials. Reportedly, the White House felt that a rejection of Chinese demands for the equipment, at a time that Peking showed anxiety over U.S.-Taiwan relationships, might strain the Washington-Peking relationship beyond repair.

High Commerce Department officials predict that the new policy, which Baldrige promised Zhao would be in place by the end of next month, with specific exports under it en route by Labor Day, could increase U.S. exports to China by $1 billion to $2 billion a year. Much of this would be in computers, semiconductor manufacturing equipment and telecommunications.

At Baldrige's urging, the president decided to place China in export-controls category "V", which bars the shipment of specific military items, but allows manufacturers to presume that other exports will be approved. The "V" category applies to friendly and non-allied nations, including several in NATO.

Being in the "V" category does not mean that China will have automatic access to all but prohibited items. But there would, in effect, be a "go" signal, unless the U.S. government puts a "hold" on some equipment, instead of the current reverse guideline, which is a "stop" procedure, unless an exception is allowed.

As of the moment, China is in a special "P" category of its own, a cosmetic designation created so that China would no longer be lumped with the Soviet Union and Cuba, but one that did not actually allow greater exports. Thus, although the Reagan administration enunciated a policy two years ago designed to liberalize technology transfers, the actual result of the "P" category has been to hold up high-technology exports to China--notably the equipment the Chinese want most badly.

American manufacturers, as well as the Chinese, have been frustrated by what appears to be the indecision of the federal bureaucracy, which has been caught between the desire of the Commerce Department to see the business go forward, and the Defense Department's reluctance to apply any but the strictest interpretation of the rules.

For example, as Baldrige has pointed out publicly, there are 14 different guidelines covering computer exports.

"If one of the guidelines is off, or if something falls outside of one of the guidelines," Baldrige said during a press conference last month in Peking, "it can't go. We have to fix up that system . . . so that the Chinese will see results in an actual improvement in technology transfer while we . . . still take into account national security considerations."

Christopher Phillips, chairman of the National Council for U.S.-China Trade, hailed reports of the presidential decision. "We think this is a a very significant policy decision that will have a major impact on the two-way trade," Phillips said.

He reported that on a recent trip to China, officials told him that the two areas of deepest concern to them were the failure of the United States to make good on its promises of greater high technology exports, and suspicion that the United States would sell arms to Taiwan.

Sources said that the "dual purpose" technology issue has been debated at the Cabinet level from the start of the Reagan administration. In recent discussions, Baldrige has been joined by Secretary of State George P. Shultz, and White House science adviser George A. Keyworth II.

Weinberger's position has been a restatement of traditional Defense Department reticence to approve the export of any equipment, if there is the slightest possibility it could be converted to military or nuclear applications.

According to those familiar with the course of the debate, Baldrige and others argued that China has an absolute need to modernize its industry, and that the technology it seeks from the United States is readily available for sale by Japan, European nations--and even the Soviet Union.

"We felt at this stage of our relationships to China, if we don't do what we said two years ago we were going to do, there would be a deterioration in the relationship," said one of the key players. "If we look on China as a friend, it was time to take a risk."

He emphasized a belief that no sales of equipment with a clear or primary military purpose would be approved. Most of the computers the Chinese are interested in buying--largely for classroom use--are based on technology that is 10 to 15 years old.