フィルターのクリア

How can I make one of my parameters always greater than another one?

1 回表示 (過去 30 日間)
Thomas Veith
Thomas Veith 2019 年 6 月 25 日
コメント済み: Thomas Veith 2019 年 6 月 25 日
Hi all,
So I have the code below, how could I change it if I always wanted beta to be larger than alpha0?
Thanks in advance!
n = 1000;
parameters = zeros(n,6);
for k=1:n
alpha0=0.936095503847192;psa0=1.397154668867660;gamma=rand;psi=rand;beta=rand;mse=0;
parameters(k,:) = [alpha0,psa0,gamma,psi*gamma,beta,mse];
end

採用された回答

Jeff Miller
Jeff Miller 2019 年 6 月 25 日
beta = alpha0 + rand;
  1 件のコメント
Thomas Veith
Thomas Veith 2019 年 6 月 25 日
Dang, simplest answer is always the best. Thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by