cellfun error when using
显示 更早的评论
Hi everyone, can you help me for my code? this is my code:
clear all
samples = [ 88 93 82 39 58 55 90 68 4 78 85 95 24 57 8 68
66 88 45 16 24 67 32 66 97 78 85 58 73 16 37 18
6 32 59 44 81 22 31 94 24 61 68 91 88 62 79 66
100 93 13 83 39 37 29 28 22 80 59 79 22 85 92 97
8 50 21 6 14 84 93 34 20 4 51 60 100 72 55 13
39 10 8 49 13 52 69 47 40 73 42 45 83 9 58 49
89 20 82 84 37 74 68 56 54 93 99 36 44 90 26 50
37 15 73 73 11 37 33 19 97 25 21 75 56 85 68 83
98 12 62 61 59 78 39 9 78 21 53 25 74 21 73 20
52 84 87 58 33 5 38 99 88 21 16 15 73 42 6 23
67 3 55 10 20 44 30 11 53 85 41 46 23 71 46 79
72 79 16 38 86 88 19 69 43 64 21 30 74 57 8 32
100 75 64 61 86 7 93 91 43 44 34 49 81 30 95 55
53 14 84 89 62 8 24 63 100 48 63 54 80 16 81 88
8 61 73 96 54 5 83 96 59 90 72 75 98 40 71 76
100 6 17 21 32 65 6 68 99 29 79 18 20 70 49 85];
threshold = 90;
for r=1:16
for c=1:16
CellActivate(r,c) = {samples(r,c)};
CellConfig.Boosts{r,c} = rand(2,2);
CellConfig.value{r,c} = 2*ones(2,2);
end
end
E = cellfun( @(B,C) B(C>threshold)+ones(2,2) , CellConfig.Boosts, CellActivate,'UniformOutput',false);
my point is E will return value of B( when C > threshold) plus ones(2,2).
Thank for your help.
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!