How to save & export .mlapp edit box results

Hey dear MATLABer
I've been practice using MATLAB .mlapp (under R2017b) to build a GUI with multilple edit box, and some action buttons (like 'ok', 'continue' and 'cancel')
Since this GUI will be called by other .m functions, and I need to save and export the user typed numbers inside the edit box. But I am not sure how shall these data's been export, I know the edit box values are can be found in app.Editlabel1.Value, but how shall I save and handle this data outside .mlapp? And I also want to extend .mlapp
I have read one related question (https://www.mathworks.com/matlabcentral/answers/284140-call-an-mlapp-with-input-argument-s), but seems not helping with my case

Réponses (1)

Cris LaPierre
Cris LaPierre le 12 Déc 2018
Modifié(e) : Cris LaPierre le 12 Déc 2018

0 votes

There are a few ways to do it. Does this post or this post give you what you are looking for?

5 commentaires

Kat Lee
Kat Lee le 12 Déc 2018
Modifié(e) : Kat Lee le 13 Déc 2018
It answered part of my question, but for "save" (or "OK") button, how shall I assign actions for that button.
EDIT: I have tried using the assignin('base', 'EditFiledName',mymlapp), but it didnt return any values
Cris LaPierre
Cris LaPierre le 13 Déc 2018
Not sure what your variable name is. but I think you want to do something like this:
assignin('base', 'EditFiledName',app.EditField.Value)
I'm using r2018b, btw.
Kat Lee
Kat Lee le 13 Déc 2018
shall this "assignin" command put as a callback or shall it's included when build that edit filed
Cris LaPierre
Cris LaPierre le 13 Déc 2018
That is your call as the code designer. Put it in a callback that executes when you want to save the variables to the workspace. It will have to be in a callback, but you can decide where based on the behavior you want.
It would be natural to put it in the callback of a button that will save when pressed.
Kat Lee
Kat Lee le 14 Déc 2018
thank you @Cris
at this point I think mlapp will be better to create a stand-alone GUI, but not really convenient to use as a addin GUI function. Because I found not only export data, but also hard to import data . I was trying to assign each edit box with some user predefined values, found it's pretty confusing to add.

Connectez-vous pour commenter.

Catégories

Question posée :

le 12 Déc 2018

Commenté :

le 14 Déc 2018

Community Treasure Hunt

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

Start Hunting!

Translated by