MATLAB: Suggestions about GUI development

control chartguideMATLABmatlab guiplot

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

Best Answer

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