help-octave
[Top][All Lists]
Advanced

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

Re: Plot function not working


From: Mike Miller
Subject: Re: Plot function not working
Date: Fri, 19 Aug 2016 12:42:26 -0700
User-agent: Mutt/1.6.2-neo (2016-07-23)

On Fri, Aug 19, 2016 at 15:14:35 -0400, Nicholas Jankowski wrote:
> On Fri, Aug 19, 2016 at 1:32 PM, Mike Miller <address@hidden> wrote:
> > Yes I think so. Would you like to see a shadow warning every time a loop
> > variable is named "i" or "j"?
> >
> >
> Personally, yes :)  but then i and j indexing is just a pet peeve of mine.
> but then I also get annoyed at having to write exp(1i*x)

:)

I had other examples, but I figured i/j indexing was the most obvious.

Functions included in Octave use local variables named (among other
things): angle, arg, char, diff, format, lt, path, rows, sum, and times.

> If you recall the other day I was trying to create an empty cell
> 
> >> cell (3,0,2)
> 
> which should work fine.  the error message I got was:
> 
>    error: subscript indices must be either positive integers less than 2^31
> or logicals
> 
> At least to me, it wasn't obvious that this was trying to index a variable
> a typo accidentally named cell. I thought cell() was unable to create an
> empty array.

I agree. In the next version of Octave the error message will be

  error: cell(_,0,_): subscripts must be either integers 1 to (2^31)-1 or 
logicals

Does that help indicate that it's being interpreted as a subscripting
operation on a variable named "cell" instead of a function call? That is
the intent of the new message (see https://savannah.gnu.org/bugs/?45957
for details).

-- 
mike



reply via email to

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