필터 지우기
필터 지우기

How to form a matrix as our requirements??????

조회 수: 2 (최근 30일)
VIJAY
VIJAY 2020년 4월 25일
댓글: VIJAY 2020년 4월 26일
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]

채택된 답변

Ameer Hamza
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
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.
VIJAY
VIJAY 2020년 4월 26일
Ok sir thanks for your kind reply

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by