答案 0 :(得分:4)
答案 1 :(得分:4)
我会写这样一个函数:
function data = cleanseData(data, limits)
limits = sort(limits);
data = data( limits(1) <= data & data <= limits(2) );
end
示例用法:
a = rand(100,1)*10;
b = cleanseData(a, [-2 5]);
c = cleanseData(a, [0 -1]);
答案 2 :(得分:1)
答案 3 :(得分:0)
答案 4 :(得分:0)