Code covered by the BSD License  

Highlights from
String representations for most data types

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 4.85 KB File ID: #38566

String representations for most data types

by Rody Oldenhuis

 

11 Oct 2012

Generate string representations of all Matlab data types, and most user-defined classes.

| Watch this File

File Information
Description

TOSTRING implements an often-requested feature that is not built into Matlab: represent some data as a string.

Supported and tested data types (of any dimension):

double, single, logical, char, int[X], uint[X], cell, struct, function_handle, any user-implemented class name.

The default string representation is as verbose as possible, meaning that the contents of structure fields, cell array
entries, etc. are represented in fully expanded form.

S = TOSTRING(A, 'disp') produces a string representation that is identical to what the command 'disp(A)' would produce.

S = TOSTRING(A, 'compact') or S = TOSTRING(A, N) (with N a positive integer) limits the number of digits displayed in numerical arrays to either 4 ('compact') or N. A warning is issued when applied to a non-numeric array.

First version -- report any bugs to one of the e-mail addresses mentioned in the function header.

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File  
Everyone's Tags
conversion to string(2), data manipulation, disp, display, string conversion, string manipulation, to string
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Contact us