PDA

View Full Version : basic MATLAB problem


M11
Apr15-09, 03:13 PM
hi,

1. The problem statement, all variables and given/known data

I am asked to generate 1000 normally distributed random numbers and then plot the scatter and histogram graphs of the data.



3. The attempt at a solution


I used : randn(1000) and it generated the random number, now how can I plot the graphs?

from where can I get the other variable?

MATLABdude
Apr15-09, 03:52 PM
You're probably looking for a histogram plot (e.g. number of points from 0-0.1, from 0.1 to 0.2, etc.) Just plotting the raw points won't give you anything. Plotting a histogram will give you the distribution of points.

MATLAB has a built-in function as well:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/hist.html