Marcio,
Maybe you are asking how to write a function and
then save it so that it will be called from other
functions, or from a main program.
If function a(x, y, z) calls a function b(u, v,
w), and they are both in the same file, then
function b() must be defined before a() calls it. So b() must appear above a().
That's true, but it's a small part of your work
on a large project. The normal thing is, define
b(u, v, w), or whatever your function is, in a
separate file, and call that file b.oms . The
file b.oms should be in a directory that is in the path.
The naming of functions in Omatrix is
case-sensitive, but the naming of files in
Windows is not case-sensitive. Be consistent
about upper and lower case in defining and calling functions.
The path is defined in autoexec.oms . I prefer
not to keep editing autoexec.oms, so I have a
separate file that is occasionally edited, and
then an include command that brings my personal
file into autoexec.oms, however you would say
that. The personal file includes a statement like this:
path( [ path, ";", NEW_LINE, "C:\science\omjim\color", ...
";", NEW_LINE, "C:\science\omjim\try", ...
";", NEW_LINE, "C:\science\omjim\consistency", ...
";", NEW_LINE, "C:\science\omjim\OrthoModel", ...
";", NEW_LINE, "C:\science\omjim\LED", ...
";", NEW_LINE, "C:\science\omjim\OrthoApps", ...
";", NEW_LINE, "C:\science\omjim\overlap"] )
The effect is to append 7 lines of new material
onto the existing path, and let that longer
string become the path. You can have hundred of
functions in a few folders, according to how you
like to organize your work. So you need not edit
the path very often, and you can work right
along, writing new functions and putting them in new files.
Incidentally, the constant NEW_LINE is defined in autoexec.oms .
Jim Worthey
At 08:27 PM 6/22/2008, you wrote:
>Hi all,
>I'm considering migrating from Matlab to O-matrix and I was trying to
>find information on how i could write customized functions in such a
>way that these functions could be stored somewhere in the computed and
>executed by other functions in a call. The tutorial says it is
>possible, but up to what I understood the functions must be defined
>just before executed. I may have missunderstood that...
>Is it possible to create build in functions with O-matrix?
>Thanks,
>Márcio
Jim W. , http://www.jimworthey.com
James A. Worthey, P.E., Ph.D., jworthey@...