How can I save a .dat file?

조회 수: 7 (최근 30일)
John
John 2014년 6월 23일
답변: mario rivera 2016년 4월 10일
I opened a .dat file for reading on Matlab. It is shown as 2 tables on Matlab , one is one-dimension with the names of the variables and the other has all the values of the variable. I changed some (10) values on Matlab and now I want to save it as a new .dat file , or just save the changes to the old. Can you help me?? thanks
  댓글 수: 1
José-Luis
José-Luis 2014년 6월 23일
There is no universal ".dat" format. Usually, it means that the file stores text. So, depending on the complexity of structure used to store said data, you could use some high-level io routines ( dlmwrite(), save '-ascii' ) or you might be forced to go low-level ( fprintf() ).

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

답변 (2개)

David Sanchez
David Sanchez 2014년 6월 23일
take a look at the documentation of fprintf
doc fprintf
You will find right what you need

mario rivera
mario rivera 2016년 4월 10일
Hello, I have saved a 3D matrix(22x23x27) using succesfully save "matrixname".dat. But when I try to load the file again in another script, the matrix showned is a 2D matrix (283251x9). How can I fix this mess?

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by