how can replace randi instead randint?
古いコメントを表示
hi ;i have a question please help me , i want to replace randi instead randint in ofdm_basic code in r2017a , but i dont know how i must do it . please answer and help me . this is that line :
X=randint(1,Nused*Nframe,M); % bit: integer vector
採用された回答
その他の回答 (5 件)
Geoff Hayes
2018 年 1 月 2 日
mohamad - which ofdm_basic code are you referring to? Is this something found on the MATLAB FileExchange or something else? From Communications System Toolbox Release Notes, it looks like randint has been removed from the Communications System Toolbox and is to be replaced with randi.
If we assume that the code
X=randint(1,Nused*Nframe,M)
creates a 1x(Nused*Nframe) matrix with integers in the interval [0,M-1], then we can replace the above with
X = randi(M, 1, Nused*Nframe) - 1;
I think that will work...
4 件のコメント
mohamad gholami
2018 年 1 月 2 日
編集済み: Geoff Hayes
2018 年 1 月 2 日
Geoff Hayes
2018 年 1 月 2 日
ok, so try replacing with the line
X = randi(M, 1, Nused*Nframe) - 1;
I subtract one since randi will generate integers from the interval [1,M] and not the [0,M-1] that randint seems to be using.
mohamad gholami
2018 年 1 月 2 日
Geoff Hayes
2018 年 1 月 3 日
Mochan Yang
2019 年 7 月 22 日
0 投票
bitstream=randi(2,1,N)-1
1 件のコメント
Walter Roberson
2019 年 7 月 22 日
bitstream = randi([0 1], 1, N);
or
bitstream = rand(1,N) >= 0.5;
Yusuf lamah
2020 年 3 月 22 日
0 投票
thank you very much
khalil nasri
2021 年 3 月 6 日
0 投票
randn( )>0;
1 件のコメント
Walter Roberson
2021 年 3 月 6 日
Normal distribution has peak probability at 0 exactly. Does testing for strict greater than give 50% exactly?
HONG CHENG
2022 年 4 月 28 日
you can look at this link
Specifically
You just need to change the order of paramters
a=randint(3,4,[1,4]);
a=randi([1,4],3,4);
カテゴリ
ヘルプ センター および File Exchange で Sources and Sinks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!