No BSD License  

Highlights from
MAT2STR2

Be the first to rate this file! 1 Download (last 30 days) File Size: 765 Bytes File ID: #7152
image thumbnail

MAT2STR2

by Daniel Claxton

 

15 Mar 2005 (Updated 17 Mar 2005)

Converts matrix to formatted string.

| Watch this File

File Information
Description

MAT2STR2 Convert a 2-D matrix to eval'able string.

STR = MAT2STR2(MAT) converts the matrix MAT to a MATLAB string
 
STR = MAT2STR2(MAT,FORMAT) uses the format string used in C to format the matrix entries
 
    Example:
        MAT2STR2(rand(4),'%1.2f')
 
    Returns:
         0.18 0.54 0.47 0.73
         0.98 0.67 0.68 0.88
         0.51 0.47 0.24 0.57
         0.76 0.35 0.45 0.52
 
    MAT2STR2 also works for 3-D arrays
 
    See also MAT2STR, NUM2STR, INT2STR, SPRINTF.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
17 Mar 2005 Daniel Claxton

Small error in code (Line 37)
I'm posting a new version
Check to make sure that line 37 does not look like
old:
out = [out; sprintf([d '\n'],A(:,:,i))];

And does look like
new:
out = [out; sprintf([d '\n'],A(:,:,i)')];

Please login to add a comment or rating.
Updates
17 Mar 2005

Small error in code (Line 37)
old:
out = [out; sprintf([d '\n'],A(:,:,i))];

new
out = [out; sprintf([d '\n'],A(:,:,i)')];

Tag Activity for this File
Tag Applied By Date/Time
data import Daniel Claxton 22 Oct 2008 07:43:25
data export Daniel Claxton 22 Oct 2008 07:43:25
mat2str Daniel Claxton 22 Oct 2008 07:43:25
string Daniel Claxton 22 Oct 2008 07:43:25
matrix Daniel Claxton 22 Oct 2008 07:43:25
conversion Daniel Claxton 22 Oct 2008 07:43:25
sprintf Daniel Claxton 22 Oct 2008 07:43:25

Contact us at files@mathworks.com