Matlab加载整个文件,但逐段显示和绘图 [英] Matlab load entire file but show and plot segment by segment

查看:67
本文介绍了Matlab加载整个文件,但逐段显示和绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以加载文件并逐段显示/绘制?我想知道是否有可能,任何人都可以指导我.我设法做到了

Possible to load file and show/plot it segment by segment? i want to know if it is possible and anyone can guide me along. i have manage to do this matlab peak value (found the peak but want to know the value) and now i'm gonna add on to it so i hope you guys don't put my questions on hold/downvoted me. i really need help

示例:

数据大小:10000

Data size: 10000

意图:要加载整个文件,但在1时刻,图仅显示1000个数据,而不显示并绘制整个10000个数据.

Intention: To load the entire file, but at 1 time the fig only show 1000 data instead of showing and plotting the entire 10000 data.

说明: 当我按某些命令时,它将绘制前1000个数据.然后按Enter或某些命令,它将绘制1001-2000等等.

Explanation: When i press some command it will plot the first 1000 data. then i press enter or some command it will plot 1001 - 2000 and so forth..

我有Google,但似乎找不到任何类似的问题

I have google but don't seems to find any similar questions

需要建议.

推荐答案

也许这个例子会有所帮助:

Maybe this example will be helpful:

data = 1:10000;
rows = reshape(data, 1000, numel(data)/1000)';

for ri = 1:size(rows,1)
    figure, plot(rows(ri,:));
    pause;
end

它将数据矢量重塑为10 x 1000的矩阵,以便行包含连续的1000个数据值.然后,只需遍历行并绘制它们以等待按键.

It reshapes data vector into matrix 10 x 1000, so that rows contain consecutive 1000 data values. Then just loop over rows and plot them waiting for keypress.

这篇关于Matlab加载整个文件,但逐段显示和绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆