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@...
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 server, you might look at:
--- On Sun, 6/22/08, marciolegal <marciolegal@...> wrote:
From: marciolegal <marciolegal@...> Subject: [omatrix] Builting custom functions To: omatrix@yahoogroups.com Date: Sunday, June 22, 2008, 5:27 PM
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
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
One final piece of relevant information that other users may find useful:
http://www.mathworks.com/support/solutions/files/s36851/regstats_details.html
It describes a method to circumvent the rounding errors obtained via
the qr decomposition method.
Kurt
--- In omatrix@yahoogroups.com, "kurtforrester" <kurtforrester@...> wrote:
>
> Beau,
>
> Thanks for the response.
>
> Both methods are supposed to be minimising the sum of squared error
> (SSE) sum(observed_i - predicted_i)^2. Therefore comparing the
> parameter values/confidence interval is not the measure of difference
> in the methods, it should be the SSE.
>
> For the backslash division:
> SSE = 0.759546
>
> For the full wiki method implemented in O-Matrix:
> SSE = 0.96827
>
> Even within computation tolerances the SSE for both methods are far
> from the same (> 25% variation) and it appears that O-Matrix is not
> minimising the objective function to an appropriate tolerance. I am
> just trying to reconcile the differences in the methods.
>
> Yours,
>
> Kurt
>
>
> --- In omatrix@yahoogroups.com, "Harmonic Software" <beau@> wrote:
> >
> > Kurt,
> >
> > Your solutions bhat, i.e. beta hat in the wiki article I believe
> are within
> > the stated confidence intervals? I believe that the stated bhat
> values in
> > the wiki article are the confidence intervals, of which the O-Matrix
> > solution gives the estimate. Will look into that further for you.
> >
> >
> >
> > Beau
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > From: omatrix@yahoogroups.com [mailto:omatrix@yahoogroups.com] On
> Behalf Of
> > kurtforrester
> > Sent: Thursday, April 24, 2008 11:42 AM
> > To: omatrix@yahoogroups.com
> > Subject: [omatrix] Linear Algebra
> >
> >
> >
> > Trying to replicate the example from wikipedia for linear regression
> > using the following O-Matrix script
> > ##### Code Start ###################################
> > height = {1.47, 1.5, 1.52, 1.55, 1.57, 1.60, 1.63, 1.65, 1.68, 1.7,
> > 1.73, 1.75, 1.78, 1.8, 1.83}
> > weight = {52.21, 53.12, 54.48, 55.84, 57.2, 58.57, 59.93, 61.29,
> > 63.11, 64.47, 66.28, 68.1, 69.92, 72.19, 74.46}
> >
> > X = [ones(rowdim(height),1), height, height^2]
> >
> > s = inv(X'*X)
> > bhat = X\weight # Backslash division
> > bhat2 = s*X'*weight # As shown
> > http://en.wikipedia.org/wiki/Linear_regression
> >
> > print bhat
> > print bhat2
> > ##### Code end #####################################
> > # O-Matrix responds
> > ##### Command window output begin ##################
> > {
> > 128.807
> > -143.155
> > 61.9582
> > }
> >
> > {
> > 132.617
> > -147.417
> > 63.0986
> > }
> > ##### Command window output end ##################
> >
> > Why if they are both implementations of linear regression (although
> > different methods) are the results so different?
> >
> > Cheers,
> >
> > Kurt
> >
>
Beau,
Another follow-up about the least squares regression issue.
Quoting from the matlab website.
"Use the MATLAB® backslash operator (mldivide) to solve a system of
simultaneous linear equations for unknown coefficients. Because
inverting X'*X can lead to unacceptable rounding errors, the backslash
operator uses QR decomposition with pivoting, which is a very stable
algorithm numerically."
That about seems to cover the problem.
Cheers,
Kurt
--- In omatrix@yahoogroups.com, "kurtforrester" <kurtforrester@...> wrote:
>
> Beau,
>
> Thanks for the response.
>
> Both methods are supposed to be minimising the sum of squared error
> (SSE) sum(observed_i - predicted_i)^2. Therefore comparing the
> parameter values/confidence interval is not the measure of difference
> in the methods, it should be the SSE.
>
> For the backslash division:
> SSE = 0.759546
>
> For the full wiki method implemented in O-Matrix:
> SSE = 0.96827
>
> Even within computation tolerances the SSE for both methods are far
> from the same (> 25% variation) and it appears that O-Matrix is not
> minimising the objective function to an appropriate tolerance. I am
> just trying to reconcile the differences in the methods.
>
> Yours,
>
> Kurt
>
>
> --- In omatrix@yahoogroups.com, "Harmonic Software" <beau@> wrote:
> >
> > Kurt,
> >
> > Your solutions bhat, i.e. beta hat in the wiki article I believe
> are within
> > the stated confidence intervals? I believe that the stated bhat
> values in
> > the wiki article are the confidence intervals, of which the O-Matrix
> > solution gives the estimate. Will look into that further for you.
> >
> >
> >
> > Beau
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > From: omatrix@yahoogroups.com [mailto:omatrix@yahoogroups.com] On
> Behalf Of
> > kurtforrester
> > Sent: Thursday, April 24, 2008 11:42 AM
> > To: omatrix@yahoogroups.com
> > Subject: [omatrix] Linear Algebra
> >
> >
> >
> > Trying to replicate the example from wikipedia for linear regression
> > using the following O-Matrix script
> > ##### Code Start ###################################
> > height = {1.47, 1.5, 1.52, 1.55, 1.57, 1.60, 1.63, 1.65, 1.68, 1.7,
> > 1.73, 1.75, 1.78, 1.8, 1.83}
> > weight = {52.21, 53.12, 54.48, 55.84, 57.2, 58.57, 59.93, 61.29,
> > 63.11, 64.47, 66.28, 68.1, 69.92, 72.19, 74.46}
> >
> > X = [ones(rowdim(height),1), height, height^2]
> >
> > s = inv(X'*X)
> > bhat = X\weight # Backslash division
> > bhat2 = s*X'*weight # As shown
> > http://en.wikipedia.org/wiki/Linear_regression
> >
> > print bhat
> > print bhat2
> > ##### Code end #####################################
> > # O-Matrix responds
> > ##### Command window output begin ##################
> > {
> > 128.807
> > -143.155
> > 61.9582
> > }
> >
> > {
> > 132.617
> > -147.417
> > 63.0986
> > }
> > ##### Command window output end ##################
> >
> > Why if they are both implementations of linear regression (although
> > different methods) are the results so different?
> >
> > Cheers,
> >
> > Kurt
> >
>
Beau,
Thanks for the response.
Both methods are supposed to be minimising the sum of squared error
(SSE) sum(observed_i - predicted_i)^2. Therefore comparing the
parameter values/confidence interval is not the measure of difference
in the methods, it should be the SSE.
For the backslash division:
SSE = 0.759546
For the full wiki method implemented in O-Matrix:
SSE = 0.96827
Even within computation tolerances the SSE for both methods are far
from the same (> 25% variation) and it appears that O-Matrix is not
minimising the objective function to an appropriate tolerance. I am
just trying to reconcile the differences in the methods.
Yours,
Kurt
--- In omatrix@yahoogroups.com, "Harmonic Software" <beau@...> wrote:
>
> Kurt,
>
> Your solutions bhat, i.e. beta hat in the wiki article I believe
are within
> the stated confidence intervals? I believe that the stated bhat
values in
> the wiki article are the confidence intervals, of which the O-Matrix
> solution gives the estimate. Will look into that further for you.
>
>
>
> Beau
>
>
>
>
>
>
>
>
>
> From: omatrix@yahoogroups.com [mailto:omatrix@yahoogroups.com] On
Behalf Of
> kurtforrester
> Sent: Thursday, April 24, 2008 11:42 AM
> To: omatrix@yahoogroups.com
> Subject: [omatrix] Linear Algebra
>
>
>
> Trying to replicate the example from wikipedia for linear regression
> using the following O-Matrix script
> ##### Code Start ###################################
> height = {1.47, 1.5, 1.52, 1.55, 1.57, 1.60, 1.63, 1.65, 1.68, 1.7,
> 1.73, 1.75, 1.78, 1.8, 1.83}
> weight = {52.21, 53.12, 54.48, 55.84, 57.2, 58.57, 59.93, 61.29,
> 63.11, 64.47, 66.28, 68.1, 69.92, 72.19, 74.46}
>
> X = [ones(rowdim(height),1), height, height^2]
>
> s = inv(X'*X)
> bhat = X\weight # Backslash division
> bhat2 = s*X'*weight # As shown
> http://en.wikipedia.org/wiki/Linear_regression
>
> print bhat
> print bhat2
> ##### Code end #####################################
> # O-Matrix responds
> ##### Command window output begin ##################
> {
> 128.807
> -143.155
> 61.9582
> }
>
> {
> 132.617
> -147.417
> 63.0986
> }
> ##### Command window output end ##################
>
> Why if they are both implementations of linear regression (although
> different methods) are the results so different?
>
> Cheers,
>
> Kurt
>
Your solutions bhat, i.e. beta hat in the wiki article I
believe are within the stated confidence intervals? I believe that the
stated bhat values in the wiki article are the confidence intervals, of which
the O-Matrix solution gives the estimate. Will look into that further for
you.
Beau
From:
omatrix@yahoogroups.com [mailto:omatrix@yahoogroups.com] On Behalf Of kurtforrester Sent: Thursday, April 24, 2008 11:42 AM To: omatrix@yahoogroups.com Subject: [omatrix] Linear Algebra
Trying to replicate the example from wikipedia
for linear regression
using the following O-Matrix script
##### Code Start ###################################
height = {1.47, 1.5, 1.52, 1.55, 1.57, 1.60, 1.63, 1.65, 1.68, 1.7,
1.73, 1.75, 1.78, 1.8, 1.83}
weight = {52.21, 53.12, 54.48, 55.84, 57.2, 58.57, 59.93, 61.29,
63.11, 64.47, 66.28, 68.1, 69.92, 72.19, 74.46}
Trying to replicate the example from wikipedia for linear regression
using the following O-Matrix script
##### Code Start ###################################
height = {1.47, 1.5, 1.52, 1.55, 1.57, 1.60, 1.63, 1.65, 1.68, 1.7,
1.73, 1.75, 1.78, 1.8, 1.83}
weight = {52.21, 53.12, 54.48, 55.84, 57.2, 58.57, 59.93, 61.29,
63.11, 64.47, 66.28, 68.1, 69.92, 72.19, 74.46}
X = [ones(rowdim(height),1), height, height^2]
s = inv(X'*X)
bhat = X\weight # Backslash division
bhat2 = s*X'*weight # As shown
http://en.wikipedia.org/wiki/Linear_regression
print bhat
print bhat2
##### Code end #####################################
# O-Matrix responds
##### Command window output begin ##################
{
128.807
-143.155
61.9582
}
{
132.617
-147.417
63.0986
}
##### Command window output end ##################
Why if they are both implementations of linear regression (although
different methods) are the results so different?
Cheers,
Kurt
I had some correspondence with Beau from Harmonic about compiling user
functions in C/C++ with the free compiler command line gcc in cygwin.
Below is the summary of the problem/solution.
Cheers,
Kurt
-----------------------------------
I initially tried to compile the code in cygwin with gcc (3.4.4) and
the dll that was created just froze O-Matrix when it was called (no
errors just freeze).
I later read that linking from VC/VC++ compiled programs can be
difficult from gcc (sometime it works sometimes it does not). A work
around is to use mingw from within cygwin. Below are the commands that
I used to generate the dll that worked.
In cygwin I moved to the directory containing the c++ files that I
wanted to put into the dll(note that mno-cygwin is the mingw flag).
$ gcc -mno-cygwin -c MYCOLMAX.CPP
this creates an object file MYCOLMAX.o
$ gcc -mno-cygwin -shared MYCOLMAX.o -o SAMPLE.dll
this produces the dll (SAMPLE.dll)
Calling this dll from O-Matrix produces the same response as the
SAMPLE.dll supplied.
You could additionally add maths optimisation/optimization flags to
the compiling and linking commands to make the dll to run faster.
Hope this helps others working in this area.
We have been getting quite a few prospects asking what the correspondence is
between O-Matrix and Matlab functions so we added the following summary,
http://www.omatrix.com/manual/om2matlab.htm
There are many choices available and this is right aproach that first research
about degree and than get one.
Master, Bachelor, Associate and Phds:
http://www.degreexs.com/?aff=4837
We have been seeing an increasing demand for specialized and
more statistics capability in O-Matrix. We have decided that the best
approach to address this is providing a statistics toolbox in a similar fashion
as the “STSA, The Time Series Toolbox”, http://www.omatrix.com/stsa.html,
“IPT- The Image Processing Toolbox”, http://www.omatrix.com/ipt.html, and
“SPT – The Signal Processing Toolbox”, http://www.omatrix.com/spt.html
We have a general outline of what this needs to include and
we are soliciting current, (or new) users that would be interested in this
project. As a toolbox author you receive a percentage of gross sales, and
we provide support throughout your development effort. If you might be
interested, please contact Beau Paisley, beau@...
We did not want to intervene with the omatrix news group and
provide any moderation but the amount of spam recently has become overwhelming
so we now require that all enrollments be manually approved.
We have been doing this for about a week now and the spam seems to have stopped
for now.
There is not a F key available but you can access the command through the Debug
window with, Alt-D,S
pc_panchariya <pc_panchariya@...> wrote:
Hi, I want to debug (single steping)o-matrix codes like in Matlab just by simply pressing F9, F8, F5 keys (equivalent keys for commands). Let me know if
someone know it. PC
Hi,
I want to debug (single steping)o-matrix codes like in Matlab just by
simply pressing F9, F8, F5 keys (equivalent keys for commands). Let me
know if someone know it.
PC
With the release of "IPT - The Image Processing
Toolbox for O-Matrix", http://www.omatrix.com/ipt.html
we are now in the mode of gathering feedback of how
the toolbox is, and can be used for real-world image
processing applications.
Our existing customers have always been the source of some
of our most valuable product feedback so we are offering a
free IPT license to existing customers that are willing to
give IPT a try and provide at least one of the following inputs:
- A summary of your application including how your implementation
compares to other options you considered.
- A testimonial of how IPT benefitted you, and which we can use
on our web page and marketing efforts.
- A case-study similar to those at:
http://www.omatrix.com/userstories.html
To qualify for the free license you must:
1) Have a current O-Matrix license. If you do not have the current
6.3 release, please see the "Customer Upgrades" entry at
http://www.omatrix.com/howorder.html to obtain discounted upgrade
pricing.
2) We must receive your feedback by January 21, 2008
Please download IPT from, http://www.omatrix.com/downloads/IPTDemo.ZIP
This is a demo version which will time out in 30 days but it is fully
functional. We will get you an unrestricted license as soon as we get
one of the feedback options.
Harmonic Software has released "IPT - The Image Processing
Toolbox for O-Matrix". IPT provides a comprehensive set of
functions for image manipulation and analysis. The IPT capabilities
include image file I/O, color space transformations, linear
filtering,
image transformations, mathematical morphology, image enhancement, and
image analysis.
IPT is multi-threaded, uses SIMD technology, and is built with
leading-edge
image processing algorithms to provide execution performance and
efficiency
that far exceeds other toolbox and stand-alone image processing
solutions.
View the IPT benchmarks and performance details at:
http://www.omatrix.com/iptbench.html
IPT is priced at only $200 for commercial users, with disounts
available for
academic and government agency customers.
The Image Processing Toolbox enables the development of analysis
and turnkey solutions in a broad range of industries including:
- Medical Imaging
- Microscopy
- Industrial Inspection and Measurement
- Surveillance
- Biometrics
Further product details and ordering information is available at:
http://www.omatrix.com/ipt.html
We have made some significant improvements to the performance of the
FFT functions in O-Matrix for the next release but we have been
profiling "real world" applications to see what other areas in
relation to the use of FFTs may be enhanced.
If you have a "FFT-centric" application it would be greatly
appreciated if you forward me a stand-alone sample of your application
which we may use for profiling purposes.
Thanks,
Beau