【发布时间】:2012-01-12 13:47:04
【问题描述】:
有一个 ActiveX 函数,我想从 MATLAB 调用它,例如
PrintOut([Background], [Append], [Range], [OutputFileName], [From], [To], [Item], [Copies],
[Pages], [PageType], [PrintToFile], [Collate], [FileName], [ActivePrinterMacGX],
[ManualDuplexPrint], [PrintZoomColumn], [PrintZoomRow], [PrintZoomPaperWidth],
[PrintZoomPaperHeight])
并像下面这样使用它:
hdlActiveX = actxserver('Word.Application');
hdlActiveX.PrintOut(opt args, needed args, opt opts, needed args);
PrintOut 函数调用中的所有参数都是可选参数。但是,对于特定情况,我需要指定参数 #3、#9、#10 并将所有其他参数保留为默认值。是否可以在通过 MATLAB 调用的 ActiveX 函数调用中指定缺失值或默认值?!?
在 C# 中可以这样完成,但在 Matlab ActiveX 中......?!?
this.PrintOut(ref Background, ref missing, ref Range, ref missing,
ref missing, ref missing, ref missing, ref Copies,
ref missing, ref PageType, ref PrintToFile, ref Collate,
ref missing, ref ManualDuplexPrint, ref PrintZoomColumn,
ref PrintZoomRow, ref missing, ref missing);
问候,
【问题讨论】:
标签: matlab activex optional-parameters