How to plot data with certain time scale from huge data set ?

8 ビュー (過去 30 日間)
VIGNEYSH T
VIGNEYSH T 2014 年 12 月 12 日
回答済み: Andy Thistle 2018 年 12 月 13 日
I want to plot limited set of data from a huge set of data. For example, I run a simulation and save the data set in Timeseries format. My simulation collects data for every millisecond and so there will be around 60,000 data for every second. But I don't want to plot the figure with all the 60,000 data. I just want to plot the figure with 1000 data. How to do this ?
Thanks in advance.
Regards, Vigneysh

回答 (3 件)

Sean de Wolski
Sean de Wolski 2014 年 12 月 12 日
plot(data(1:1000:end))
  1 件のコメント
VIGNEYSH T
VIGNEYSH T 2014 年 12 月 13 日
Dear Sean de Wolski, Thanks for your answer. But I am getting same graph for both of this command. 1. plot(data(1:1000:end)) 2. plot(data)
But I just need to plot the whole graph with 1000 data out of 60000 data . How to get this ?

サインインしてコメントする。


Image Analyst
Image Analyst 2014 年 12 月 13 日
subData = data(1:60:end); % Take every 60th data point out of 60,000, should give 1000 points.
plot(subData)
Now it may look largely the same since you probably have only about 1000 or 1900 pixels across your screen so your screen can't fit all 60,000 across your screen anyway. You'll only see as many as you have pixels across the screen. If you have 1024 pixels across your screen then plotting all 60,000 will look virtually identical to the plot of only 1000 points.
  1 件のコメント
Sean de Wolski
Sean de Wolski 2014 年 12 月 15 日
or
idx = round(linspace(1,length(data),1000));
plot(idx,x(idx))

サインインしてコメントする。


Andy Thistle
Andy Thistle 2018 年 12 月 13 日
I think you are looking to plot a subset of data
plot(data(1:1000))

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by