How do I get each iteration of a for loop into a single row matrix?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
James Tursa
il 24 Apr 2025
Modificato: James Tursa
il 24 Apr 2025
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.
Vedere anche
Categorie
Scopri di più su Continuous Wavelet Transforms in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!