필터 지우기
필터 지우기

save as ascii files

조회 수: 23 (최근 30일)
harley
harley 2013년 8월 4일
how to i make 2 columns in the text file i get 1 continuous column for variables Vb & pH.
fid = fopen('gc_test.txt', 'wt');
fprintf(fid, '%4.4f\n', Vb, pH);
fclose(fid);

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 4일
편집: Azzi Abdelmalek 2013년 8월 4일
fid = fopen('gc_test.txt', 'wt');
fprintf(fid, '%4.4f\n', [Vb;pH]);
fclose(fid);
If you want two columns
Vb=[1;2;3];
pH=[4;5;6];
fid = fopen('gc_test.txt', 'wt');
fprintf(fid, '%4.4f %4.4f\n',[Vb,pH]' );
fclose(fid);
  댓글 수: 3
harley
harley 2013년 8월 4일
works, thanks very much Azzi.
regards
Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 4일
A={0.0500 0.7557 ;0.1000 1.0567}
header={'Vb' 'pH'}
fid = fopen('gc_test.txt', 'wt');
fprintf(fid,'%s %s\n',header{:})
fprintf(fid, '%4.4f %4.4f\n',A{:} );
fclose(fid);

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

추가 답변 (0개)

카테고리

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