You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
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 .
General Information
- Version 1.0.0.0 (723 Bytes)
-
No License
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
