Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Why Matlab "find" operation is not reversible?
Replies: 3   Last Post: Apr 7, 2000 8:34 AM

 Messages: [ Previous | Next ]
 Jacob Nikom Posts: 8 Registered: 12/7/04
Why Matlab "find" operation is not reversible?
Posted: Apr 6, 2000 4:08 PM

Hi,

I am trying to understand why Matlab "find"
operation is not reversible.

I have simple matrix:

a = [0 0 1 0
0 1 0 0
0 0 0 1
0 0 1 0];

I found its non-zero indexes
(indexes of non-zero elements):
[ii,jj] = find(a);

Now I recreate the matrix a:
b = zeros(4);
b(ii,jj) = 1

b =

0 1 1 1
0 1 1 1
0 1 1 1
0 1 1 1

I got a wrong answer which means find operation
is not reversible.

Is it a bug, feature or I am wrong somewhere?

Jacob Nikom

Date Subject Author
4/6/00 Jacob Nikom
4/6/00 Peter Torrione
4/7/00 Lars Gregersen
4/7/00 Peter John Acklam