Main Content

本页采用了机器翻译。点击此处可查看最新英文版本。

dispatch

类: mlreportgen.ppt.MessageDispatcher
命名空间: mlreportgen.ppt

发送 PPT 状态消息

说明

dispatch(dispatcher,message) 发送 PPT 状态消息。

示例

示例

全部展开

此示例显示如何添加在生成报告时显示的进度消息。

向演示文稿中添加调度程序和侦听程序。

import mlreportgen.ppt.*;
pre = Presentation('myPresentation.pptx');
     
dispatcher = MessageDispatcher.getTheDispatcher;
l = addlistener(dispatcher,'Message', ...
      @(src, evtdata) disp(evtdata.Message.formatAsText));
     
dispatch(dispatcher,ErrorMessage('invalid slide',pre));
open(pre);
     
titleText = Text('This is a Title');
titleText.Style = {Bold};

replace(pre,'Title',titleText);
     
close(pre);
     
delete(l);

检查 MATLAB® 命令窗口中的进度消息。除了预定义的 PPT 进度消息外,还会出现 starting chapter 消息。

输入参数

全部展开

PPT 消息调度程序,指定为 mlreportgen.ppt.MessageDispatcher 对象。

要发送的消息,指定为 PPT 消息对象。使用以下类型的 PPT 消息对象之一:

  • mlreportgen.ppt.ProgressMessage

  • mlreportgen.ppt.WarningMessage

  • mlreportgen.ppt.ErrorMessage

  • mlreportgen.ppt.DebugMessage

版本历史记录

在 R2015b 中推出