help-octave
[Top][All Lists]
Advanced

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

Re: very very very slow computing


From: John W. Eaton
Subject: Re: very very very slow computing
Date: Sat, 7 Feb 2009 08:56:27 -0500

On  7-Feb-2009, Depo wrote:

| 
| > I guess your problem is missing semicolon in line
| >    new_sign_difference(k,i)=sign_difference(k,i)
| > which means that whole matrix is printed in every cycle . After I
| > removed output to screen by adding semicolon and removing both disp()
| > commands, the assignment takes about 2.5 secs on my computer (for
| > 10*3000 matrix).
| 
| That was the problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Even in my computer
| works

Dude, take it easy on the ! key.  Or does that key on your keyboard
sometimes get stuck?

Please tell us that you did also understand the advice about Octave
providing an array-based language, and that you should not be writing
loops to copy matrices.  All you need to do to copy a matrix is

  mx = rand (3);
  new_mx = mx;

Nice, simple, and fast.  A second copy is not even really made until
you modify some element of mx or new_mx.  Magic!!!!!!!!!!!!! (oops,
stuck key).

jwe


reply via email to

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