Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab GUI programming help

  1. Mar 18, 2007 #1

    ranger

    User Avatar
    Gold Member

    [Matlab virgin here]

    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:biggrin: 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.
     
    Last edited: Jun 10, 2007
  2. jcsd
  3. Apr 14, 2007 #2
    hi group community
    i am getting it dificult to create GUI for solving equations for y=mx+c;
    i have failed to edit m file but if completed to create the figure
    can someone hel;p me to intiate and edit the call back function
    thanks
     
  4. Apr 14, 2007 #3
    try 'GUIDE' command in Matlab. Then look on Matlab's website for information on how to operate guide and perhaps seek examples of other working GUI's. Other than that, maybe wait to make your own thread since ranger needs his own help here! Still, welcome to the forums, mussaco.

    And ranger, whilst this may have been an old post - I don't have more free time at the moment than required to make a simple post (i.e. this :smile:) but I will try to have a look at your files and let you know of the results. I would also suggest looking for an example GUI in the meantime if it's really bugging you. Are you still working on the problem?
     
  5. Apr 15, 2007 #4
    i am still working on the problem
    but does the equation y=mx+c apperas on the opening function or on the callback function to make the gui calculate?
    regards
    mussa
     
  6. Nov 14, 2010 #5
    hi dear i'm now working on the same project as you done it
    and have thesame problem as you had.
    can you mail me on s.hosseini1365@gmail.com to how can i do it!
    tanks a lot.
     
  7. Nov 17, 2010 #6
    You don't need to fill most of the callbacks. I've made several GUI's and if your code isn't amazingly complicated then you can just put the entire code inside the callback of your "Start Simulation" button or whatever you've called it.

    I've never made a realtime simulation like you're trying to do now but i think the standard matlab way of doing such a thing is by setting your main function inside of a loop and adding a very small pause at the end.
     
  8. Jul 19, 2011 #7
    Hi

    I am facing trouble with the graphics in the GUI, im trying to do something similar but i donwload your files and cant find where did you "draw" the mass-spring sistem, please could you tell me how did you draw that "live" graph
     
    Last edited: Jul 19, 2011
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Matlab GUI programming help
  1. Help on GUI MATLAB (Replies: 0)

Loading...