<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237342</link>
    <title>MATLAB Central Newsreader - COM PutFullMatrix Syntax</title>
    <description>Feed for thread: COM PutFullMatrix Syntax</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 10 Oct 2008 18:15:06 -0400</pubDate>
      <title>COM PutFullMatrix Syntax</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237342#604686</link>
      <author>Matthe Reilly</author>
      <description>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:&lt;br&gt;
&lt;br&gt;
object.AddIntersection (num, num_boundries, boundary_nums()) &lt;br&gt;
&lt;br&gt;
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:&lt;br&gt;
&lt;br&gt;
object.AddIntersection(1,2,COMApp.PutFullMatrix('M','global',[1,2],[0,0]))&lt;br&gt;
&lt;br&gt;
which returned the error&lt;br&gt;
&lt;br&gt;
??? No appropriate method or public field PutFullMatrix for class COM.application.&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Matt</description>
    </item>
    <item>
      <pubDate>Sat, 11 Oct 2008 20:35:51 -0400</pubDate>
      <title>Re: COM PutFullMatrix Syntax</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237342#604791</link>
      <author>rtServo</author>
      <description>Matt -&lt;br&gt;
&lt;br&gt;
The help on TMW web site is pretty good for using Matlab as a COM&lt;br&gt;
server, complete with examples.&lt;br&gt;
&lt;br&gt;
What does Matlab show as the method signature for AddIntersection?&lt;br&gt;
(try object.invoke or object.methods.)   I expect you will see that&lt;br&gt;
the third parameter is a Variant or a SafeArray of some type..&lt;br&gt;
&lt;br&gt;
Have you tried:&lt;br&gt;
&lt;br&gt;
object.AddIntersection(1, 2, [1,2])&lt;br&gt;
&lt;br&gt;
Matlab will usually take care of creating the SafeArray for you.  If&lt;br&gt;
that failed, what was the error message?&lt;br&gt;
&lt;br&gt;
Is COMApp a Matlab Automation object?  If so, you have probably opened&lt;br&gt;
a second instance of Matlab.  I did this:&lt;br&gt;
&lt;br&gt;
COMapp = actxserver('Matlab.Application.7');&lt;br&gt;
&lt;br&gt;
and that created a second instance of Matlab as a COM server.&lt;br&gt;
&lt;br&gt;
COMapp.PutFullMatrix('M','global',[1,2],[0,0]);&lt;br&gt;
&lt;br&gt;
That created the array M as a global variable in the other instance.&lt;br&gt;
But the error you got suggests COMapp is something else.&lt;br&gt;
&lt;br&gt;
rt&lt;br&gt;
&lt;br&gt;
On Fri, 10 Oct 2008 18:15:06 +0000 (UTC), &quot;Matthe Reilly&quot;&lt;br&gt;
&amp;lt;matthew.reilly@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;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:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;object.AddIntersection (num, num_boundries, boundary_nums()) &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;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:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;object.AddIntersection(1,2,COMApp.PutFullMatrix('M','global',[1,2],[0,0]))&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;which returned the error&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;??? No appropriate method or public field PutFullMatrix for class COM.application.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;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.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;Thanks&lt;br&gt;
&amp;gt;Matt</description>
    </item>
    <item>
      <pubDate>Mon, 13 Oct 2008 06:08:06 -0400</pubDate>
      <title>Re: COM PutFullMatrix Syntax</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237342#604900</link>
      <author>Matthew Reilly</author>
      <description>rtServo &amp;lt;noone@nowhere.com&amp;gt; wrote in message ...&lt;br&gt;
&lt;br&gt;
rtServo,&lt;br&gt;
&lt;br&gt;
I'm running another program (finite element software) as an ActiveX server&lt;br&gt;
&lt;br&gt;
sc=actxserver('StressCheck.application');&lt;br&gt;
&lt;br&gt;
Like I mentioned, the third parameter is a SafeArray.  I had tried to send it using&lt;br&gt;
object.AddIntersection(1,2,[1,2])&lt;br&gt;
&lt;br&gt;
without success prior to asking for help from the developer.  The error message it gives is &quot;??? Error: Type mismatch, argument 3.&quot;  The COMApp's developer indicated that it required a safearray and suggested a workaround&lt;br&gt;
&lt;br&gt;
object.AddIntersection(1,2,[int32(1),int32(2)])&lt;br&gt;
&lt;br&gt;
which appears to work in most cases.  However, it is giving me strange results in other cases.  The only rhyme or reason I can find is that it is usually having problems when the elements in the safearray are the numbers 15 or 5, which doesn't make any sense to me at all.&lt;br&gt;
&lt;br&gt;
Thanks for the feedback and I would appreciate any more help you can give me.  The developer of the application I'm using doesn't have experience with MATLAB for COM, as they have only dealt with VB previously.  They're trying to help, but it's taking quite a while.&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Matt</description>
    </item>
  </channel>
</rss>

