Storing matrices value based on another matrix
이전 댓글 표시
I have a 5 by 5 matrix such as A =
0 1 0 0 0
1 0 0 0 1
2 0 0 0 0
0 0 0 0 0
0 0 1 0 0
And another column matrix B =
0.05
0.10
0.15
0.20
0.25
I have to solve the following problems
“If there is a non zero number in A matrix, it will look into same row of B matrix and store the B matrix number in another matrix named as C. If the non-zero number in A matrix is greater than 1, then it will store that number of times of B matrix same row value in C ”.
So, here C will be,
0.10 0.05 0.25 Nan 0.10
0.15 Nan Nan Nan Nan
0.15 Nan Nan Nan Nan
How can I write a code for C? Thanks in advance.
댓글 수: 2
dpb
2019년 8월 3일
What have you done so far and where, specifically, did you have a particular ML question? We don't just solve homework problems w/o seeing effort being made.
The partial solution for C doesn't appear at all to match the output requested from the problem description, however.
Rupayan Saha
2019년 8월 3일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!