Using for loops to subplot
조회 수: 3 (최근 30일)
이전 댓글 표시
Let's assume that I have 25 column and 3600 rows.
x = linspace (1,3600,3600); and my y is the values in my 3600 rows.
Now I want to subplot all 25 columns using for loops. How do I do?
댓글 수: 0
답변 (1개)
Star Strider
2022년 12월 20일
편집: Star Strider
2022년 12월 20일
One approach —
x = linspace (1,3600,3600);
y = randn(3600, 25);
figure
for k = 1:size(y,2)
subplot(5, 5, k)
plot(x, y(:,k))
title(sprintf('Column %2d',k))
end
Make appropriate changes to work with your data.
EDIT — Corrected typographical errors.
.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
