cell2file

版本 1.0.0.0 (1.6 KB) 作者: Luca Cerone
cell2files writes cells of a cellarray (both numeric and text ones) to a file
1.7K 次下载
更新时间 2008/5/6

查看许可证

cell2file writes a cell array of strings, or number into a file
==This function has been obtained modifyng the file str2file.m I found in the FEX.==
Last Modified: 2008/01/09 (yyyy/mm/dd).

Syntax: cell2file(fid,cell,....) where ... is in the format PARAMETER, VALUE

Possible Parameter are: 'EndOfLine'
to choose how to end lines (ex:\r\n),
default: \n)

'Delimiter' to choose the delimiter beetween two value of the same row,
default: ';'

cell2str can write to a file both sting and numeric format.

You just have to pass the handle to the file
(so that you can choice your opening attribute) and the cellarray.

Ex:
A={'prova',[1],'prova';
[3],'txt',[4]};

fid=fopen('prova.log','a+');
cell2file(fid,A,'EndOfLine','\r\n');
fclose(fid);

引用格式

Luca Cerone (2024). cell2file (https://www.mathworks.com/matlabcentral/fileexchange/17954-cell2file), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2007a
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

参考作品: str2file

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Bug fix:
now it doesn't write delimiter after last element and doesnt write an EndOfLine
after last Row.