Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: multi
See also: diag xdiag

Quantlet: diagrv
Description: replaces the diagonal of x by v

Usage: y = diagrv(x,v)
Input:
x n x p x d1 x d2 ... array of n x p matrices
v np x 1 vector, where np is min(n, p)
Output:
y n x p x d1 x d2 ... array of n x p matrices

Example:
library("multi")
diagrv( diag( #(1, 2) ), 5|5 )

Result:
Contents of y
[1,]        5        0
[2,]        0        5
Example:
library("multi")
diagrv( matrix(3, 2, 2), 5|5 )

Result:
Contents of y
[,,1,1,1,1,1,1]
[1,]        5        1
[2,]        1        5
[3,]        1        1
[,,2,1,1,1,1,1]
[1,]        5        1
[2,]        1        5
[3,]        1        1



Author: MD*Tech, 20021120 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006