【问题标题】:MATLAB: Replace a row/column in a cell array with NaN [duplicate]MATLAB:用 NaN 替换元胞数组中的行/列 [重复]
【发布时间】:2018-06-28 16:28:54
【问题描述】:

我应该如何用 NaN 替换元胞数组中的完整行/列?

test = cell(3,2);

% These calls won't do it
test{2,:} = nan;
test(2,:) = nan;

【问题讨论】:

    标签: matlab nan cell-array


    【解决方案1】:
    test(2,:) = repmat({nan},1,2);
    

    【讨论】:

    • 如果它只是相同的值test1(2,:) = {nan};
    猜你喜欢
    • 1970-01-01
    • 2016-10-08
    • 2015-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-07
    相关资源
    最近更新 更多