how to create initial population of 100 random numbers

Please i need help on what parameters to use in order to create a 10*10 grid environment with this syntax: [Chrom Lind BaseV] = crtbp(Nind, Lind, Base).

 採用された回答

Andrew Reibold
Andrew Reibold 2014 年 8 月 22 日
編集済み: Andrew Reibold 2014 年 8 月 25 日

1 投票

You can generate random number grids using the function rand
rows = 3;
columns = 3;
Numbers = rand(rows,columns)
Numbers =
0.162182308193243 0.528533135506213 0.262971284540144
0.748151592823709 0.794284540683907 0.165648729499781
0.654079098476782 0.450541598502498 0.311215042044805
All of the random numbers will be between 0 and 1. If you want them to be between 0 and 100, multiply it by 100. If you want them to be between 25 and 75, multiple by 50 and add 25. (And so on with lots of other examples).

4 件のコメント

ibrahim
ibrahim 2014 年 8 月 26 日
Thank you. could you help with how i can create grid with the numbers generated?
Andrew Reibold
Andrew Reibold 2014 年 8 月 26 日
編集済み: Andrew Reibold 2014 年 8 月 26 日
Well, what exactly do you mean when you say grid?
Grid computing is the collection of computer resources from multiple locations to reach a common goal. Other people might interpret a 'grid' of numbers to be an 'array' of number, which we have already generated but can still alter/improve.
What are you trying to get Matlab to do?
ibrahim
ibrahim 2014 年 9 月 1 日
Attached above is what i mean by grid. My question now is how can i have the generated random numbers put in the grid. i tried the function grid on but gave me error.
Thanks.
Guillaume
Guillaume 2014 年 9 月 1 日
Ibrahim, since your initial question has been answered and you're now asking a different question, you'll be better off starting a new question.
Be a bit more explicit in your new question. In particular, if you get an error message, write what that message is.

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

その他の回答 (0 件)

カテゴリ

質問済み:

2014 年 8 月 22 日

コメント済み:

2014 年 9 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by