Manhattan Criminal Court Judge Eileen Koretz ordered the examination for Tareyton Williams, 33, of the Bronx, during his arraignment on charges of attempted murder and misdemeanor assault.
Williams, wearing dirty socks but no shoes, entered no plea. His lawyer, Sharyn Henry, had no comment.
A witness told police he recognized Williams as the man who attacked Michael Steinberg with a power saw around 3:30 a.m. Thursday on the southbound platform at 110th Street and Broadway, according to a felony complaint.
Police said Williams swiped at one person and missed. Moments later, Steinberg was slashed as he entered a turnstile.
"He looked at me and before I knew it he was attacking me," Steinberg told reporters on Thursday. "The motor kept going on. He was trying to cut through me. ... I screamed for help — 'Please help! Please help me!"'
The attacker finally paused to demand money, then bolted out of the station.
Steinberg, 64, suffered cuts and punctures on his chest and torso, broken ribs, a punctured lung and other injuries, the complaint says. He was at a hospital in stable condition.
Police arrested Williams about two hours later, after another victim was punched on an Upper West Side street. The defendant was charged with misdemeanor assault in that attack.
Assistant District Attorney James Williamson said Williams admitted he had punched the man and apologized.
Steinberg's wallet was found near 111th Street and Riverside Drive, "in the flight path of the defendant," the complaint says. The saws were found in a trash can on West 110th Street.
The saws came from a cart being used by workers who were upgrading the station's public address system. Steinberg said the workers made no attempt to intervene. A transit spokesman, Paul Fleuranges, said a token booth clerk immediately notified authorities. The other workers were employed by a private contractor, not the city, he said.
The attack came two weeks after a Boston man was charged with injuring four people — three of them tourists — during a 13-hour stabbing spree in the subway and the theater district in Manhattan.