Writing a C++ COM Server for a Matlab COM client
My question is actually more related to C++ in VisualStudio and COM but since it is also heavily related to Matlab I have no other option than posting here.
I would like to write a custom in-process COM server for MATLAB and use MATLAB as a COM client.
I have succesfully implemented a server dll which generates the following keys under HKEY_CLASSES_ROOT when registered
with !regsvr32 in matlab.
HKEY_CLASSES_ROOT\CLSID\myclsid\ProgID = myprogid
HKEY_CLASSES_ROOT\CL...How to access COM objects in MATLAB built with MATLAB Builder NE?
I used the MATLAB R2010b Builder NE to compile a COM-DLL (a single class with a single method) and intend to call the method from within MATLAB R2007b. I cannot distribute m-files or p-files because my code uses new object oriented features introduced in R2008a. So the idea is to install Matlab Compiler Runtime 2010b on the target machine in addition to MATLAB 2007 and access the function from a DLL.
Unfortunately, I was not able to run the method from within MATLAB and could not find any documentation on how to use MATLAB to "test" COM DLLs (or even .NET DLLs or C-DLLs) built with the MATLAB Compiler. The documentation yet is very clear on how to use external interfaces, e.g using actxserver() for COM DLLs, or NET.addAssembly() for .NET DLLs or loadlibrary() for C-DLLs.
Since I have no installation of R2007 right now I did everything in R2010 (compiling and testing). Here is what I tried for COM DLLs:
>> p = actxserver('myComponent.myClass');
??? Invoke Error, Dispatch Exception:
Description: MCR instance is not available
and for .NET DLLs:
>> p = myComponent.myClass();
??? Message: The type initializer for "myComponent.myClass" threw an exception.
and for C-DLLs
Warning: Warnings messages were ...MATLAB and COM #3
I'm trying to get Matlab with COM running...
I want to use my ActiveXServer out from Matlab (ver. 6.5.1SP2 and
I use functions with multiple output arguments like:
HRESULT GetCOMObject([out] COMObject** Object,
[out, retval] unsigned short* pRetVal);
I've tryied the followings to call this function under Matlab:
"[a b] = ComServer.GetCOMObject"
and Matlab 6.5.1 returns:
"??? Error: Only functions can return multiple values."
while Matlab 7.1 executes the function and returns:
But b...Matlab COM Interface
I want to use the COM Interface with a Delphi program but it doesn't work.
Do I need some special Toolboxes to use the interface?
The dlls mwcomutil and mwcommgr aren't in my win32 folder. Also the mwregsvr.exe isn't there.
Is it possible to invoke a COM Object without these data?
I'm using Matlab 2007b.
Thanks for any help.
On Wed, 07 Apr 2010 10:23:07 -0300, Daniel <firstname.lastname@example.org> wrote:
> I want to use the COM Interface with a Delphi program but it doesn't
What happens instead?
&g...Matlab COM events
I am working on a project which requires some integration between Aspentech's Aspen Custom Modeller (ACM) software and Matlab. ACM provides a COM server component which returns an IUnknown handle. Fortunately the ACM documentation provides enough information to use this handle.
The COM object provides a function "AddEventSink" which requires a pointer/reference to an object that extends from ACM's IAspenModelerEvents class. This class must implement a number of methods.
I would like to catch these events inside Matlab. When I try to pass a handle to a Matlab object ...MATLAB COM Builder
I am using COM builder with the following settings:
MATLAB version 6.5
C/C++ complier .NET 2003 cl.exe
After adjusting for the namespaces, I get the following error:
LINK : fatal error LNK1104: cannot open file 'msvcirt.lib'
MBUILD.BAT: Error: Link of 'E:\QFS\Chk\src\Chk_1_0.dll' failed.
could someone advice me on this?
...MATLAB/EXCEL through COM
I am trying to call MATLAB program from EXCEL through COM,
without using EXCEL/Link or any other MATLAB package. I am
having trouble to use handle.feval function from within
EXCEL. MATLAB did a poor job here-the document does not
mention this anywhere: in the following code,
ewmaRet = MatLab.Feval("strcat", 1, "hello", " world")
does not run. This statement directly comes from MATLAB
"External Interface Guide" doc.
I tried to look for the definition of feval (COM) from EXCEL :
Sub Feval(bstrName As String, nargout As Long, pvarArgOut,
[a...aborting a MATLAB COM
I am trying to create a COM object in MATLAB that can be stopped
mid-run by the user in Visual Basic. I have tried several
techniques, but the only successful way was to write to a text file
from VB then check for its existence in MATLAB every time the loop
Initially I tried to set a global in the COM object whilst it was
looping, and, if the value of the global had changed, to exit. This
just crashed VB.
Next, I created using VB, an out of process COM Exe server to with a
single abort property. A reference to this singleton object was
obtained both by the VB client and the...Matlab COM Objects
Is there a way to actually make COM objects in Matlab? I have
downloaded the COM Builder and I see how to run Matlab code from,
say, Visual Basic. What I would like to do is actually put a Matlab
plot on a VB form. I can generate a Matlab plot in a separate
window, but that is not what I want, I would like to actually make a
COM object that goes on the VB form. I see TMW did that with their
MWSamp example, but I don't see the code for the object part or any
explanation of it in the help. Anybody have any experience with
On Mon, 16 Feb 2004 16:52:29 -0500, "Mat...Using COM in Matlab
I'm trying to use a set of COM objects in Matlab. I read a
lot of resources (Matworks and others) about it, but can't
get it work. I hope someone is willing to help me!
Some background info: the dlls are supplied with the Tobii
Eyetracker (www.tobii.com) SDK. With the SDK examples are
shown to use the objects in C#, C++ 6.0, and VB6. But as
said, I want to use them in Matlab (R14).
The Visual Basic example for one of he objects is as
* Add a reference to the TetComponents type library
* Declare and instantiate with:
Dim WithEvents m_tetClient As TetClie...proxylaza.com unlock myspace.com youtube.com bebo.com facebook , Friendster
unlock myspace.com youtube.com bebo.com facebook , Friendster
Browse the internet securely using YourProxy.com. You can unblock
popular social networking sites such as MySpace, Bebo, Facebook,
YouTube, Orkut, Friendster and many other sites. Feel free to browse
24/7 and don't forget to tell your friends!
click here : http://proxylaza.com
...Matlab COM Builder help
I'm a matlab beginner and I have a doubt when I use the Matlab COM
I create a new project called "Soma3" I just add a m-file called
"Somatorio" to my project, and the following message appears when I
click the button "Build" on the below of the right panel:
"Building standalone executable...
mcc -M -silentsetup -d 'C:/MATLAB6p52/work/Soma3/src' -B
'ccom:Soma3,Soma3,1.0' -i C:/MATLAB6p52/work/Soma3/somatorio.m
Warning: File: somatorio Line: 5 Column: 1
mbuild is choosing an appropriate com...COM or DDE in Matlab for Linux?
Does the Linux-version of MATLAB also contains COM or DDE like the
...Question about DSP in Matlab (beginner)
I'm starting to learn DSP (Matlab )and I have two questions about it,
maybe someone can help me out?
I'm trying to measure a frequency from an Audio Device and I'm using FFT
to transform it from the time domain to the frequency domain. But I am
doing a downsample before the FFT. But you can also do it after the FFT.
Do you know what would be the most efficient (before or after)? And why?
Another question, I am using zero padding to increase my system resolution
(up to 50Hz). My frame length is N=256 and sample frequency fs= 44100 Hz.
So 44100/50 = 882, so I need to add 626 zeroes (to 256 frame length) to
get 50 Hz resolution, I hope this is correct? I believe this is done for
FFT. But is this the same for the DFT?
Thank you and regards,
Posted through http://www.DSPRelated.com
>I'm starting to learn DSP (Matlab )and I have two questions about it,
>maybe someone can help me out?
>I'm trying to measure a frequency from an Audio Device and I'm using FFT
>to transform it from the time domain to the frequency domain. But I am
>doing a downsample before the FFT. But you can also do it after the FFT.
>Do you know what would be the most efficient (before or after)? And
>Another question, I am using zero padding to increase my system
>(up to 50Hz). My frame length is N%6 and sample frequency fs= 44100
>...COM port handle in Matlab
I have a handle to COM port created with win32 C functions. Can
anyone tell me how to pass this handle to Matlab workspace and back
from workspace to c mex function?
of what data type is your COM port handle? I guess the following could work:
cast the pointer of your COM handle to a 32bit integer pointer, and return
32Bit integer to MATLAB. Then push this variable to your c-mex function
(and convert the pointer back to yyou COM handle).
"tomasz bialek" <email@example.com> schrieb im Newsbeitrag
>I ha...MATLAB COM interface #2
Does anyone know how to set up MATLAB as a COM client? I'm trying to
retrieve data from a DSP board using RTDX and the Code Composer Studio
software. As far as I understand, RTDX has a COM interface but I have
no idea how to setup MATLAB as a client to access this data. I also do
not have the CCS link toolbox installed.
Thanks a lot in advance!
> Does anyone know how to set up MATLAB as a COM client? I'm trying to
> retrieve data from a DSP board using RTDX and the Code Composer Studio
> software. As far as I unders...Matlab, COMs y .NET
Hi, I have a problem: I'm using C# with COM objects and I compile in
Matlab a function that returns a NxN dimension matrix. When I call
the method in C# I must to insert a parameter which will return a
value of type �ref object�.
I wrote ...
object pp = null;
And I pass pp as a variable where I want to receive the NxN matrix
and I have the next error �Data conversion error: Unexpected error
My question is �what kind of data should I use to save the matrix
that returns the method of a COM objetc?
Thanks very much
On Tue, 25 Apr 2006 11:36:08 -...Matlab to simulink to TI DSP
We have developed a Wimax 802.16e model using Matlab
floating point implementation.
Now we need to move this model to simulink model and use
real time workbench to implement it on TI DSP.
Is it possible? What's the limitations ?
...C# interface to Matlab COM
Help required getting the Matlab's C# COM example to work.
This topic has poped up in a number of postings, but after reading
all these I haven't completely resolved the problem.
I am ruining Matlab R14PS3 and Visual Studio 2003 on XP Pro, and
trying to implement the C# example given in the matlab help files, no
need to repeat it here again.
I referenced the MATLAB type library using Project/add Reference, the
name space is recognized when building.
I have seen other posts talk about a MATLAB interop assembly, what is
this and what do I need to do to set it up correct...Matlab DSP jobs for graduates
Hi people.First of all I want to thank you all for your contribution
to this newsgroup.I found it very useful during my university
education and hope to use it post graduation.
I have been programming in Matlab for the past 2 years and I am
looking for a job that involves Matlab DSP and algorithm
development.A search on google doesnt give much results so your help
will be appreciated.If you know any agencies that specialise in
Matlab jobs in UK then please share with me.
> Hi people.First of all I want to thank you all for your contribution
> to this newsgr...Matlab COM interface from C++
Has anybody managed to connect to the Matlab COM interface directly from
C++? Not just the "Matlab Engine", which can't be opened in "desktop" mode
with full debugging. I need the debugging features and it appears the only
way to get them is to go directly in through the COM interface.
If so, can I get a copy of the relevant code that connects, shoves data to
and fro, and executes a command? Thanks in advance.
Additionally, has anybody managed to dump out the routines and calling
sequences available through the COM interface? That would be a good start.
James A. (Andy) Moorer
Adobe Systems, Incorporated
On Thu, 02 Oct 2008 01:11:22 GMT, "James A. \(Andy\) Moorer"
>Has anybody managed to connect to the Matlab COM interface directly from
>C++? Not just the "Matlab Engine", which can't be opened in "desktop" mode
>with full debugging. I need the debugging features and it appears the only
>way to get them is to go directly in through the COM interface.
>If so, can I get a copy of the relevant code that connects, shoves data to
>and fro, and executes a command? Thanks in advance.
>Additionally, has anybody managed to dump out the routines and calling
>sequences available through the COM interface? That would be a good start.
It's been a while (as in Matlab 6.5.1) but I have connected C++ code
to Matlab us...Matlab Com-VB interaction
I have an vb application that requires a Matlab dll. By using Com
builder I created a dll which I then load into VB program. But when I
run the VB program I get the following error message where the dll
call is made:
"Error: Subscript indices must either be real positive integers or
I have no idea why? As it can be seen from the listings of both VB
and Matlab files, I believe I do right type conversions. When I run
the Matlab code in Matlab, it works fine. The two input arguments to
routine are ascdata and miss. ascdata is 245985x1 double array, miss
is 5205x1 d...dsp simulation problem using matlab
i hope this the right forum for this type of questions:
please i really need help in solving this problem:
A random process is defined by x(t) =3D A cos(2*pi*f0*t+=CE=A6), 0=E2=89=A6=
t=E2=89=A7T, where A and f0 are constants and =CE=A6 is uniformly distribut=
ed random variable in the range -pi=E2=89=A6=CE=A6=E2=89=A7pi . Generate sa=
mples (at the rate fs=3D80kHz ) over a time interval of length T. Choose th=
e signal length T so that you get about 900 to 1000 samples of the simulate=
d analog signal x(t).
i)Plot the time signal with the function plot so that the samples are conne=
cted. Make sure that you label the time axis of the simulated analog signal=
ii)Find the autocorrelation of the signal and plot it.
iii)Find the Fourier transform of the autocorrelation and plot it.
On Thu, 04 Oct 2012 09:44:26 -0700, Jamal Alkit wrote:
> hi ,
> i hope this the right forum for this type of questions: please i really
> need help in solving this problem:
> A random process is defined by x(t) = A cos(2*pi*f0*t+Φ), 0≦t≧T, where A
> and f0 are constants and Φ is uniformly distributed random variable in
> the range -pi≦Φ≧pi . Generate samples (at the rate fs=80kHz ) over a
> time interval of length T. Choose the signal length T so that you get
> about 900 to 1000 samples of the simulated analog signal x(t).
> i)Plot the time signal with the function plot so that the samples are
> connected. Make sure that ...