How to form a matrix as our requirements??????
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
VIJAY
am 25 Apr. 2020
Kommentiert: VIJAY
am 26 Apr. 2020
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 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 25 Apr. 2020
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 Kommentare
Ameer Hamza
am 26 Apr. 2020
This is already in quite the simplest form. Any further simplification can only be done by defining your own function.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Detection finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!