Why are some COM methods missing?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am using the Python package "comtypes" to open a Matlab COM Automation Server from Python. It seemed to be working just fine, as with the code below I was able to make a Matlab COM object, and set a string to the Matlab workspace.
from comtypes.client import CreateObject
m=CreateObject('Matlab.Desktop.Application')
m.PutCharArray('mystr','base','hello world')
The problem is that it does not let me call "execute" and does not even show "execute" as an available method for that COM object. Here is what it shows me for available methods:
| Feval = func(obj, *args, **kw)
|
| GetCharArray = func(obj, *args, **kw)
|
| GetVariable = func(obj, *args, **kw)
|
| GetWorkspaceData = func(obj, *args, **kw)
|
| MaximizeCommandWindow = func(obj, *args, **kw)
|
| PutCharArray = func(obj, *args, **kw)
|
| PutWorkspaceData = func(obj, *args, **kw)
|
| Quit = func(obj, *args, **kw)
|
| XLEval = func(obj, *args, **kw)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from comtypes.gen._C36E46AB_6A81_457B_9F91_A7719A06287F_0_1_0.DIMLApp:
|
| Visible
I am confused as to why Execute would not be an available call from this COM object; any help would be greatly appreciated.
0 comentarios
Respuestas (1)
Amro
el 20 de Mayo de 2013
This works for me:
import win32com.client
m = win32com.client.Dispatch('matlab.application')
m.Execute("plot(rand(100,1))")
m.Quit()
0 comentarios
Ver también
Categorías
Más información sobre Data Import and Export en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!