yarp_read.m

来自「一个语言识别引擎」· M 代码 · 共 32 行

M
32
字号
% show how to call YARP from Matlab.
% Write a bottle (quivalent to yarp write)
% -nat

LoadYarp;

done=0;

port=Port;
%first close the port just in case
port.close;

disp('Going to open port /matlab/read');
port.open('/matlab/read');

disp('Please connect to a bottle sink (e.g. yarp write)');
disp('The program closes when ''quit'' is received');

b=Bottle;
while(~done)
  port.read(b);
  disp(b);
  
  if (strcmp(b.toString, 'quit'))
	done=1;
  end
end

port.close;
  
  
  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?