passesFilter
Class: mlreportgen.dom.ProgressMessage
Namespace: mlreportgen.dom
Determine if message passes filter
Description
Examples
Determine Whether a Message Passes a Filter
This example shows how to add a progress message to display when generating a report.
Add a dispatcher and listener to the report. Configure the dispatcher to include debug messages.
import mlreportgen.dom.*; d = Document('test','html'); dispatcher = MessageDispatcher.getTheDispatcher; dispatcher.Filter.DebugMessagesPass = true; l = addlistener(dispatcher,'Message', ... @(src, evtdata) disp(evtdata.Message.formatAsText));
Create a progress message.
open(d); dispatch(dispatcher, ProgressMessage('starting chapter',d)); p = Paragraph('Chapter '); p.Tag = 'chapter title'; p.Style = { CounterInc('chapter'),... CounterReset('table'),WhiteSpace('pre') }; append(p,AutoNumber('chapter')); append(d,p);
Generate the report and delete the listener.
close(d); rptview('test','html'); delete(l);
Check the progress messages in the MATLAB® Command
Window. In addition to the predefined DOM progress messages, the starting
chapter
message added in this example appears. The output
also includes debug messages.
Input Arguments
message
— DOM progress message
mlreportgen.dom.ProgressMessage
object
DOM progress message, specified as an mlreportgen.dom.ProgressMessage
object.
filter
— Filter to use with message
mlreportgen.dom.MessageFilter
object
Filter to use with the progress message, specified as an mlreportgen.dom.MessageFilter
object.
Output Arguments
tf
— Indication of whether the message passes the filter
a Boolean
1
— Messages passes the specified filter (the dispatcher handles the message)0
— Messages fails the specified filter (the dispatcher ignores the message)
Version History
Introduced in R2014b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)