フィルターのクリア

Matlab command for generating random rational numbers between -1 and 0?

1 回表示 (過去 30 日間)
sara
sara 2014 年 8 月 18 日
コメント済み: Johan Löfberg 2014 年 8 月 19 日
Anyone knows that how can I generate rational numbers between -1 and 0?

採用された回答

Adam
Adam 2014 年 8 月 18 日
  8 件のコメント
Adam
Adam 2014 年 8 月 18 日
Sorry, I've never heard of it
Johan Löfberg
Johan Löfberg 2014 年 8 月 19 日
What does YALMIP have to do with this question? Post your YALMIP questions on https://groups.google.com/forum/?fromgroups=#!forum/yalmip

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

その他の回答 (1 件)

Ben11
Ben11 2014 年 8 月 18 日
編集済み: Ben11 2014 年 8 月 18 日
Like this?
a = -1;
b = 0;
r = a+(b-a)*rand(1,1)
If you want many of them change the inputs to rand. And if you want the fractional representation, use rats(r).

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by