I have a for loop of 800000 iterations, it graphs some data everytime the module of this data divided by 1000 is 0, I need the graph to have multiple of the graphed curves.
1 view (last 30 days)
Show older comments
Enrique González
on 20 Oct 2022
Commented: Enrique González
on 21 Oct 2022
Here's my section of code:
if mod(q,1000) == 0
y3 = histcounts(p,binEdges);
plot(y3);
hold on
end
0 Comments
Accepted Answer
Cris LaPierre
on 20 Oct 2022
Edited: Cris LaPierre
on 20 Oct 2022
Your code works for me, although I had to build up a lot of the surrounding code, inferring what it should be from what you said.
binEdges = 0:0.1:1;
for q = 1:800000
p = rand(1000,1);
if mod(q,1000) == 0
y3 = histcounts(p,binEdges);
plot(y3);
hold on
end
end
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!