Re: Filling a matrix with values



On Dec 24, 3:13 pm, Lance <Lanc...@xxxxxxxxx> wrote:
On Dec 24, 6:19 am, Jimmy Miller <CaptainThun...@xxxxxxxxx> wrote:

I'm a complete beginner to APL, and I had the following question:

Suppose I have a 16x16 matrix of values. How would I set each value
in the matrix (starting in the second row) equal to the sum of the
matrix element directly above it, and the element to the top-left of
it? Essentially,

m[x;y]=m[x;y-1]+m[x-1;y-1]

But I'm not sure how to express that in APL. I've tried entering just
that in APL (with proper symbols, of course), but it doesn't work
because x and y are arrays, and I need to access only two single
elements of the matrix.

I'm a little confused. You state 'matrix element directly above it',
which to me would be m[x-1,y]. Also, it isn't completely clear to me
the meaning of 'the element to the top-left of it'.

Lance

(1 0↓m)←2+/0,¯1 0↓m ⍝ should do what you asked but the first row and
column might not be what you want.
.



Relevant Pages

  • Re: Filling a matrix with values
    ... in the matrix (starting in the second row) equal to the sum of the ... But I'm not sure how to express that in APL. ... the meaning of 'the element to the top-left of it'. ...
    (comp.lang.apl)
  • RE: Will a Nested IF/SUMIF function instead of VBA?
    ... qualifier (SUMIF can only have one). ... The result are each item in the arrays mulitplied together and summed (ie ... > picking at it just to get the sum of numbers in one column... ...
    (microsoft.public.excel.worksheet.functions)
  • RE: Indirect reference causes statistical function to throw up a #NUM!
    ... This is quite subtle behavior due to ROW/COLUMN returning ... You could try SUM() around each one to make them ordinary values. ... But if arrays are included in the arguments, ... I ran into an odd behavior when trying to use an indirect reference to a ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Examples of SQL anomalies?
    ... DISTINCT option on the parameter, ... similarly, SUM should return 0. ... has no meaning in the universe of discourse. ... need not be the same person occupying that seat on Tuesday night. ...
    (comp.databases.theory)
  • Re: infinity
    ... >>> Such an expression is called an infinite series. ... > and that it does not have meaning. ... >> He doesn't seem to make any claim about the notation, ... It is figured differently, but it is a sum nonetheless, of an infinite number ...
    (sci.math)

Loading