如何使用isfinite()来标记单元格数组的条目是{0×0 double}

2次查看(最近30天)
ZimtBolten
ZimtBolten 2020年8月26日
评论道: ZimtBolten2020年8月26日
你好,我有问题与我的代码的以下部分:
"gaitpar"代表我在Results中列出的所有参数。
>> gaitpar = arrayfun(@(x) x.(ParName),Results.(reg_cats{c}). parameter .(wanted{w}),'UniformOutput',false);
例子:
> > gaitpar”
ans =
28日×1单元阵列
{[1.1972]}
{[1.3210]}
{[1.2991]}
{[1.2173]}
{[1.2618]}
{[1.1945]}
{[1.2525]}
{[1.2423]}
{[1.2174]}
{[1.1083]}
{[0.8304]}
{[1.2841]}
{[1.2616]}
{[1.6553]}
{[1.3607]}
{[1.4981]}
{[1.1102]}
{[0.9010]}
{[1.1059]}
{[1.1211]}
{[1.3518]}
{[1.0669]}
{[1.0120]}
{[1.3397]}
{[1.0557]}
{[1.2142]}
{0×0双}
{[1.2595]}
现在我想使用isfinite()得到1,如果有一个元素,如果有{0×0 double}-元素,则为0。
但is有限(gaitpar')会导致:
未定义的函数'isfinite'输入参数类型为'cell'。
(如果我用an
我该如何解决这个问题?
提前谢谢你!

接受的答案

里克
里克 2020年8月26日
你为什么不想用那个 isempty 选项 cellfun 而不是?
= 1-cellfun (“isempty”, gaitpar);

更多的答案(0)

社区寻宝

在MATLAB中心找到宝藏,并发现社区如何可以帮助你!

开始狩猎!