Engineering Programming (MATLAB/Python) · Problem type

Write a function in order

Use this for “Write a function that returns a beam’s bending stress. What goes first, and how do you know it works?”

Put in order

Put the steps of writing the function in order.
1
?
2
?
3
?
4
?
5
?

Assumptions

•
The same order works in MATLAB (function s = stress(M, b, h)) and in Python (def).
•
The units go in the names or a comment: here M in N·mm, b and h in mm, σ in MPa.
•
The hand check uses numbers worked on paper: 10⁷ N·mm, 50 mm and 90 mm give 148.1 MPa.
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.

Related lessons

© 2026 SME. All rights reserved.