Writing Paragraphs Into a Text File

조회 수: 3 (최근 30일)
Jacob Mevorach
Jacob Mevorach 2017년 5월 11일
댓글: Jacob Mevorach 2017년 5월 12일
So I'm currently running a GUI and I'd like to have an option for users to be able to push a button and type in some notes, as in a couple of paragraphs, into a box of some sort (sort of like a bigger version of the edit text) and then save the results as a text file with correct formatting in the event that something goes wrong with the script or they'd like to leave a comment. I'm kind of lost on how I would even start this so if anyone could even point me in the right direction I'd really appreciate it.
  댓글 수: 2
Jan
Jan 2017년 5월 11일
What about starting Matlab's editor? What is a "bigger" version of the edit text?
Jacob Mevorach
Jacob Mevorach 2017년 5월 12일
I meant the editable text box in the GUI editor. I was hoping I could in some way pop up a large editable text box that I could then save and retrieve at will so users could log comments and the like. Thank you though, this is a great way to do things. I didn't realize you could just type "edit report.txt" and suddenly you'd be editing a text file called "report" in the MATLAB IDE.

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

채택된 답변

Walter Roberson
Walter Roberson 2017년 5월 11일
TheHandle = uicontrol('Style','edit','Max',2, 'units','norm','position',[0 0 .5 .5]);
Now allow the user to type whatever they want into the space.
user_typing = cellstr( get(TheHandle, 'string') );
  댓글 수: 1
Jacob Mevorach
Jacob Mevorach 2017년 5월 12일
Jan's method works too but I think I'll end up going with this one. Thank you!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by