Second problem uitable
1 次查看(过去 30 天)
显示 更早的评论
i have another problem similarly with before:
m=3; d=5; b=num2cell(zeros(m,d)); b{1,1} = rand; b{1,6} = rand; b{2,7} = rand;
how can I save the 0 filled cells and random number filled cells differently?
0 个评论
采纳的回答
Walter Roberson
2011-11-2
iszero = cellfun(@(p) isequal(p,0),b);
Now you can find(iszero) or find(~iszero) or use b(~iszero)
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!