The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Editing new functions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Jose

Netherlands
93 Posts

Posted - 12/15/2000 :  07:13:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I am working with a project that uses several new functions defined by me. How can I edit any of them, without having to plot it and going to Plot Details to change its functional dependence? The "edit" command,

edit myfn;


creates a dataset based in that function and then opens it to allow me to edit the data, but this is not what I want... Is there any similar command (or option) to edit the function itself? I could not easily find it by searching the help files.

j.

rtoomey

USA
184 Posts

Posted - 12/15/2000 :  12:02:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Jose,

There isn't any command for editing functions defined in Origin. However, you can define and edit functions directly in the Script window. To see what I mean, try the following:

1) Click on the New Function Graph window to open an empty New Function Graph.
2) Cancel out of Plot Details so that no functions are created.
3) Open the Script window (Window : Script Window).
4) Type in a function such as f(x)=2*x and press the ENTER key on your keyboard.

You should see the curve automatically placed in the New Function Graph window.

5) Change that function by entering something like the following: f(x)=2*x^2 in the Script window and press ENTER.

You should see that the curve in the New Function dialog box updates to the new equation.

Furthermore, if you define a function through the normal procedure in the New Function dialog box you can still change it in the Script window as I have shown you above.

I hope this helps.

Sincerely,
Ryan Toomey

Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 12/18/2000 :  06:54:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is quite useful, and I sometimes use it. But the problem with this is that you are not allowed to see the fuction definition before re-defining it. If, for instance, my funcion is a large one, with several parameters, automatically created by a script, and now I want to slightly change some of its parameters, I have the following possibilities:

1) to plot it in a graph and edit it (it was not previously ploted, because I am not interested in the function itself, but in certain derived functions or data)

2) to follow your tip and retype it again in the script window... completely.

The second possibility is not useful if the fuction is so complicated that I don't know it by heart. It would be easier (and solve my problem) if I could get the definition of my function in the script window, for example by simply typing

 f(x)=;


the same way you read variables. This is what I am looking for, and was not able to find yet. Do you think it is possible?

j.
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/18/2000 :  09:21:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It is a general problem of LabTalk that it does not support functions. The kind of dataset based function is really just for plotting. We are going to add general support for functions in our next version of Origin, but until then (or beta time), there is no easy way except those that you already know.

One thing that can save some time is to keep a plot window as the only window in a folder and keep it minimized. These way you can choose the function from the data list to open the plot details dialog without waiting for drawing the function to draw.


Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 12/18/2000 :  12:56:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This last idea is very good It really saves time!

j.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000