Rho

From NARS2000
Revision as of 20:13, 26 November 2014 by Paul Robinson (talk | contribs)
Jump to navigationJump to search

⍴ — Shape or Reshape — Keystroke ALT+r — Character 9076

Note: This is ALT+r; ALT+SHIFT+R will generate the symbol root (√).

Reshape

Z←L⍴R returns an array of shape L whose items are taken from R in row major order, repeated as necessary.
L is a scalar or vector of non-negative integers, and R is an arbitrary array.
If the right argument is empty, the result consists of ×/⍴L copies of the fill item of R.


For example, in origin-1

      2 3⍴⍳6
 1 2 3
 4 5 6
      2 3⍴⍳0
 0 0 0
 0 0 0

The idea for the latter enhancement was taken from Dyalog APL.

Shape

The symbol ⍴ used with no left argument returns the size or dimensions of a scalar, string, vector, array or matrix.

{{article footer}

See Also

NARS 2000 Lang
Tool
Bar
+ - × ÷ * ! ? |
< = >
~ § π .. ,
/ \ ¨ .
_ ¯
Second Row i j k i j k l g p r v x