- the format string need to have 3 conversion operators (or as many as you want on each line).
- the matrix needs to be tranposed.
Converting a matrix of strings to a txt file
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
Hi there!
I have a mtarix of strings x_mtarix:
x_matrix = 
 5×3 string array
    "A"        "B"      "C" 
    "AA"       "BB"     "CC"
    "AAA"      "BBB"    " " 
    "AAAA"     " "      " " 
    "AAAAA"    " "      " " 
which I would like to save in a text file that woul contain the x_matrix values keping the same appearance:
A          B          C
AA       BB        CC
AAA    BBB   
AAAA
AAAAA
I have used an assortment of variations of:
fid = fopen('output.txt','wt');
fprintf(fid,'%s\n',x_matrix); 
fclose(fid);
But I dont quite get the results I want
Thanks  in advance
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

