File: numel.R

package info (click to toggle)
r-cran-matlab 1.0.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 640 kB
  • sloc: sh: 13; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
###
### $Id: numel.R 22 2022-05-30 18:03:47Z proebuck $
###


##-----------------------------------------------------------------------------
test.numel <- function(input, expected) {
    output <- do.call(getFromNamespace("numel", "matlab"), input)
    identical(output, expected)
}

a <- array(NA, c(4, 4, 2))
a[,,1] <- matlab::magic(4)
a[,,2] <- t(a[,,1])

numel.expected.4x4x2 <- 32

test.numel(list(A = a), numel.expected.4x4x2)