Save output matrix to .dat file

Risposte (1)

Walter Roberson
Walter Roberson il 25 Nov 2015

0 voti

".dat" is used as an extension by many different programs. There is no standard file format for it. You need to know the exact arrangement of data that is required by the program that will read in the data. There might already be a routine to do the saving (depending which program it is) or you might have to write one using fopen()/fwrite()/fclose() and memmapfile() might turn out to be useful.

2 Commenti

Ali Kareem
Ali Kareem il 25 Nov 2015
Hi,
Thank you for your reply. Please I want to read it in C language.
Regards
fid = fopen('YourOutput.dat', 'w');
fwrite(fid, YourArray);
fclose(fid);
Note: C indexes increase fastest along the rows but MATLAB indexes increase fastest along the columns. You may wish to transpose your data as you write it.
fwrite(fid, YourArray.' );

Accedi per commentare.

Tag

Richiesto:

il 25 Nov 2015

Commentato:

il 25 Nov 2015

Community Treasure Hunt

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

Start Hunting!

Translated by