A Republican-sponsored survey in suburban Maryland last week found that a majority of voters were unwilling to commit themselves to any presidential candidate and that a significant percentage of Republicans and Democrats had not yet accepted the nominee of their own party.

The telephone survey of about 7,000 registered voters in Prince George's and Montgomery counties was not geared to show who actually was ahead in the populous suburbs, but it did reveal a string degree of public uncertainty and discontent only five weeks before the election.

Of the voters contacted during a little more than a week of canvassing by the Republicans, fully 56 percent of the Democrats and 40 percent of the Republicans said they had not yet made up their minds in the presidential race. In Montgomery County, two-thirds of the Democrats and one-fifth of the Republicans claimed to be undecided, while in Prince George's 55 percent of the Democrats and 40 percent of the Republicans told the canvassers they were undecided.

"There's a general feeling of malaise among the voters that includes all of the candidates," said Dr. Allen Levey, the chairman of the state Republican party. "It's very troublesome -- I think we're going to have a very low turnout in Maryland."

As troublesome as the GOP canvas results seemed for supporters of Republican Ronald Reagan or President Carter, they may have prompted the most cause for concern for backers of independent candidate John B. Anderson. According to the survey, Anderson's popularity in liberal Montgomery County has virtually evaporated. While county polls taken in May and July showed Anderson leading there, the new survey indicated that only 5 percent of the Democrats and 2-to-4 percent of the Republicans were now planning to vote for him.

But Anderson's campaign workers, and even some Republican officials in Montgomery, said that many of the undecided voters probably were leaning toward the independent candidate. In afact, the Anderson camp claimed yesterday that an as-yet unreleased poll will show Anderson leading in Montgomery.

The GOP survey indicated that Reagan was having a particularly difficult time capturing the votes of fellow Republicans in Prince George's, where only 43 percent of them said they had definitely decided to vote for him. wBut Carter, according to the survey, was having an even more difficult time securing the votes of fellow Democrats in both counties. Only 20 percent of the Democrats said they had made up their minds to vote for Carter, the survey claimed.

Although party workers told voters only that they were taking a political survey when making calls, and did not identify themselves as Republicans unless asked, campaign officials conceded yesterday that the results might have been biased by a failure to pressure voters who initially responded that they were undecided. In addition, Democrat officials pointed out that the calls in Montgomery County went to areas where Republican sympathies historically have been highest, and that other methods of the survey did not meet strict polling standards.

Reagan campaign leaders nevertheless said the results showed that the Republicans have a strong opportunity to stage an upset this year in Maryland, where Democrats outnumber Republicans by close to 3-to-1 and Democratic presidential candidates have lost only once in 20 years.

"As you get closer to the election wemay find undecided Democrats going back to the fold, but the undecided Democratic vote is very, very important to us," said Carole Plante, who is manageing Republicans' phone bank in Montgomery County. "It's very exciting to us. It's hard to tell whether these Democrats are undecided about Carter anderson or Carter and Reagan, but either way it's great for us."

The number of undecided responses just shows the volatility of this campaign," said Levey. "In Maryland that leaves it wide open for the Republicans." Party officials said they had kept records of the registered voters who said they were undecided and were sending special mailings to them.

Levey also said he was troubled by the relatively low percentage of Republicans who said they planned to vote for Reagan. "I think Jimmy Carter's efforts to paint Reagan as a warmonger are scaring a lot of people," Levey said. "Some of them, and a lot of the undecided Democratic voters, may just stay home. That's why I think that the best organization in this campaign will win, that one that gets out the most votes."

For their part, state Democratic officials seized upon the low response for Anderson as good news, particularly in Montgomery County. "I don't think Anderson has any appreciable strength in the county," said Stan Gildenhorn, who has spent months trying to beat back the Anderson vote as chairman of Montgomery's independent-minded Democratic party. "People are just not talking about him seriously anymore."

Gildenhorn also said that support for Carter was likely to be much heavier in the county's Democratic "heartland" of Silver Spring, Bethesda and Wheaton, which by and large were outside the boundaries of the Republicans' canvassing, and added that the survey's finding that only 7.7 percent of Democrats in Montgomery currently planned to vote for Reagan was "very encouraging."

Other Carter supporters, including state campaign coordinator David Doak, dismissed the polling results. "Phone bank results are almost always skewed," Doak said. Doak said that the Carter campaign had not recently polled Maryland voters, and added, "I still think it's a close election."