App Designer - Writing Data to Txt File
조회 수: 56 (최근 30일)
이전 댓글 표시
I am building a GUI using app designer and I want to be able to input data into the GUI and then write it into a text file.
The data should write as a vector
I used fprintf, but I'm no expert on app designer and it didn't seem to work.
Does anyone have an example of how to write data to a text file using app designer?
댓글 수: 0
답변 (1개)
Reshma Nerella
2021년 2월 18일
Hi,
For instance,
v = 1:5 %vector you want to insert
Now write it in the text file
f = fopen('filename.txt','w'); %Open or create new file for writing. Discard existing contents, if any.
fprintf(f,'%d\n',v); % Writes every element of vector in a new line in the file
fclose(f); % Close the file
Hope this helps!
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Export에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!