Create a random matrix with small gradient

I'd like to create a special random matrix with a small gradient. That is to say, this matrix contains elements from 0 to 1 and follows a specific distribution (unfortunately my math is bad, and I don't know what distribution it is) so that the difference among an element and its surrouding elements is smaller than a given number (for example 0.1). Could anyone give some hints regarding this problem?

1 comentario

Torsten
Torsten el 22 de Mzo. de 2022
Editada: Torsten el 22 de Mzo. de 2022
You can't have the elements drawn independently from a distribution and at the same time have difference less than a given number. These two requirements contradict each other.

Iniciar sesión para comentar.

Respuestas (1)

Matt J
Matt J el 22 de Mzo. de 2022
A=rescale(rand(5),0,0.1);

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Preguntada:

el 22 de Mzo. de 2022

Comentada:

el 22 de Mzo. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by