matlab - vector of indices -


i have 10x10 matrix called a:

i have vector of column numbers:

c = [ 2, 6, 8 ];

i have vector of row numbers:

r = [1; 3; 7];

the column numbers correspond each row. i.e. column 1 looking @ row numbers given r, column 3 looking @ row numbers given r , on.

i want replace exact locations in other number 13.

i.e. each of these locations in matrix a:

(1,2) (1,6) (1,8), (3,2), (3, 6), (3,8) want insert 13. 

how achieve above ?

you can a(r,c) = 13 .......


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -