help-octave
[Top][All Lists]
Advanced

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

Re: Why doesn't pause work in a function


From: Ben Abbott
Subject: Re: Why doesn't pause work in a function
Date: Wed, 15 Feb 2012 11:57:24 -0500

On Feb 13, 2012, at 7:02 PM, J Stasko wrote:

> I didn't see this in the documentation...  Here's my function code:
> 
> function plottrack(x)
>   [slices,values] = size(x)
>   for i = 0 : ((values-3)/6)-2
>   i
>   pause
>   plot(x(:,(i*6)+4),x(:,(i*6)+5))
>   pause
>   endfor
> endfunction
> 
> Here's the output:
> 
> octave-3.4.0:2> plottrack(snaps)
> slices =  31
> values =  183
> error: plottrack: A(I,J): column index out of bounds; value 183 out of bound 
> 183
> error: called from:
> error:   /Users/johns/Programming/diameter/plottrack.m at line 4, column 4
> octave-3.4.0:2>
> 
> 
> So really, there are two questions.  One is why, when i = 28 the
> calculation can yield a column index out of bounds...
> 
> The other is, as I was trying to debug it using "i" and "pause", I
> neither see the value for i nor do I get the pause on my display.
> 
> Thanks for all the help!
> 
> -John Stasko

I tried

        plottrack (rand (31, 183))

Both pause statements work and I encountered no errors.

Ben



reply via email to

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