tdfwrite (export data in Tab delimited format)

버전 1.2.0.0 (1.62 KB) 작성자: Rafael Palacios
The structure returned by tdfread (Statistics tbx) can be stored with tdfwrite.
다운로드 수: 1.4K
업데이트 날짜: 2009/10/22

라이선스 보기

Matlab comes with a function called tdfread, which is one of the best functions for reading text files because it can handle numerical and textual data.
It reads textfiles with a header (to describe each column) and many rows of data. It surpasses Excel limitations with large number of rows.
tdfread creates a structure with as many fields as columns in the file, using column names as field names.

Unfortunately Matlab does not provide tdfwrite, so here it is.
It is as simple as tdfread and does exactly the opposite. It generates a textfile, creating a header with structure field names, then stores the data in textual format.

function tdfwrite(filename,st)

st is a structure created with st=tdfread('file.tab');
st is a structure with several fields. Each field is a vector of numbers or a matrix of char.

Example:
If the file textfile.tab is the following:
Latitude » Longitude » City
42.3584 » -71.0598 » Boston
40.4167 » -3.7003 » Madrid
41.8955 » 12.4823 » Rome

You can use
>> z=tdfread('textfile.tab');
>> tdfwrite('newfile.tab',z);

Then newfile.tab will look like this:
Latitude » Longitude » City
42.358400000000003 » -71.059799999999996 » Boston
40.416699999999999 » -3.7002999999999999 » Madrid
41.895499999999998 » 12.4823 » Rome

인용 양식

Rafael Palacios (2024). tdfwrite (export data in Tab delimited format) (https://www.mathworks.com/matlabcentral/fileexchange/25622-tdfwrite-export-data-in-tab-delimited-format), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

tdfread is not part of standard Matlab, it is only available with statistics toolbox.
tdfwrite works in any Matlab configuration

1.1.0.0

Corrected Tags in description

1.0.0.0