thank you for answer but i need to use b and c to ricreate matrix..
is this a homework assignment? maybe you should provide the complete bounds of what you want to do and we can provide some guidance. otherwise we may just propose more ways that won't work for you. in particular, if you read "help find", you'll learn that if you get three vectors from find you can recreate it as a sparse matrix:
>> help find
If three outputs are requested, 'find' also returns a vector containing the nonzero values. For example:
> i look your site but i don't understand how can i do it..
> i give you another example:
> a = 1 3 4..
> 4 2 1..
> 2 4 5..
> .. . ..
> I have several pairs of rows and columns
> b : 1 3 ......(row)
> c: 2 3 ......(colum)
> for i=1:length(x)
> d(b(x),c(x))= a(b(x),c(x))
> it's possible to do it avoid loop?
You can convert your original matrix into vector aa= a(:); do find thing
and then recover the aa vector and then reshape() it back to original