필터 지우기
필터 지우기

Save output matrix to .dat file

조회 수: 27 (최근 30일)
Ali Kareem
Ali Kareem 2015년 11월 25일
댓글: Walter Roberson 2015년 11월 25일
Hi,
How I can save my output result Matrix (100*100) to .dat file

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 25일
".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
Ali Kareem
Ali Kareem 2015년 11월 25일
Hi,
Thank you for your reply. Please I want to read it in C language.
Regards
Walter Roberson
Walter Roberson 2015년 11월 25일
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.' );

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by