how to save digital output

조회 수: 2 (최근 30일)
Yuanju Chao
Yuanju Chao 2019년 11월 27일
답변: Walter Roberson 2019년 11월 28일
a=[ 1 0 1 0 1 1 0 0 1 1 0];
save a_out.txt -ascii a
1.0000000e+00 0.0000000e+00 1.0000000e+00 0.0000000e+00 1.0000000e+00 1.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e+00 1.0000000e+00 0.0000000e+00
is there a way to save it as
1 0 1 0 1 1 0 0 1 1 0? as digital output so I can feed it into simualtor?

답변 (2개)

Walter Roberson
Walter Roberson 2019년 11월 28일
dlmwrite('a_out.txt', a, 'delimiter', ' ');

Akira Agata
Akira Agata 2019년 11월 28일
How about using writematrix function?
writematrix(a,'a_out.txt','Delimiter',' ');
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 11월 28일
Note that writematrix() needs R2019b or later.

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

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by