# TRIU

## Purpose:

Returns the upper triangle of a matrix.

## Syntax:

TRIU(a, d)

 a - A matrix. d - Optional. An integer, the diagonal on and above which to include matrix elements. Defaults to 0, the main diagonal.

## Returns:

An array consisting of the upper triangle of a where the other elements are zero.

## Example:

W1: {{1, 2, 3},

{4, 5, 6},

{7, 8, 9}}

W2: triu(W1)

W2 == {{1, 2, 3},

{0, 5, 6},

{0, 0, 9}}

W3: triu(W1, 1)

W3 == {{0, 2, 3},

{0, 0, 6},

{0, 0, 0}}

W4: triu(W1, -1)

W4 == {{1, 2, 3},

{4, 5, 6},

{0, 8, 9}}

## Remarks:

TRIU(a, 1) is equivalent to UPTRIX(a).

See TRIL to return the lower matrix.

COLNOS

DIAGONAL

LOTRIX

ROWNOS

TRIL

UPTRI

UPTRIX
{"ft_lang_label":"__label__en","ft_lang_prob":0.5824948,"math_prob":0.9965128,"size":606,"snap":"2020-10-2020-16","text_gpt3_token_len":269,"char_repetition_ratio":0.13953489,"word_repetition_ratio":0.04918033,"special_character_ratio":0.46864685,"punctuation_ratio":0.29239765,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9672047,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-04-02T03:56:54Z\",\"WARC-Record-ID\":\"<urn:uuid:32bfed87-ae89-45e8-8baf-b791ff3e6484>\",\"Content-Length\":\"11234\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:566d8afd-ecce-4209-8b0e-9680f5ca6e12>\",\"WARC-Concurrent-To\":\"<urn:uuid:e6b80aca-8817-4a16-b719-6786977bb81f>\",\"WARC-IP-Address\":\"204.14.86.50\",\"WARC-Target-URI\":\"https://www.dadisp.com/webhelp/mergedProjects/refman2/SPLGROUP/TRIU.htm\",\"WARC-Payload-Digest\":\"sha1:CL7BU6JH42TGM4V3UV7YYHRKNGQGHJCK\",\"WARC-Block-Digest\":\"sha1:YNI5L4ICXD2XQO6OMSV7YPS7WLUPRCVJ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-16/CC-MAIN-2020-16_segments_1585370506580.20_warc_CC-MAIN-20200402014600-20200402044600-00287.warc.gz\"}"}