Generating two Random sequences

1 回表示 (過去 30 日間)
University Student
University Student 2021 年 1 月 19 日
コメント済み: Jeff Miller 2021 年 1 月 19 日
What is the best way to generate two random sequences that are 100 characters long and randomly comprised of +1 and -1. Also what is the best way to capture those values and plot in a histogram for each sequence, as well as the spectral analysis for each sequence?
  3 件のコメント
University Student
University Student 2021 年 1 月 19 日
It is essentially a coin flip. So to answer your first bullet point question, yes.
Jeff Miller
Jeff Miller 2021 年 1 月 19 日
The coin flip is bullet point 2, not 1, because 100 coin tosses will rarely end up exactly 50/50.

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

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 1 月 19 日
編集済み: KALYAN ACHARJYA 2021 年 1 月 19 日
Hint: One Way, you can do multiple ways
data=repmat([1,-1],[1,50])
seq1=data(randperm(100));
seq2=data(randperm(100));
Fore histogram, refer hist function

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by