필터 지우기
필터 지우기

How to Split a 50000x2 data in .mat into 100 equal-sized 500x2 data?

조회 수: 1 (최근 30일)
Lee Kai Sin
Lee Kai Sin 2020년 11월 5일
답변: Matt J 2020년 11월 6일
Dear community,
I am trying to split a 50000x2 data in .mat into 100 equal-sized 500x2 data (that will allow me to plot 100 figures afterwards)
Wish to get help from you all.
Thank you.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 5일
This code shows an example of how it can be done
M = rand(50000,2);
C = mat2cell(M, 500*ones(100,1), 2);
figure()
for i = 1:numel(C)
subplot(10,10,i)
plot(C{i}(:,1), C{i}(:,2))
end
  댓글 수: 8
Ameer Hamza
Ameer Hamza 2020년 11월 6일
I am glad to be of help!!!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matt J
Matt J 2020년 11월 6일
One way is to use mat2tiles. For example
A=rand(50000,2);
Asplit=mat2tiles(A,[500,2]);
whos A Asplit
Name Size Bytes Class Attributes
A 50000x2 800000 double
Asplit 100x1 811200 cell

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by