Martin Marietta Corp., its nonaerospace businesses suffering in the recession, said yesterday it would close permanently its cement plant in Thomastown, Maine, in March, and take a $13 million writeoff on that and some other cement operations.

The plant, representing about 10 percent of Marietta's 5-million-ton annual cement capacity, employs 135 persons.

Still feeling the effects of its efforts to thwart a takeover attempt by Bendix Corp. late this summer, Martin Marietta also predicted that, with the writeoff, it probably will not post a profit for the fourth quarter ending Dec. 31. But the company said it would issue a regular, fourth-quarter cash dividend of 48 cents for each share of common stock.

Through the first nine months of the year, Martin Marietta earned $94 million ($2.71 a share) on revenues of $2.6 billion.

Meanwhile yesterday, Allied Corp. said it, Bendix and Martin Marietta had set Dec. 21 as the date to close the deal that ended the Bendix-Martin Marietta battle in late September. Under the agreement, Allied will take over Bendix and trade part of Bendix's 70 percent holding in Martin Marietta for Marietta's 50 percent of Bendix stock. Allied will retain 39 percent of Bendix under the agreement.

The deal has been delayed while the Justice Department examines possible antitrust ramifications of the Allied-Bendix combination. Allied, which originally had hoped to make the agreement final Dec. 13, said it expects the Justice Department investigation to be completed by the new closing date. A Justice Department spokesman said the agency expected to be able to complete the inquiry by Dec. 21.

Martin Marietta said the closing of the cement plant and resulting writeoff will cause its cement division to finish the year with a loss. It also said its aluminum operations -- an industry even more depressed than cement -- will post substantial losses this year. Its aerospace, specialty chemical and sand and gravel businesses are operating at profitable levels, the company said.

"The story of our 1982 results is best wrapped up in the two extremes--very good aerospace, very bad aluminum," Thomas G. Pownall, Martin Marietta's president, said yesterday. " . . . We foresee continuing strength in aerospace, but prospects in our other markets, most particularly aluminum, offer little encouragement at present for recovery or revival."

Some analysts believe that Martin Marietta will seek to sell one or more of its non-aerospace divisions to rid the company of the depressed businesses and to raise cash to pay off some of the $900 million in debt incurred by buying the Bendix stock.