octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #8119] Allow variable tolerance and improv


From: Rik
Subject: [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script
Date: Wed, 07 Aug 2013 14:57:01 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0

Follow-up Comment #15, patch #8119 (project octave):

You've found out most of the answers already, but here goes. 

The find() syntax is the way it is, and we can't change it without breaking
Matlab compatibility.

I used the 'dimstr(end) = []' more as an example of pseudo-code that would
work rather than finished code--I also prefer dimstr(1:end-1).  Incidentally,
I've benchmarked indexing versus deletion and indexing is faster and thus
preferred generally.  Another way to write this would be to treat the first
index as special, rather than the last.  This also works:


sz = size (X);
dimstr = [sprintf("%d",sz(1)) sprintf("x%d",sz(2:end))];


For the indices, I would stay away from eval because it is quite slow in
general.  The sample code I suggested uses sub2ind, but remains within the
current interpreter.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8119>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]