matlab server mapreduce

本文通过示例展示了如何使用RPC进行远程过程调用,包括初始化零矩阵和获取矩阵大小的方法。对于不同slave节点,可以传递不同的参数,实现灵活的数据处理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

>> 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]

转载于:https://www.cnblogs.com/huashiyiqike/p/3702902.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值