Suggestions about GUI development

2 visualizzazioni (ultimi 30 giorni)
mz123
mz123 il 5 Giu 2019
Modificato: Adam il 6 Giu 2019
Good afternoon,
I have in mind a simple project but I'm not sure how to start it. Currently I'm using an Excel spreadsheet where every day I put in one single value coming from an instrument and I plot it to see if it lies within some low/upper limit. It is a very basic control chart.
I did a very stupid script in Matlab, where I generate a random number let's say 2.00, add it to an array D(1,1), plot the array, save the variable and exit. Next run, I load again D, I generate another new random number and I save it in D(2,1) and so on... so D has no a fixed dimension... it is continued updated every day. This process relies to the fact that I have to save and load the numeric array from the workspace to be plotted/updated.
I'd like to do it in a more elegant way, but I have no clues. My ambition is to create an .exe file which will consist of a simple GUI containing buttons and of course the graph.
Is there a way to save past data within the GUI, so that every time I launch the .exe I can see the plot with all the values?
That is my idea at the moment, but I'm open to suggestions or other techniques to accomlish the task.
Thanks

Risposta accettata

Blaise Konzel
Blaise Konzel il 5 Giu 2019
Saving past data and repopulating it everytime you open the GUI is relatively simple. I am not so sure that I understand what you are asking about the .exe file. A simple way to save past info in GUI's is to write your data code in the function that initiates the GUI opening. You can do this by calling another function from that opening function and sending with it the array you are editing everyday and saving it to a localized file on your computer(probably excel). Everytime you enter a value it will be saved in that file and everytime you open the GUI that file will be opened and populate your matlab array. Hope this made sense.
Look more into opening excel files in matlab here : https://www.mathworks.com/help/matlab/ref/xlsread.html
  4 Commenti
Rik
Rik il 6 Giu 2019
Another solution would be to use getpref and setpref. Those also store data to a file, but where that file is, is hidden from the user.
mz123
mz123 il 6 Giu 2019
Yes of course, much lighter and flexible.
Thank you for your help.

Accedi per commentare.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by