I am looking to create a simple log(x) graph within MATLAB in which the model shows the point moving along the curve with time.
The overall aim is to have two of these graphs alongside one another and to apply an algorithm to them. I am really unsure where to start here.
I am relatively new at MATLAB coding so any help would be very useful!
Thanks Luke
Here is a variation on @Jacob's solution. Instead of redrawing everything at each frame (
clf
) we simply update the point's location:You may want to have a look at the COMET function, which will make an animation of the curve.
For example (using the same numbers as @Jacob)
If you want to show the point moving on the line (not 'drawing' it), you simply plot the line before
A simple solution is:
a little more complex solution along the same lines as @Jacob. Here I add some optimization using handle graphics and a MATLAB movie object for playback.
solution can be this way