savefile
No License
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')
Cite As
Sahar Sodoudi (2026). savefile (https://www.mathworks.com/matlabcentral/fileexchange/8764-savefile), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
