Histogram only returns one output.
Ältere Kommentare anzeigen
I am trying to plot a histogram that shows the first digit of any generated number, but when I run the code, it only plots for the last output. For example, if I run the code and the last value for out is 5, the histogram will only plot the 5. Any suggestions?
rng('shuffle')
A = randperm(100,10)
for X = A;
Y = num2str(X)
out = str2num(Y(1))
for out = str2num(Y(1))
histogram(X,9)
end
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Histograms finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
