Please Help! : Unrecognized function or variable 'crandn'.
2 ビュー (過去 30 日間)
古いコメントを表示
% simple SIMO system
m = 2;
l = 20;
alphabet = [ exp(j*pi/4); exp(j*3/4*pi); exp(j*5/4*pi); exp(j*7/4*pi) ];
h0 = crandn(m, 1);
h1 = crandn(l, 1);
h2 = crandn(m, l);
hmatrix1 = diag(h1);
ptx = 1;
vinit = alphabet(round(4*rand(l, 1)+0.5));
htotinit = (h0+h2*diag(vinit)*h1)*sqrt(ptx);
ginit = htotinit/(1+htotinit'*htotinit);
mseinit = 1/(1+htotinit'*htotinit);
gold = ginit;
vold = vinit;
mseold = mseinit;
iter = 1;
while 1 == 1,
a = hmatrix1'*h2'*gold;
b = gold'*h0-1;
vcand = b/abs(b)*a./abs(a);
vnew = zeros(l, 1);
vnew = sqrt(2)*((real(vnew) > 0)-0.5+j*(imag(vnew) > 0)-0.5);
if round(norm(vnew-vold)) == 0,
break;
end
htotnew = (h0+h2*diag(vnew)*h1)*sqrt(ptx);
gold = 1/(1+htotnew'*htotnew)*htotnew;
mseold = 1/(1+htotnew'*htotnew);
msenew = mseold
vold = vnew;
iter = iter+1;
end
disp(sprintf("MSEinit=%f", mseinit))
disp(sprintf("MSEupdated=%f", msenew))
disp(sprintf("number of iterations=%i", iter))
Why is my matlab showing this error?
I am able to run my code here but not in my matlab program.
Can anyone help?
0 件のコメント
採用された回答
Walter Roberson
2022 年 2 月 27 日
編集済み: Walter Roberson
2025 年 6 月 30 日
4 件のコメント
Walter Roberson
2022 年 2 月 27 日
編集済み: Walter Roberson
2025 年 6 月 30 日
oh I missed that one, it isn't documented! https://www.mathworks.com/matlabcentral/answers/495798-why-can-t-i-use-crand-in-matlab#answer_405656
その他の回答 (1 件)
Bobby Cheng
2025 年 6 月 30 日
編集済み: Steven Lord
2025 年 6 月 30 日
[SL: hyperlinked the function name.]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!