Question about plotting a set of random uniformly distributed numbers.

2 views (last 30 days)
Alright, so I need to make a plot of 100 random normally distributed numbers between 0 and 20. Then I need to re-plot the same set of numbers on the same graph but change the color as well as the mark to an 'X'. This is what I have:
i
% rand1 = 20*rand(10);
plot(rand1)
% setting rand1 equal to the set of random numbers between 1 and 20 then
% ploting that set of numbers
title('100 Random Uniformly Distributed Numbers');
xlabel('X-Axis');
ylabel('Y-Axis');
% Giving the graph a title and label
hold on
% keeps the same plot open
But for some reason my graph comes up crazy. It's not a scatter plot and each line is a different color, any ideas?
The I know I would re-plot the same data but I'm not sure how to change the color or the marker to an 'x'.

Answers (1)

Walter Roberson
Walter Roberson on 11 Apr 2014
Use scatter() for a scatter plot. But remember you will need a second coordinate, which you do not have at the moment.
rand() does not create normally distributed numbers as required for your question. Normally distributed numbers cannot be confined within any particular limits or else they are not normally distributed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!