Info

This question is closed. Reopen it to edit or answer.

could anyone help me to solve the issue in the following code.

1 view (last 30 days)
When i run the code it executes and gives me the result.But what i actually need is AA and BB should not contain any zeros.
Could anyone please help me on it.
a=[3.6910 4.5873 4.4183 4.3806 0;
0 7.2707 5.9523 7.2934 3.7516;
6.0274 0 0 0 6.7603]
siz = size(a)
result1=randi(3,1,5)
idx1 = sub2ind(siz, result1, 1:siz(2))
C1 = zeros(siz)
C1(idx1) = a(idx1)
AA=sum(C1,2)
BB=sum(C1,1)
  3 Comments
jaah navi
jaah navi on 5 Jun 2019
I am trying but unable to get the result.Could you please help me to execute in such a way that AA and BB should not contain any zero values.
Rik
Rik on 5 Jun 2019
@Jaah: please try to limit yourself to at most 1 question per day. This is really tiring for us volunteers. The way you're doing this is reducing the effort people are willing to put into helping you.
YOU SHOULD REALLY CONSIDER TAKING AN EXTENSIVE COURSE IN HOW TO USE MATLAB. Preferably with an instructor that speaks your native language.
@Darova, although I really feel your annoyance (and mostly agree with it), both Jaah and his colleague/classmate Prabha have difficulty with how to use this website. Their mastery of the English language also makes this more difficult. I think blocking this user may be too harsh, although at some point they will just end up on everyones mute-list. I know for a fact some of us were ignoring them both when they averaged at least 5 duplicate question between the two of them.

Answers (0)

Community Treasure Hunt

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

Start Hunting!