Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: matlab version and "for" loops
Replies: 15   Last Post: Feb 13, 2013 4:53 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 147
Registered: 3/7/08
Re: matlab version and "for" loops
Posted: Jan 21, 2013 6:16 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Jan Simon" wrote in message <kdj1jg$i5i$1@newscl01ah.mathworks.com>...
> Dear Jessica,
> Yes, "newer" versions of Matlab interpret loops much faster using the JIT acceleration. Please note that this means "newer" than version 6.1 from June 2001.
> To check the difference type:
> feature('accel', 'off')
> feature('jit', 'off')
> and run your program again.
> If you want to accelerate your code, post it here to get our ideas.
> Kind regards, Jan

Thanks for this information. My problem is in running this code:

%Delete saccades except when they mark the start/stop of image
for i=0:DataLength-1
if strcmp(GazeType(DataLength-i,1),'Saccade')==1|strcmp(GazeType(DataLength- i,1),'Unclassified')==1;
if strcmp(PictureStartColumn2(DataLength-i),'ImageStart')==0
if strcmp(PictureStartColumn2(DataLength-i),'ImageEnd')==0;

The loop often needs to run over 300,000 times (i.e., DataLength=300,000). After nearly 8 hours , I stopped the code to find that it was only up to 53,988.

I am basically trying to delete rows in a dataset that are marked as "Saccade" or "Unclassified" unless they are marked as "ImageStart" or "ImageEnd"

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.