如何在m的窗口中选择序列的n个元素? (matlab)

编程入门 行业动态 更新时间:2024-10-27 19:19:29
本文介绍了如何在m的窗口中选择序列的n个元素? (matlab)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

快速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)

本文发布于:2023-10-31 02:00:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1544656.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:序列   元素   窗口中   如何在   matlab

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!