【发布时间】:2017-06-05 22:58:05
【问题描述】:
我有两个 matlab 可以存储的大量元素的数组。当我尝试使用函数 interp1 使用它们进行插值时,问题就来了。出现错误提示“内存不足 - interp1 中的错误(第 122 行) 如果有的话(差异(X)
time; % Vector, length(time)=91542016
Results; % Vector with the results for each time step, length(Results)=91542016
A=1:1:(10^7); %Vector of positions in which I want to interpolate
E=interp1(time,Results,A,'previous'); %Vector in which I want to store the interpolation
【问题讨论】:
-
你能告诉我们你正在使用的代码吗?
-
根据您想要做的插值类型(线性?),您可以使用循环。它会很慢,但内存效率很高
-
我想要“以前的”类型插值
-
time和Results每个需要 730 MB 的 RAM,A和E每个需要另外 80MB,总共大约 1.6GB + 一些开销。你有超过 2GB 的内存吗?你的记忆中还有其他大向量吗? -
你不能一次考虑
A的一部分吗?