Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.posted.internetamerica!news.posted.internetamerica.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 11 Oct 2008 15:35:53 -0500
From: rtServo <noone@nowhere.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: COM PutFullMatrix Syntax
Date: Sat, 11 Oct 2008 13:35:51 -0700
Message-ID: <s412f41pa5p3mrii5mtnbu57uhdk1lr49r@4ax.com>
References: <gco63a$pgs$1@fred.mathworks.com>
X-Newsreader: Forte Agent 1.92/32.572
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 50
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 209.128.79.70
X-Trace: sv3-CIxwk03eogQreMscdgNIX7tj2gb5ntAeDbUoCFaPzaQeBRK0+0U06gpIHJpA2fguGQ7MLv59bxQ08By!TgOTIQxUHWkm+1O7TA/4F4s/7jOf+2UGtUJzAV1WkhRDeGWFYCc4WJXRhDbSkyCUl4RPieoWTsso!litNLD0uj1t0
X-Complaints-To: abuse@airmail.net
X-DMCA-Complaints-To: abuse@airmail.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.39
Xref: news.mathworks.com comp.soft-sys.matlab:494710


Matt -

The help on TMW web site is pretty good for using Matlab as a COM
server, complete with examples.

What does Matlab show as the method signature for AddIntersection?
(try object.invoke or object.methods.)   I expect you will see that
the third parameter is a Variant or a SafeArray of some type..

Have you tried:

object.AddIntersection(1, 2, [1,2])

Matlab will usually take care of creating the SafeArray for you.  If
that failed, what was the error message?

Is COMApp a Matlab Automation object?  If so, you have probably opened
a second instance of Matlab.  I did this:

COMapp = actxserver('Matlab.Application.7');

and that created a second instance of Matlab as a COM server.

COMapp.PutFullMatrix('M','global',[1,2],[0,0]);

That created the array M as a global variable in the other instance.
But the error you got suggests COMapp is something else.

rt

On Fri, 10 Oct 2008 18:15:06 +0000 (UTC), "Matthe Reilly"
<matthew.reilly@gmail.com> wrote:

>I am trying to build a model using MATLAB's COM functionality.  The software I'm interfacing with has an method AddIntersection, which has the following syntax:
>
>object.AddIntersection (num, num_boundries, boundary_nums()) 
>
>Thus, it adds object with number num at the intersection of num_boundaries curves where the curves are specified by their internal identification numbers, boudary_nums.  I have been unable to successfully send the array of boundary_nums to the software.  After contacting the software provider, they have indicated that boundary_nums must be of the SafeArray type, which MATLAB's documentation indicates may be passed using the PutFullMatrix function.  I tried to do this with the following command line:
>
>object.AddIntersection(1,2,COMApp.PutFullMatrix('M','global',[1,2],[0,0]))
>
>which returned the error
>
>??? No appropriate method or public field PutFullMatrix for class COM.application.
>
>Does anyone have any experience attempting to use the PutFullMatrix command as an argument in another COM method?  I just can't seem to find the correct syntax that will allow this to work.
>
>Thanks
>Matt