From help-octave-request at bevo dot che dot wisc dot edu Sat Mar 27 08:26:11 2004 Subject: Unidentified subject! From: "Antonio L." To: help-octave at bevo dot che dot wisc dot edu Date: Sat, 27 Mar 2004 07:58:25 -0600 Hello, mi problem can be split into two separated topics: - Is there a more efficient way of doing this? (that is, without 'for' looping): for i=1:n M(I(n,1),J(n,1)) = V(n,1); endfor; Where V,I,J are nx1 vectors, and M is a nxm matrix? Suposing indexing M with values contained in vectors I and J is always possible. It should be obvious that the best way for doing so would simply be M(I,J) = V; but octave doesn't works like that. - Supposing we can do that, what about dealing with the case where [I,J] values could index cells outside the given matrix? Just like the code below: for i=1:n for j=1:m if ( (0