MATLAB 帮助中心
丢弃消息
discard(message_name)
discard(message_name) 丢弃有效的输入或局部消息。在图丢弃一条消息后,它可以在同一时间步中从队列中删除另一条消息。图无法访问已丢弃消息的数据。
message_name
示例
全部展开
检查队列中是否存在消息 M。如果消息存在,则将其从队列中删除。如果消息的数据值等于 3,则丢弃该消息。
M
during: if receive(M) == true if M.data == 3 discard(M); end end
在 R2015b 中推出
receive
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处