フィルターのクリア

Plotting 100 rows from 10000 rows automatically?

2 ビュー (過去 30 日間)
Siavash Esfahani
Siavash Esfahani 2016 年 8 月 19 日
コメント済み: Thorsten 2016 年 8 月 19 日
Hi, I have a set of data with 10000 rows and 6 columns. I need to plot every 100 rows with 6 columns automatically. I appreciate it if any one can help me. Many thanks Siavash
  1 件のコメント
Filip Hanzely
Filip Hanzely 2016 年 8 月 19 日
Hi Siavash,
could you please specify your problem? Are the data stored in 10000x6 matrix? Do you want to plot the 100x6 data? Sorry, I can not understand yours problem.
Filip

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

回答 (2 件)

Thorsten
Thorsten 2016 年 8 月 19 日
編集済み: Thorsten 2016 年 8 月 19 日
data = rand(10000, 6);
for i= 1:10
i1 = (i-1)*100 + 1;
i2 = i1+100 - 1;
subplot(2,5,i), plot(data(i1:i2,:)')
end
or remove the transpose operator ', depending on what you want to plot
subplot(2,5,i), plot(data(i1:i2,:))

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 19 日
編集済み: Azzi Abdelmalek 2016 年 8 月 19 日
A=rand(1000,6) % ------Example---
%you can use cell array or 3-D matrix
B=mat2cell(A,100*ones(10,1),6)
%Then use a for loop to do your plot
for k=1:numel(B)
a=B{k}
% do what you want with a 100x6 matrix a
end
You can also, use a 3-D matrix
A=rand(1000,6)
B=permute(reshape(A',6,1000,[]),[2 1 3])
  1 件のコメント
Thorsten
Thorsten 2016 年 8 月 19 日
You mean
B=permute(reshape(A',6,100,[]),[2 1 3]);

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

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by