Help with GUI - Push button
Show older comments
Hello! I created a GUI with Matlab, that gives me two numbers as output. These two numbers are visualized into two 'Edit text' commands. Now, what I need to do is to save this two numbers in a .txt file, by using a 'Push button' command. Let's suppose that the tags associated to the 'Edit text' commands (where the two numbers are visualized) are num1 and num2, while the tag associated to the 'Push button' command is save . What I want to do when pressing the Push button save is: (1) choose the folder where to save the two numbers; (2) save the two numbers as a unique .txt file containing the two numbers (e.g. numbers_file.txt or number_file.dat). How can I translate this into a matlab code (i.e. the callback function of the push button save ?). Thank you
Accepted Answer
More Answers (1)
Iain
on 21 Aug 2014
This should be what you need:
value1 = get(num1,'String')
folder = uigetdir();
dlmwrite - though you might go for a csv instead of .txt...
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!