Create a random matrix with small gradient

11 ビュー (過去 30 日間)
Jiapeng Zhao
Jiapeng Zhao 2022 年 3 月 22 日
コメント済み: Torsten 2022 年 3 月 22 日
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 件のコメント
Torsten
Torsten 2022 年 3 月 22 日
編集済み: Torsten 2022 年 3 月 22 日
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.

サインインしてコメントする。

回答 (1 件)

Matt J
Matt J 2022 年 3 月 22 日
A=rescale(rand(5),0,0.1);
  1 件のコメント
Torsten
Torsten 2022 年 3 月 22 日
A and rand(5) follow different distributions.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by