File Exchange

image thumbnail

Spring() To plot and animate a 2D-Spring

version 1.0 (1.99 KB) by

easy to use and useful for mass-spring animations, elastic materials animations, etc.

6 Ratings



View License

You have to give it the coordinates of the ends, number of coils, natural length and radius and it gives to you the (xs,ys) coordinates of the spring points, ready to use it with plot().
The picture shows an instant image of an animation of two coupled-pendulums oscillating
Type <help spring> for usage.
Don't forget to leave your comments. I'll appreciate it! :-)

Comments and Ratings (7)

Truong P

Great work! Thanks heaps.

The file is applicable. THANK YOU for such a great work.

It would be a good practice to initialize your code, so that at least we can run it without any (input) knowledge of what's what for first time, and then get a clue!


KSSV (view profile)

good one working perfect....

Roland Pasto

Simple & useful. Thank you for your contribution.

Gustavo Morales

Hi Richard!
your welcome! Notify me if you make improvements, for example, if the spring can be bent now!!! :-)

Richard Crozier

Does exactly what it says, thanks for posting this!

MATLAB Release
MATLAB 7.8 (R2009a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today