How to vectorize histogram of rows in a matrix?
조회 수: 2 (최근 30일)
이전 댓글 표시
Is there any way to vectorize the following where it doesn't use the for loop?
rows = 5;
cols = 20;
z = randn(rows, cols);
for i = 1:size(z,1)
figure;
histogram(z(i,:))
title(['Histogram of row ',num2str(i)]);
xlabel('Bins');
ylabel('Frequency');
end
댓글 수: 1
Ameer Hamza
2020년 10월 27일
This is probably the fastest way. Any other method will likely make it slower and more complicated.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!