How to create .dat file using matlab

조회 수: 16 (최근 30일)
PRASHIK GAIKWAD
PRASHIK GAIKWAD 2018년 9월 29일
답변: Adam Danz 2018년 9월 30일
%% Given data begin = 1; step = 10; end_data = 100; n1 = begin:step p1 = isprime(n1) n1(p1) data = p1; save 'myfile.dat' data -ascii load myfile.dat

답변 (1개)

Adam Danz
Adam Danz 2018년 9월 30일
Here's a low-level method customized to your variable data which is a logical vector that gets written to file myfile.dat'.
fid = fopen('myfile.dat', 'w');
fprintf(fid, '%d ', data);
fclose(fid)
For more information on this method and how to format the data, see

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by