快速MATLAB问题. 在"m"个窗口中选择一定数量的元素"n"的最佳/最有效方法是什么.换句话说,我要选择序列的前50个元素,然后选择元素10-60,然后选择元素20-70. 现在,我的序列是矢量格式(但是可以很容易地更改).
Quick MATLAB question. What would be the best/most efficient way to select a certain number of elements, 'n' in windows of 'm'. In other words, I want to select the first 50 elements of a sequence, then elements 10-60, then elements 20-70 ect. Right now, my sequence is in vector format(but this can easily be changed).
我正在处理的序列太长,无法存储在我的RAM中.我需要能够创建窗口,然后调用要分析/执行另一个命令的窗口.
The sequences that I am dealing with are too long to be stored in my RAM. I need to be able to create the windows, and then call upon the window that I want to analyze/preform another command on.
推荐答案您是否有足够的RAM可以在内存中存储50×nWindow数组?在这种情况下,您可以一次性生成窗口,然后将处理应用于每一列
Do you have enough RAM to store a 50-by-nWindow array in memory? In that case, you can generate your windows in one go, and then apply your processing on each column
%# idxMatrix has 1:50 in first col, 11:60 in second col etc idxMatrix = bsxfun(@plus,(1:50)',0:10:length(yourVector)-50); %'# %# reshapedData is a 50-by-numberOfWindows array reshapedData = yourVector(idxMatrix); %# now you can do processing on each column, e.g. maximumOfEachWindow = max(reshapedData,[],1);更多推荐
如何在m的窗口中选择序列的n个元素? (matlab)
发布评论