Borrar filtros
Borrar filtros

How do I generate several datasets of random noise on MATLAB?

1 visualización (últimos 30 días)
Mick
Mick el 30 de Oct. de 2012
I want to generate a couple of datasets of random noise only, then ultimately increase the number of datasets to over 1000, so as to find a maximum value. Do I run some sort of loop? Here is my code so far, for one set:
% set length
l = [1:1440];
% generate single set of noise
N = randn(1,1440);
% plot noise over length
plot(l,N)

Respuestas (1)

Kye Taylor
Kye Taylor el 30 de Oct. de 2012
Editada: Kye Taylor el 30 de Oct. de 2012
The command
N = randn(1440,1000);
will generate 1000 datasets comprising 1440 Gaussian random numbers and store them as columns of the matrix N.
Then
plot(N)
will result in a huge mess on the current axes :).
Then, try
max(N)
to get the maximum value for each of the 1000 datasets, or try
max(N(:))
to get the maximum of all 1440000 random numbers.

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by