File Exchange

## Interactive curve class

version 1.2 (51.5 KB) by

change curve by markers drag-and-drop

3.66667
3 Ratings

Updated

Editor's Note: This file was selected as MATLAB Central Pick of the Week

http://simulations.narod.ru/

See how it works on this video:
http://youtu.be/cjej0nf0fcY

All class is interactive_curve.m file.
1) set current directory to directory where interactive_curve.m place
2) type
doc interactive_curve
in command window and push enter.

It is possible to change markers style, interpolation method, generate m-file ect.

Amit

### Amit (view profile)

Maxim,

Excellent work! But I have a question.

How can I define a userdefined function for interpolation? For example, defining a exponential decay function with ends as control points? (y=y0*exp^(-d*t)); where y0 is initial quantity, t is time, d is decay per unit time.

So when I drag the control points the curvature of the curve is controlled by exponential decay function and d gets calculated based on initial and final position of the control points (d = [log(y2) - log(y1)]/[x2-x1]).

Maxim Vedenyov

### Maxim Vedenyov (view profile)

robert howrd, main thing here is not GUI, it is object that you can insert to any GUI. For example waveform generator: http://www.mathworks.com/matlabcentral/fileexchange/35183-waveform-generator-gui-2

robert howrd

### robert howrd (view profile)

confusing, GUI not well done, hard to use, not user friendly.

Maxim Vedenyov

Jiro Doke

### Jiro Doke (view profile)

You can make a property (SetAccess = protected). Then I can still type:

m = ic.method

But I can't do this:

Maxim Vedenyov

### Maxim Vedenyov (view profile)

But what is the user want to know what method of interpolation is used curently than it will use m=ic.method; ic.setMehtod(...) change the method of interpolation and redraw line.

Jiro Doke

### Jiro Doke (view profile)

Oops, my original comment got deleted.

At first, I didn't realize you had all of these set* methods. I was trying to change the properties directly, because they were all public. My suggestion was to make some of the properties protected or hidden (if it's only used internally)

Jiro Doke

### Jiro Doke (view profile)

After playing with it some more, I realized that I was supposed to use the set* methods for change different properties. I see that if I use "setMethod" method, it updates the plot correctly.

I think that means the "method" property should be (setAccess = protected), so that people cannot change it.

 27 Feb 2012 1.2 Update No.2: set protected property for .method, mouse methods and figure close methsod now protected methods. 23 Feb 2012 1.1 Update No. 1: marker color bug fixed, aditional dilte, new method: setMarkersPositions(), new property additionalDeleteFunctionHandle and other improvements.
##### MATLAB Release
MATLAB 7.11 (R2010b)