How to write a string matrix in to a txt file
7 次查看(过去 30 天)
显示 更早的评论
Hi, I have stored some information in to a matrix sized n x 2. All cells are individual strings. The structure is like this:
A={[filename1.txt], []
[vector1 m x 1], [vector2 m x 1
[filename2.txt], []
[vector3 p x 1], [vector4 p x 1}
etc...
So the odd row is just a txt-file name and empty string and every second row has two information vectors (same sized). How to write this down to a file row-by-row.
Thank you.
2 个评论
Walter Roberson
2017-11-23
Is your structure
A = {'filename1.txt', []; 'vector1 m x 1', 'vector2 m x 1'; ...}
or is it
A = {'filename1.txt', ''; 'vector1 m x 1', 'vector2 m x 1'; ...}
or is it
A = {"filename1.txt", ""; "vector1 m x 1", "vector2 m x 1"; ...}
or is it
A = {{'filename1.txt'}, {''}; {'vector1 m x 1'}, {'vector2 m x 1'}; ...}
or something else?
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Low-Level File I/O 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
