필터 지우기
필터 지우기

how to export the values from matrix into txt file?

조회 수: 2 (최근 30일)
Muhammad RSMY
Muhammad RSMY 2018년 1월 3일
편집: Muhammad RSMY 2018년 1월 3일
hi friends
I have matrix suppose
[100 10]=size(matrix)
I want export the values of matrix in table format in txt
for example the output should look like
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
:
:
thanks for your kind support

채택된 답변

KSSV
KSSV 2018년 1월 3일
A = rand(7) ;
fid = fopen('data.txt','w') ;
fprintf(fid,[repmat('%f\t', 1, size(A, 2)) '\n'], A');
fclose(fid) ;
Also read about dlmwrite, save.
  댓글 수: 1
Muhammad RSMY
Muhammad RSMY 2018년 1월 3일
편집: Muhammad RSMY 2018년 1월 3일
Thanks for your kind response,,
but in txt its not giving the same dimension
I need the dimension of table should be 100*10
*NOTED* Ok I will ready about dimension.. thanks
thanks once again

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by