How do I get each iteration of a for loop into a single row matrix?
조회 수: 2 (최근 30일)
이전 댓글 표시
Here I am getting each iteration correctly but I need pmf to be a row matrix with the answers from 0 to max(Data).
function [pmf] = CalcRelFreq(Data);
for range = 0:max(Data)
pmf = [1 ;sum(Data == range)/length(Data)]
end
댓글 수: 2
James Tursa
2025년 4월 24일
편집: James Tursa
2025년 4월 24일
What is size(Data)? Please provide a small example input and desired output. pmf looks like a column vector, so it is unclear how you want these stacked into a row vector.
참고 항목
카테고리
Help Center 및 File Exchange에서 Continuous Wavelet Transforms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!