【发布时间】:2017-10-28 08:44:57
【问题描述】:
temptemp 是 1 X 44 单元格:每个单元格都是 1 X 3130 数组双精度。
tempwmul 是 1 X 44 单元:每个单元都是 1 X 1 训练网络。
我想用相对数组 double 模拟每个网络:
for ilog=1:44
tempoutemp{ilog} = sim(tempwmul{ilog},temptemp{ilog});
end
在矢量化模式下使用 cellfun :
tempoutemp=cellfun(@sim,tempwmul,temptemp,'UniformOutput', false);
代码不会返回错误,但在矢量化模式下,它始终使用第一个网络 对于所有数组数据和结果显然不同...一些帮助?
【问题讨论】:
-
像
tempoutemp=cellfun(@sim,tempwmul.',temptemp,'UniformOutput', false);这样称呼它有帮助吗?对于像bsxfun这样的东西,至少你需要有不相等的单例维度。 -
cellfun不是矢量化模式。 -
我用 tempotemp=cellfun(@sim,tempwmul.',temptemp,'UniformOutput', false);返回:使用 cellfun 时出错所有输入参数的大小和形状必须相同。以前的输入在维度 1 中的大小为 44。输入 #3 的大小为 1。您确定所有撇号和逗号都正确吗?
-
看来 cellfun 是一种矢量化模式:file:///D:/Documents%20and%20Settings/Emi/Documenti/MATLAB/TEMP/cellfun/New%20Functions%20for%20Vectorizing%20Operations% 20on%20Any%20Data%20Type%20-%20MATLAB%20&%20Simulink.htm
标签: matlab vectorization cell-array