help-octave
[Top][All Lists]
Advanced

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

Re: max value : problem with array


From: Andreas Weber
Subject: Re: max value : problem with array
Date: Sat, 20 Oct 2018 16:51:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

Am 19.10.18 um 23:22 schrieb LucaLuca:
hi,
look that:

  a=[3 6 4 7 3]
a =

    3   6   4   7   3

max(a)
=

error: A(I): index out of bounds; value 7 out of bound 5

  why?

I'm sure you've overwirtten "max" which you can show with "which max".
Typically this shows:

octave:2> which max
'max' is a built-in function from the file libinterp/corefcn/max.cc

but as soon as you've overwritten it:


octave:3> max = 5
max =  5
octave:4> which max
'max' is a variable




reply via email to

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