我写了一个函数来和三行矩阵的每一行。
然后使用一个矩阵,其中有一行和三列来对前面的结果进行除法。
但我一直在犯这个错误。我知道下标不应该是十进制或负数。但我还是找不到凶手。帮帮忙,谢谢。
% mean_access_time(ipinfo_dist, [306, 32, 192])
% 'ipinfo_dist' is a matrix which have three rows and column is not fixed.
function result = mean_access_time(hash_mat, element_num)
access_time_sum = sum(rot90(hash_mat));
result = bsxfun (@rdivide, access_time_sum, element_num);例如:
A=
1 2
3 4
5 6B= 7 8 9
那我就想
[(1+2)/7, (3+4)/8, (5+6)/9]更新:
>> which rot90
/lou/matlab/toolbox/matlab/elmat/rot90.m
>> which sum
built-in (/lou/matlab/toolbox/matlab/datafun/@uint8/sum) % uint8 method罪魁祸首:在前面的命令行中使用mean_access_time作为变量。
发布于 2013-03-11 13:04:57
似乎您已经重写了具有变量名的内置函数( rot90或sum )。
类型
>> dbstop if error然后运行你的代码。
当错误发生时,类型
K>> which rot90
K>> which sum查看是否有内置函数或变量名。
https://stackoverflow.com/questions/15339173
复制相似问题