필터 지우기
필터 지우기

save workspace variables to *.dat along with int type

조회 수: 3 (최근 30일)
David
David 2011년 5월 11일
How to save workspace to *.dat along with int type?
  댓글 수: 1
Fangjun Jiang
Fangjun Jiang 2011년 5월 11일
What is the format of your *.dat file? Is it a text based file?

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

답변 (1개)

Jan
Jan 2011년 5월 11일
If you have a STRUCT or CELL in the workspace, what result do you expect after saving the data to a dat file with INT type? I cannot imagine, that there is a reliable solution for the general task.
Please post any details.
  댓글 수: 2
David
David 2011년 5월 12일
>> a=[1 2 3 4]
a =
1 2 3 4
>> save a.dat a -ascii
>>
open the a.dat, the content is as below.
1.0000000e+000 2.0000000e+000 3.0000000e+000 4.0000000e+000
It is float format.
If I wish it is integer format in a.dat.
How to use save instruction?
Thank you.
Jan
Jan 2011년 5월 12일
a = int32(1:4);
save a.dat a -ascii
or:
fid = fopen('a.dat', 'w');
fprintf('%d ', a);
fclose(fid);

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

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by