File Exchange

image thumbnail

vect2str -- vector to string conversion

version 1.0.0.0 (1.94 KB) by Luca Balbi
vect2str prints out a numeric vector into a string. Fully customisable.

12 Downloads

Updated 27 May 2008

View License

vect2str accepts a row or column vector as input and yields a formatted string in output. The default formatting is the common "(x1, x2, ... , xn)" format; other customised formats can be created by using the options provided.

Example:
>> x = [pi exp(1)];
>> vect2str(x)
ans =
(3.141593, 2.718282)
>> vect2str(x, 'formatstring', '%5.2f')
ans =
( 3.14, 2.72)

See also the function help

Cite As

Luca Balbi (2021). vect2str -- vector to string conversion (https://www.mathworks.com/matlabcentral/fileexchange/20036-vect2str-vector-to-string-conversion), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Leo Hoarty

Nice work, very useful one decade later...

hamed abdulaziz

Luca Balbi:

Good work

K T

Very useful

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!