Slouching in class really does stop you learning, a new study has found.

But doing as teacher says and sitting up straight makes you perform better.

And its because being slumped over the desk stops the brain from working properly stopping them from focusing on the task in hand.

It is also a defensive position which can trigger old negative memories in the body and brain.

Researchers at San Francisco State University tested posture during a maths test but said their findings about body position can help people prepare for many different types of performance under stress.

Athletes, musicians and public speakers can all benefit from better posture prior to and during their performance.

It called also help pupils with learning difficulties do better if they change posture.

Professor of Health Education Erik Peper said: "For people who are anxious about maths, posture makes a giant difference "The slumped-over position shuts them down and their brains do not work as well.

"They cannot think as clearly.

"You have a choice. It's about using an empowered position to optimise your focus."

He explained: "People tend to adapt a slouched posture while looking down at digital screens, watching various kinds of digital media on computer screens, or even sitting collapsed in a chair or couch during therapy.

"Our posture may impact the way we perceive ourselves, as well as the way others perceive us.

"An upright posture tends to project an assertive, dominant,and powerful person, whereas sitting in a collapsed posture may project a submissive, defeated, or depressed individual. "

So the study whether changing posture could influence performance on a simple subtraction task under conditions of time pressure.

It involved 125 college students tested to see how well they could perform simple maths test of subtracting seven from 843 sequentially for 15 seconds while either slumped over or sitting up straight with shoulders back and relaxed.

Over half - 56 per cent reported finding it easier to perform the test in the upright position.

Co-author Associate Professor of Health Education Richard Harvey said slumping over is a defensive posture that can trigger old negative memories in the body and brain.

While students without anxiety about maths did not report as great a benefit from better posture, they did find that doing maths while slumped over was somewhat more difficult.

Prof Peper said: "Head-upright/erect postures may make it easier to access positive and empowering thoughts and memories, thereby helping students to perform better.

"This expanded upright position is an indicator of feeling safe and empowered.

"This upright posture inhibits the defence reaction and increases feelings of safety, which relate to the findings that the head-upright, erect posture or position make it easier to access positive and empowering thoughts and memories."

"The research findings suggest that students, especially those who are anxious or fearful of maths and blanking out during exams, could benefit from sitting upright instead of slouched while studying and taking exams to optimise performance and have greater access to positive thoughts and memories."

Recent graduate Lauren Mason who helped design the experiment added: "I always felt insecure about my maths abilities even though I excelled at other subjects.

"You build a relationship with maths so early - as early as elementary school.

"You can carry that negative self-talk throughout your life, impacting your perception of yourself."

But coping with stressful situations could be as easy as changing posture.

She said: "The way we carry ourselves and interact in space influences not only how others perceive us but also how we perceive ourselves."

The study was published in the journal NeuroRegulation.