>> Z = server.rpc('zeros', 2, 3);
>> Z =
[2x3 double] [2x3 double]
>> Z{1}
ans =
0 0 0
0 0 0
>> Z = server.rpc('zeros', {2,3}, {4,5});
>> Z =
[2x4 double] [3x5 double]
This runs 'zeros' on each slave, but rather than using the same
arguments for both slaves, it passes 2,4 to the first slave, and
3,5 to the second slave. Note that in Example 1 the arguments
were implicitly converted to {2,2}, {3,3} internally.
每个参数用大括号包起来,用逗号分割各个参数来在不同slave上运行。
[M,N]=server.rpc('size', { [1 2 3 4], [1 2]' });
>> M
M =
[1] [2]
>> N
N =
[4] [1]