How do I display data/information with Matlab App Designer?

19k views Asked by At

I would like to display some information to the user via Matlab App Designer's GUI. I am new to this program and can't seem to find a widget that provides what I feel should be a simple function. Am I missing something? Examples would include showing the user:

  1. The path of the file that he/she selected
  2. Errors such as "No files detected" that are printed in a Matlab script called on by the GUI code.
  3. Other print statements in code such as "Done!", etc that will inform the user when a process is complete.

Is there a way to capture the output in the Matlab command line and report these in a window of some sort in the GUI? Thanks in advance!

1

There are 1 answers

0
Velo Steve On

You can use a TextArea to display information for the user. Here's how I made a simple example:

  1. Drag a button to the app in design view.
  2. Drag in a text area also. I changed the label to Feedback.
  3. Select the button and use the Callbacks tab in the bottom right of app designer to add a callback with the default name it gives you.
  4. Edit the callback to contain

        answer = 'what your want to display';
        app.FeedbackTextArea.Value = answer;
    

When you push the button the text area gets filled. In your code, instead of just setting 'answer' to some string, set a variable using whatever code is dealing with your user's information. The key is to store what you want the user to see in a variable and then assign that to the "Value" parameter of the text area or other widget where you want them to see the results.