Histogram only returns one output.
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!