setstr

Purpose

Set string flag.

Synopsis

STR = setstr(T)

Description

STR = setstr(T), where T is a vector or matrix of numeric values, does not alter the numeric values in T, but it does cause the result to be interpreted as ASCII characters when it is printed.

Ordinarily the elements of T are integers in the range 32:127, which are the printable ASCII characters, or in the range 0:255, which are all 8-bit values. For noninteger values, or values outside the range 0:255, the characters printed are determined by fix(rem(t,256)).

Examples

The statement

ascii = setstr(reshape(32:127,32,3)')
prints a 3-by-32 display of the printable ASCII characters

ascii =
!"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
'abcdefghijklmnopqrstuvwxyz{|}~
The infinite loop

 while 1
    disp(setstr(7))
    pause(2)
 end
attracts attention.

(c) Copyright 1994 by The MathWorks, Inc.