urbiSetDevicesFields

PURPOSE ^

Set multiple devices or variables values at the same time;

SYNOPSIS ^

function urbiSetDevicesFields(con, listDevicesFields, listValues)

DESCRIPTION ^

 Set multiple devices or variables values at the same time;

 e.g. setDevices(aibo, {'headPan.val', 'headTilt.val', 'myVar'}, [-10 20 3.5]) ;

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function urbiSetDevicesFields(con, listDevicesFields, listValues)
0002 % Set multiple devices or variables values at the same time;
0003 %
0004 % e.g. setDevices(aibo, {'headPan.val', 'headTilt.val', 'myVar'}, [-10 20 3.5]) ;
0005 
0006 n = size(listDevicesFields, 2);
0007 V = zeros(1, n);
0008 cmd = [];
0009 % Compose the command string
0010 for i=1:n
0011     cmd = [cmd ' & ' listDevicesFields{i} '=' num2str(listValues(i))];
0012 end;
0013 cmd = cmd(4:size(cmd, 2));
0014 urbiSend (con, [cmd ';']);

Generated on Tue 20-Dec-2005 19:05:34 by m2html © 2003