Matrix row column number representation in MATLAB For example, I is a known matrix with four numbers a, B, C and D How to define that a and B represent line a and line B of I Let C and d represent column C and D of I And then do the calculation? a. B, C and D are not straight elements. For example, a = 100 means that a represents the 100th line of I

Matrix row column number representation in MATLAB For example, I is a known matrix with four numbers a, B, C and D How to define that a and B represent line a and line B of I Let C and d represent column C and D of I And then do the calculation? a. B, C and D are not straight elements. For example, a = 100 means that a represents the 100th line of I


The third line with a as l:
a = l(:,3)
Others, and so on



How to extract an element of matrix equal to a known number by MATLAB


Using the find function
for example
>> a=magic(3)
a =
8 1 6
3 5 7
4 9 2
We need to find 7 in a
>> b=a(find(a==7))
b =
seven
So we found 7



How does matlab generate a random matrix with the sum of each line equal to 1?


a=unifrnd(0,1,5,9)
a(:,10)=1-sum(a,2)
for k=1:5
a(k,:)=a(k,[randperm(10)]);
end
a
sum(a,2)