[Matlab virgin here](adsbygoogle = window.adsbygoogle || []).push({});

I am in great need of some help. My task is to create GUI app to model simple harmonic motion of a spring with a mass attached to it. The requirements are to have the user be able to change every parameter of the equation:

my'' + cy' + ky' = f(t)

The m, c, k, and f are the usual constants - mass, spring constant and so on. Upon changing these parameters the user should be able to see a live visual of the spring moving and a graph for an analytical understanding of the motion through some specified time of action. By default the time of action should be about 10sec then the simulation stops and the parameters could be changed.

This is what I've done so far:

Made the complete GUI app. This includes all necessary user interfacing, the "live" graph, and spring animation.

Now what I need some help on is the relate all the user inputs to the formula to get the simulation.

Yea, I know I havent done much because the GUI was the easy part, but I did get the "grid on" and "grid off" buttons to work Other than that, I pretty much didnt do any Callbacks and so on to help analyze the data.

Can someone help me get started?

http://linuxfreak87.googlepages.com/HarmonicSpring.m <-- m-file

http://linuxfreak87.googlepages.com/HarmonicSpring.fig <--fig file

Using Matlab 7 R14

--thank you.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab GUI programming help

**Physics Forums | Science Articles, Homework Help, Discussion**