How to form a matrix as our requirements??????
1 回表示 (過去 30 日間)
古いコメントを表示
Hello
I wanna create a matrix as size is 50rows 6 columns.The sum of each row is 100. the value limits is 0 to 100 its may be float value .For example of one row is
[20 40 10 5 5 20]
0 件のコメント
採用された回答
Ameer Hamza
2020 年 4 月 25 日
x = rand(50, 6);
x = x./sum(x,2)*100;
Result
>> sum(x,2)
ans =
100.0000
100.0000
100.0000
..
..
..
100.0000
100.0000
4 件のコメント
Ameer Hamza
2020 年 4 月 26 日
This is already in quite the simplest form. Any further simplification can only be done by defining your own function.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Detection についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!