Search the web
Sign In
New User? Sign Up
omatrix
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Builting custom functions   Message List  
Reply | Forward Message #438 of 454 |
Re: [omatrix] Builting custom functions

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@...




Mon Jun 23, 2008 2:18 am

balding11
Offline Offline
Send Email Send Email

Forward
Message #438 of 454 |
Expand Messages Author Sort by Date

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...
marciolegal
Offline Send Email
Jun 23, 2008
12:27 am

Marcio, I'm not sure I understand your question, but O-Matrix includes facilities for creating custom functions, working as a COM client, and serving as a COM...
Beau Paisley
beau_paisley
Online Now Send Email
Jun 23, 2008
12:38 am

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,...
Jim Worthey
balding11
Offline Send Email
Jun 23, 2008
2:18 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help