How to export script to text file ?
조회 수: 19 (최근 30일)
이전 댓글 표시
hello please help me to export my code into .txt extension. Is it possible ?
i already tried this code, but it failed
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1643801/image.png)
댓글 수: 0
채택된 답변
Dyuman Joshi
2024년 3월 16일
export() does not support writing data into files.
a = "good";
b = "morning";
c = "babynumber";
d = 1:10;
%Simplified/vectorized method
str = a + b + c + string(d.')
%write the variable into a txt file
%change the file name as per your liking
writematrix(str, 'Filename.txt')
%checking the contents of the file
type('Filename.txt')
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!