<< mps_set_ele_seq mpscilab mps_size >>

mpscilab >> mpscilab > mps_sformat

mps_sformat

Configure the scalar display format

Calling Sequence

f = mps_sformat()
mps_sformat( f )
mps_sformat( format, width )

Arguments

f

1x2 vector of double

format

single character string

width

integer

Description

Set the current display format and width when printing scalar multi-precision value (1x1 matrices). By default the same format as matrix printing is used until one is explicitly configured. The following scalar printing mode are supported.

"v"

Variable format (default). In this format the shorter of the classic full length format or the scientific notation is used. The width is used to control how many digits the classic format uses before switching.

"e"

Always use the scientific notation.

"n"

Disable the special treatment of scalar printing and use the same format as full matrix printing.

f = mps_sformat()

Return a 1x2 vector with the current format and width encoded as integers.

mps_sformats()

Set the format using a 1x2 vector as returned by the previous case.

mps_sformats( format, width )

Set the format using its character code with the given width.

Restrictions

The maximum width is 1000 digits and the minimum 5.

Usage notes

The printing of high precision data is very computationally intensive even for small width. The "i" format is recommended for matrix to large to be printed quickly. MPScilab optionally recognize the printing of a scalar (1x1 MPS matrix) as a special case. As such it is possible to use a different wider printing format for scalars and a smaller more compact format for matrices. The matrix printing mode can be configured using mps_format,

Examples

mpsA = mps_const_pi(2,2,100);
// Variable printing with a 25 digits width.
mps_sformat( "v", 25 )
mpsA(1,1)

// Wide scientific notation for scalar printing but more compact format for
// full matrices.
mps_sformat( "v", 15 )
mps_sformat( "e", 50 )
mpsA
mpsA(2,2)

//Disable special scalar printing.
mps_format( "n", 25 )

See Also

<< mps_set_ele_seq mpscilab mps_size >>