help-octave
[Top][All Lists]
Advanced

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

Re: slow 'eval' function - maybe pointers would do?


From: Judd Storrs
Subject: Re: slow 'eval' function - maybe pointers would do?
Date: Fri, 30 Oct 2009 11:40:46 -0400

> for j=1:N
>   eval(  [ 's.k', int2str(j), ' = ks ( :, j );' ]     );
> endfor

If you want to make people shake their heads in disgust and pretend
they don't know you in public (probably also in private) while they
mutter under their breath about the coming of the end times and your
personal role as /the cause/ of hadal cooling, you can try (on linux
at least--I don't know how portable /dev/shm is to other unixen):

fid = fopen('/dev/shm/look_ma_no_eval.m','w') ;
fprintf(fid, "s.k%d = ks ( :, %d );\n" , 1:N, 1:N);
fclose(fid) ;
source /dev/shm/look_ma_no_eval.m ;
unlink /dev/shm/look_ma_no_eval.m ;

;)


--judd


P.S. Don't do this.

P.P.S. I have done this. /o\


reply via email to

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