No BSD License  

Highlights from
writeascii

5.0

5.0 | 2 ratings Rate this file 1 Download (last 30 days) File Size: 4.84 KB File ID: #4138

writeascii

by alex sanchez

 

12 Nov 2003 (Updated 03 Apr 2006)

Saves vector, matrix (up to 3 dimensions) ...

| Watch this File

File Information
Description

Easy function to write ASCII files

USAGE:
  show = writeascii(outfile,data,dataformat,outperm)

DESCRIPTION:
  Saves vector, matrix (up to 3 dimensions), string,
  or cell array data into an ASCII file.

INPUT VARIABLES:
  outfile = Name of out-file
      default 'data.asc'
  data = Vector, matrix (up to 3 dimensions), string,
      or cell array data
  dataformat = format used for all columns of numeric data
          e.g. '%5.6f ', ' %2g\t'
          default is calculated using the highest decimal or
              used in each column of data or 8 which ever is lower
              if the data is a string, '%s' is used as the format
      or delimiter to be used between columns
          e.g. ' ', '\t'
          default '\t' %tab, helps makes it easier to import to excel
  outperm = Permision for out-file used with fopen
      e.g. 'a', 'w+'
      default 'w'

OUTPUT VARIABLES:
  show = string saying the name of the out-file and
      where it was saved

VALID INPUT FORMATS:
  writeascii(data)
  writeascii(outfile,data)
  writeascii(outfile,data,dataformat)
  writeascii(outfile,data,dataformat,outperm)

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
29 Mar 2004 Sikun (George) Xu

I am quite new to Matlab. I will not give overall rating since I do not know.

I found that this function has loopholes:
when saving a matrix, it put all data in one line instead of in differents rows.

the simple solution is to replace '\n" with '\r\n' in function. then it will do the job to put the data according their rows in matrix.

18 Jun 2004 m hawarey

thanks.. it worked fine with me.

09 Nov 2007 Jalal A

Great Job.

Please login to add a comment or rating.
Updates
18 Nov 2003

Improvements

15 Feb 2005

Much faster and efficient

03 Apr 2006

update

Tag Activity for this File
Tag Applied By Date/Time
data import alex sanchez 22 Oct 2008 07:09:22
data export alex sanchez 22 Oct 2008 07:09:22
saving ascii files alex sanchez 22 Oct 2008 07:09:22
complex structures alex sanchez 22 Oct 2008 07:09:22
utilities alex sanchez 22 Oct 2008 07:09:22
data alex sanchez 22 Oct 2008 07:09:22
export alex sanchez 22 Oct 2008 07:09:22

Contact us at files@mathworks.com