Print Table to a File.

조회 수: 4 (최근 30일)
Pappu Murthy
Pappu Murthy 2018년 5월 20일
댓글: Pappu Murthy 2018년 5월 24일
I have this code
VarNames={'Col1', 'Col2'};
RowNames={'Row1', 'Row2'};
A = [1 2;3 5];
Ta = array2table(A,'VariableNames',VarNames,'RowNames',RowNames)
When I execute this i get table printed properly formatted but on to a screen.
I like similar tables one after other several of them, to a file properly formatted every time.
all tables are of equal size. I tried writetable but that does not seem to be the answer.
How do I do it? Thanks in advance.
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 5월 20일
What does "properly formatted" mean to you?
Pappu Murthy
Pappu Murthy 2018년 5월 20일
편집: Pappu Murthy 2018년 5월 20일
For e.g Ta =
Col1 Col2
____ ____
Row1 1 2
Row2 3 5

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

채택된 답변

Image Analyst
Image Analyst 2018년 5월 20일
Try fopen(), fprintf(), and fclose(). With those three functions you can make it look exactly how you want it to look.
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 5월 21일
Make sure you use width specifications on all of your % formats, to get everything lined up the way you want.
Pappu Murthy
Pappu Murthy 2018년 5월 24일
Got it. thanks guys.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by