No BSD License  

Highlights from
savefile

3.0

3.0 | 2 ratings Rate this file 4 Downloads (last 30 days) File Size: 1.35 KB File ID: #8764

savefile

by Sahar Sodoudi

 

20 Oct 2005 (Updated 20 Oct 2005)

function savefile saves workspace variable FILE as a formatted matrix FILENAME to disk.

| Watch this File

File Information
Description

function savefile(file,path,format,index)

function savefile saves workspace variable FILE as a formatted matrix FILENAME to disk.

Input:
FILE workspace variable
PATH path and filename of saved FILE (output)

FORMAT Field Width and Precision Specifications of output

INDEX Conversion characters
 Conversion characters specify the notation of the output.
 SpecifierDescription:
 c Single character%dDecimal notation (signed)
 e Exponential notation (using a lowercase e as in 3.1415e+00)
 E Exponential notation (using an uppercase E as in 3.1415E+00)
 f Fixed-point notation
 g The more compact of e or f , as defined in [2]. Insignificant zeros do not print.
 G Same as %g, but using an uppercase E
 i Decimal notation (signed)
 o Octal notation (unsigned)
 s String of characters
 u Decimal notation (unsigned)
 x Hexadecimal notation (using lowercase letters a-f)
 X Hexadecimal notation (using uppercase letters A-F)

example
file1=rand(3,5);
savefile (file1,'d:\output.txt',5.2,'f')

MATLAB release MATLAB 6.5.1 (R13SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
20 Oct 2005 urs (us) schwarz

1) we would simply use (the more versatile) DLMWRITE
2) your help is a bit confusing: why use the token FILE? something like VAR or VARIABLE would be more appropriate
3) there is no error check after fopen

just a few thoughts
us

19 Apr 2006 saad asad

hiiiii

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
matrices Sahar Sodoudi 22 Oct 2008 08:03:30
save matrix Cristina McIntire 10 Dec 2008 16:36:14
formatted data 1 Cristina McIntire 10 Dec 2008 16:36:14

Contact us at files@mathworks.com