Why can't I use crand() in matlab

8 ビュー (過去 30 日間)
Erfan Wu
Erfan Wu 2019 年 12 月 9 日
編集済み: per isakson 2019 年 12 月 10 日
It is supposed to generate a complex random number, and it worked on my friend's PC, but not mine.

採用された回答

per isakson
per isakson 2019 年 12 月 9 日
編集済み: per isakson 2019 年 12 月 10 日
>> which crand -all % -all toolboxes that are installed on my PC
C:\Program Files\MATLAB\R2018b\toolbox\robust\rctutil\crand.m
>> help crand
out = crand(dim1,dim2)
Complex random matrix generator: generates a complex,
random matrix with a uniform distribution of dimension
DIM1 x DIM2. If only one dimension argument is given,
the output matrix is square.
See also crandn, rand, randn and sysrand.
But as Star Strider says, it's not in the MATLAB documentation
Star Strider's proposal is worth better than being deleted. Try this:
crand = @(m,n) randn(m,n) + 1i*randn(m,n);
C = crand(2,2)
Experiment to get different results, including with different random number generator functions

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by